Class: Twurl::ConfigurationController
- Inherits:
-
AbstractCommandController
- Object
- AbstractCommandController
- Twurl::ConfigurationController
- Defined in:
- lib/twurl/configuration_controller.rb
Constant Summary collapse
- UNRECOGNIZED_SETTING_MESSAGE =
"Unknown configuration setting: '%s'"
Instance Attribute Summary
Attributes inherited from AbstractCommandController
Instance Method Summary collapse
Methods inherited from AbstractCommandController
Constructor Details
This class inherits a constructor from Twurl::AbstractCommandController
Instance Method Details
#dispatch ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/twurl/configuration_controller.rb', line 4 def dispatch case .subcommands.first when 'default' if profile = case .subcommands.size when 2 OAuthClient.load_client_for_username(.subcommands.last) when 3 OAuthClient.load_client_for_username_and_consumer_key(*.subcommands[-2, 2]) end OAuthClient.rcfile.default_profile = profile OAuthClient.rcfile.save end else CLI.puts(UNRECOGNIZED_SETTING_MESSAGE % .subcommands.first) end end |