Skip to content
Merged
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: 2 additions & 2 deletions lib/rake/task_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ def make_sources(task_name, task_pattern, extensions)
when /^\./
source = task_name.sub(task_pattern, ext)
source == ext ? task_name.ext(ext) : source
when String
ext
when String, Symbol
ext.to_s
when Proc, Method
if ext.arity == 1
ext.call(task_name)
Expand Down
11 changes: 11 additions & 0 deletions test/test_rake_rules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ def test_rule_prereqs_can_be_created_by_string
assert_equal [OBJFILE], @runs
end

def test_rule_prereqs_can_be_created_by_symbol
task :nonfile do |t|
@runs << t.name
end
rule ".o" => :nonfile do |t|
@runs << t.name
end
Task[OBJFILE].invoke
assert_equal ["nonfile", OBJFILE], @runs
end

def test_plain_strings_as_dependents_refer_to_files
create_file(SRCFILE)
rule ".o" => SRCFILE do |t|
Expand Down