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 15, 2023
1 parent fe0b1ba commit bd30b03
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/rake/task_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,30 +289,30 @@ 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 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
if (ext = Rake.from_pathname(ext)).is_a?(String)
ext
if (prereq = Rake.from_pathname(prereq)).is_a?(String)
prereq
else
fail "Don't know how to handle rule dependent: #{ext.inspect}"
fail "Don't know how to handle rule dependent: #{prereq.inspect}"
end
end
}
Expand Down

0 comments on commit bd30b03

Please sign in to comment.