summaryrefslogtreecommitdiff
path: root/lib/rake/task_arguments.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rake/task_arguments.rb')
-rw-r--r--lib/rake/task_arguments.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/rake/task_arguments.rb b/lib/rake/task_arguments.rb
index 4417af2..0094682 100644
--- a/lib/rake/task_arguments.rb
+++ b/lib/rake/task_arguments.rb
@@ -15,16 +15,27 @@ module Rake
@names = names
@parent = parent
@hash = {}
+ @values = values
names.each_with_index { |name, i|
@hash[name.to_sym] = values[i] unless values[i].nil?
}
end
+ # Retrive the complete array of sequential values
+ def to_a
+ @values.dup
+ end
+
+ # Retrive the list of values not associated with named arguments
+ def extras
+ @values[@names.length..-1] || []
+ end
+
# Create a new argument scope using the prerequisite argument
# names.
def new_scope(names)
- values = names.collect { |n| self[n] }
- self.class.new(names, values, self)
+ values = names.map { |n| self[n] }
+ self.class.new(names, values + extras, self)
end
# Find an argument value by name or index.