Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/rdoc/rdoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,14 @@ def gather_files files

file_list = remove_unparseable(file_list)

result = []
if file_list.count {|name, mtime|
result << name if mtime || @options.force_update
file_list[name] = @last_modified[name] unless mtime
mtime
} > 0
@last_modified.replace file_list
file_list.keys.sort
result.sort
else
[]
end
Expand Down
11 changes: 11 additions & 0 deletions test/rdoc/test_rdoc_rdoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ def test_gather_files
assert_equal [a, b], @rdoc.gather_files([b, a, b])
end

def test_gather_files_with_no_force_update
a = File.expand_path __FILE__
b = File.expand_path '../test_rdoc_text.rb', __FILE__

assert_equal [a, b], @rdoc.gather_files([a, b])

@rdoc.last_modified[a] -= 10
@rdoc.options.force_update = false
assert_equal [a], @rdoc.gather_files([a, b])
end

def test_handle_pipe
$stdin = StringIO.new "hello"

Expand Down