Class: Befog::Commands::Configure
- Inherits:
-
Object
- Object
- Befog::Commands::Configure
- Defined in:
- lib/befog/commands/configure.rb
Instance Attribute Summary
Attributes included from Mixins::Command
Instance Method Summary collapse
Methods included from Mixins::Help
Methods included from Mixins::Safely
Methods included from Mixins::Scope
#_bank, #account_key, #account_secret, #bank, #bank?, #bank_name, #banks, #compute, #flavor, #flavor?, #get_server, #image, #image?, #keypair, #keypair?, #price, #provider, #provider?, #provider_name, #providers, #region, #region?, #security_group, #security_group?, #servers, #servers=
Methods included from Mixins::Configurable
#_configuration, #configuration, #configuration_name, #configuration_path, included, #save
Methods included from Mixins::Command
#command, #error, included, #initialize, #log, #process_options, #usage
Instance Method Details
#run ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/befog/commands/configure.rb', line 59 def run safely do %w( key secret ).each do |key| _key = key.to_sym provider[key] = [_key] if [_key] end %w( region image keypair group type price ).each do |key| _key = key.to_sym bank[key] = [_key] if [_key] end if [:bank] and [:provider] bank["provider"] = [:provider] end save end end |