Created
December 24, 2009 19:33
-
-
Save botanicus/263325 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rake 'spec[spec/rake]' # => "spec/rake" | |
# rake spec # => "/bin:/usr/bin:/usr/local/bin" | |
task :spec, :path do |task, args| | |
p args.path | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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