Class: Rubuild::Options
- Inherits:
-
Object
- Object
- Rubuild::Options
- Defined in:
- lib/rubuild/options.rb
Overview
Rubuild::Options Command-line processing.
Instance Method Summary collapse
-
#initialize(args) ⇒ Options
constructor
A new instance of Options.
Constructor Details
#initialize(args) ⇒ Options
Returns a new instance of Options.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/rubuild/options.rb', line 13 def initialize(args) self. = [] self. = 'Rutop' self. = args.dup OptionParser.new do |opts| opts. = 'Usage: rubuild [options]' opts.separator '' opts.on( '-f', '--file FILE', "Run Rubuild script from FILE. Defaults to #{self.file}") do |file| self. = file end opts.on( '-I', '--include-path PATH', 'Add PATH to the list of directories to search for Rubuild files.') do |path| self. << path end end.order!(self.) end |