Class: Vedeu::Configuration
- Inherits:
-
Object
- Object
- Vedeu::Configuration
- Defined in:
- lib/vedeu/configuration.rb
Class Method Summary collapse
Instance Method Summary collapse
- #configure ⇒ Object
-
#initialize(args = []) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(args = []) ⇒ Configuration
7 8 9 10 |
# File 'lib/vedeu/configuration.rb', line 7 def initialize(args = []) @args = args = {} end |
Class Method Details
.configure(args = []) ⇒ Object
3 4 5 |
# File 'lib/vedeu/configuration.rb', line 3 def self.configure(args = []) new(args).configure end |
Instance Method Details
#configure ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/vedeu/configuration.rb', line 12 def configure parser = OptionParser.new do |opts| opts. = "Usage: #{$PROGRAM_NAME} [options]" opts.on('-1', '--run-once', 'Run application once.') do [:interactive] = false end opts.on('-c', '--cooked', 'Run application in cooked mode.') do [:mode] = :cooked end opts.on('-r', '--raw', 'Run application in raw mode (default).') do [:mode] = :raw end opts.on('-d', '--debug', 'Run application with debugging on.') do [:debug] = true end end parser.parse!(args) end |