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
3 changes: 2 additions & 1 deletion lib/rake/file_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def *(other)

def <<(obj)
resolve
@items << Rake.from_pathname(obj)
fn = Rake.from_pathname(obj)
@items << fn unless excluded_from_list?(fn)
self
end

Expand Down
10 changes: 10 additions & 0 deletions test/test_rake_file_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ def test_append_pathname
assert_equal ["a.rb"], fl
end

def test_append_respects_exclude
fl = FileList.new
fl.exclude "abc.c"
fl << "abc.c"
assert_equal [], fl

fl << "xyz.c"
assert_equal ["xyz.c"], fl
end

def test_add_many
fl = FileList.new
fl.include %w(a d c)
Expand Down