35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/rake_pipeline.rb', line 35
def step_dependencies(name, dependencies = nil)
re = Regexp.new(/(?:^|\/)#{name}\/.*$/)
if Rake.application.last_description
add_description(re, name, Rake.application.last_description)
end
if dependencies.nil? && ! @@last_step.nil?
dependencies = @@last_step
end
@@last_step = name
case
when dependencies.nil?
re
when String === dependencies || Symbol === dependencies
{re => lambda{|filename| filename.sub(name.to_s,dependencies.to_s) }}
when Array === dependencies
{re => lambda{|filename| dependencies.collect{|dep| filename.sub(name.to_s, dep.to_s) } }}
when Proc === dependencies
{re => dependencies}
end
end
|