Class: StackFu::Commands::ConfigCommand
- Includes:
- ApiHooks, ProvidersCredentials
- Defined in:
- lib/stackfu/commands/config_command.rb
Constant Summary
Constants included from Rendering
Constants included from OperatingSystems
OperatingSystems::FriendlyNames, OperatingSystems::OperatingSystems
Instance Attribute Summary
Attributes inherited from Command
#errors, #options, #parameters, #subcommand
Instance Method Summary collapse
- #default(parameters, options) ⇒ Object
- #slicehost(parameters, options) ⇒ Object
- #webbynode(parameters, options) ⇒ Object
Methods included from ProvidersCredentials
#add_slicehost_credentials, #add_webbynode_credentials
Methods included from ApiHooks
Methods inherited from Command
#command, command_for, create, inherited, #initialize, #params?, #run, #valid?
Methods included from Rendering
#done, #error, #fill_values_from_options, #menu_for, #render_target, #spinner, #table, #warning
Methods included from OperatingSystems
Constructor Details
This class inherits a constructor from StackFu::Commands::Command
Instance Method Details
#default(parameters, options) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/stackfu/commands/config_command.rb', line 6 def default(parameters, ) while true login = [:login] || ask("StackFu Login: ") token = [:token] || ask("StackFu Token: ") break if [:login] and [:token] puts "" break if agree("Is this information correct? ", true) puts "" puts "OK, let's try it again" puts "" end puts "" puts "Configuration saved to #{ENV['HOME']}/.stackfu" save_config(login, token) end |
#slicehost(parameters, options) ⇒ Object
30 31 32 33 |
# File 'lib/stackfu/commands/config_command.rb', line 30 def slicehost(parameters, ) user = spinner { User.find(:all).first } add_slicehost_credentials(user) end |
#webbynode(parameters, options) ⇒ Object
25 26 27 28 |
# File 'lib/stackfu/commands/config_command.rb', line 25 def webbynode(parameters, ) user = spinner { User.find(:all).first } add_webbynode_credentials(user) end |