Sha256: f1ace383d1af60778ef93a6854b8f4480c2ff48f687b055822a6e74454252da0

Contents?: true

Size: 761 Bytes

Versions: 15

Compression:

Stored size: 761 Bytes

Contents

module Twurl
  class ConfigurationController < AbstractCommandController
    UNRECOGNIZED_SETTING_MESSAGE = "Unknown configuration setting: '%s'"
    def dispatch
      case options.subcommands.first
      when 'default'
        if profile = case options.subcommands.size
                     when 2
                       OAuthClient.load_client_for_username(options.subcommands.last)
                     when 3
                       OAuthClient.load_client_for_username_and_consumer_key(*options.subcommands[-2, 2])
                     end

          OAuthClient.rcfile.default_profile = profile
          OAuthClient.rcfile.save
        end
      else
        CLI.puts(UNRECOGNIZED_SETTING_MESSAGE % options.subcommands.first)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
twurl-0.9.7 lib/twurl/configuration_controller.rb
twurl-0.9.6 lib/twurl/configuration_controller.rb
twurl-0.9.5 lib/twurl/configuration_controller.rb
twurl-0.9.4 lib/twurl/configuration_controller.rb
twurl-0.9.3 lib/twurl/configuration_controller.rb
twurl-0.9.2 lib/twurl/configuration_controller.rb
twurl-0.9.1 lib/twurl/configuration_controller.rb
twurl-0.9.0 lib/twurl/configuration_controller.rb
twurl-0.8.3 lib/twurl/configuration_controller.rb
twurl-0.8.2 lib/twurl/configuration_controller.rb
twurl-0.8.1 lib/twurl/configuration_controller.rb
twurl-0.8.0 lib/twurl/configuration_controller.rb
twurl-0.7.0 lib/twurl/configuration_controller.rb
twurl-0.6.7 lib/twurl/configuration_controller.rb
twurl-0.6.6 lib/twurl/configuration_controller.rb