TaskAguments manage the arguments passed to a task.
Create a TaskArgument object with a list of named arguments (given by :names) and a set of associated values (given by :values). :parent is the parent argument object.
# File lib/rake.rb, line 341 341: def initialize(names, values, parent=nil) 342: @names = names 343: @parent = parent 344: @hash = {} 345: names.each_with_index { |name, i| 346: @hash[name.to_sym] = values[i] unless values[i].nil? 347: } 348: end
Find an argument value by name or index.
# File lib/rake.rb, line 358 358: def [](index) 359: lookup(index.to_sym) 360: end
# File lib/rake.rb, line 369 369: def each(&block) 370: @hash.each(&block) 371: end
# File lib/rake.rb, line 373 373: def method_missing(sym, *args, &block) 374: lookup(sym.to_sym) 375: end
Create a new argument scope using the prerequisite argument names.
# File lib/rake.rb, line 352 352: def new_scope(names) 353: values = names.collect { |n| self[n] } 354: self.class.new(names, values, self) 355: end
# File lib/rake.rb, line 391 391: def lookup(name) 392: if @hash.has_key?(name) 393: @hash[name] 394: elsif ENV.has_key?(name.to_s) 395: ENV[name.to_s] 396: elsif ENV.has_key?(name.to_s.upcase) 397: ENV[name.to_s.upcase] 398: elsif @parent 399: @parent.lookup(name) 400: end 401: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.