lib/tap/support/gems/rake.rb in bahuvrihi-tap-0.10.6 vs lib/tap/support/gems/rake.rb in bahuvrihi-tap-0.10.7
- old
+ new
@@ -19,12 +19,15 @@
base.env = Tap::Env.instance
end
attr_accessor :env
- def collect_tasks
- ARGV.collect! do |arg|
+ def collect_tasks(*args)
+ # a little song and dance for compliance with
+ # rake pre- and post-0.8.2
+ argv = args.empty? ? ARGV : args[0]
+ argv.collect! do |arg|
next(arg) unless arg =~ /^:([a-z_\d]+):(.*)$/
env_pattern = $1
rake_task = $2
next(arg) unless entry = env.find(:envs, env_pattern, false)
@@ -53,10 +56,10 @@
namespaces.join(":")
else
fail "No Rakefile found for '#{env_pattern}' (looking for: #{@rakefiles.join(', ')})"
end
end
-
+
super
end
def have_rakefile(dir=nil)
return super() if dir == nil