Skip to content

Commit

Permalink
Rename variable names of make sources method
Browse files Browse the repository at this point in the history
  • Loading branch information
gemmaro committed Dec 20, 2023
1 parent 4a63d6a commit 73ee66c
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions lib/rake/task_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,29 +289,29 @@ def attempt_rule(task_name, task_pattern, args, extensions, block, level)
end

# Make a list of sources from the list of file name extensions /
# translation procs.
def make_sources(task_name, task_pattern, extensions)
result = extensions.map { |ext|
case ext
# file paths / translation procs.
def make_sources(task_name, task_pattern, prereqs)
result = prereqs.map { |prereq|
case prereq
when /%/
task_name.pathmap(ext)
task_name.pathmap(prereq)
when %r{/}
ext
prereq
when /^\./
source = task_name.sub(task_pattern, ext)
source == ext ? task_name.ext(ext) : source
source = task_name.sub(task_pattern, prereq)
source == prereq ? task_name.ext(prereq) : source
when String, Symbol
ext.to_s
prereq.to_s
when Pathname
Rake.from_pathname(ext)
Rake.from_pathname(prereq)
when Proc, Method
if ext.arity == 1
ext.call(task_name)
if prereq.arity == 1
prereq.call(task_name)
else
ext.call
prereq.call
end
else
fail "Don't know how to handle rule dependent: #{ext.inspect}"
fail "Don't know how to handle rule dependent: #{prereq.inspect}"
end
}
result.flatten
Expand Down

0 comments on commit 73ee66c

Please sign in to comment.