Created
August 30, 2011 17:37
-
-
Save btaitelb/1181461 to your computer and use it in GitHub Desktop.
allows unnamed arguments for rake task to be retrieved
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 initialize(names, values, parent=nil) | |
@names = names | |
@parent = parent | |
@hash = {} | |
values.each_with_index { |val, i| | |
name = (names[i] || "param#{i}").to_sym | |
@hash[name] = val | |
} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment