Skip to content

Instantly share code, notes, and snippets.

@botanicus
Created December 24, 2009 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save botanicus/263325 to your computer and use it in GitHub Desktop.
Save botanicus/263325 to your computer and use it in GitHub Desktop.
# rake 'spec[spec/rake]' # => "spec/rake"
# rake spec # => "/bin:/usr/bin:/usr/local/bin"
task :spec, :path do |task, args|
p args.path
end
module Rake
class TaskArguments
def lookup(name)
if @hash.has_key?(name)
@hash[name]
elsif ENV.has_key?(name.to_s)
ENV[name.to_s]
elsif ENV.has_key?(name.to_s.upcase)
ENV[name.to_s.upcase]
elsif @parent
@parent.lookup(name)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment