Skip to content

Commit 8e2e80a

Browse files
committed
Accept Pathname object as rule's prerequisite
1 parent fe0b1ba commit 8e2e80a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/rake/task_manager.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,18 +302,16 @@ def make_sources(task_name, task_pattern, extensions)
302302
source == ext ? task_name.ext(ext) : source
303303
when String, Symbol
304304
ext.to_s
305+
when Pathname
306+
Rake.from_pathname(ext)
305307
when Proc, Method
306308
if ext.arity == 1
307309
ext.call(task_name)
308310
else
309311
ext.call
310312
end
311313
else
312-
if (ext = Rake.from_pathname(ext)).is_a?(String)
313-
ext
314-
else
315-
fail "Don't know how to handle rule dependent: #{ext.inspect}"
316-
end
314+
fail "Don't know how to handle rule dependent: #{ext.inspect}"
317315
end
318316
}
319317
result.flatten

0 commit comments

Comments
 (0)