Module: ORS::Config::ModuleMethods
- Included in:
- ORS::Config
- Defined in:
- lib/ors/config.rb
Instance Method Summary collapse
Instance Method Details
#parse_options(options) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ors/config.rb', line 13 def self.name = name_from_git self.environment = .shift unless .empty? or .first.match(/^-/) .each do |option| case option when "-p", "--pretend" then self.pretending = true when "-ng", "--no-gateway" then self.use_gateway = false end end end |
#valid_environments ⇒ Object
29 30 31 |
# File 'lib/ors/config.rb', line 29 def valid_environments %w(production demo staging) end |
#valid_options? ⇒ Boolean
25 26 27 |
# File 'lib/ors/config.rb', line 25 def name.to_s.size > 0 and valid_environments.include?(environment) end |