Sha256: 655442bf2e567be46e3842a942fb0f6db41702d7c1f513df77fd10431d70c840

Contents?: true

Size: 760 Bytes

Versions: 7

Compression:

Stored size: 760 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

7 entries across 7 versions & 2 rubygems

Version Path
twurl-0.6.5 lib/twurl/configuration_controller.rb
twurl-0.6.4 lib/twurl/configuration_controller.rb
twurl-0.6.3 lib/twurl/configuration_controller.rb
twurl-0.6.2 lib/twurl/configuration_controller.rb
mbbx6spp-twurl-0.6.1 lib/twurl/configuration_controller.rb
twurl-0.6.1 lib/twurl/configuration_controller.rb
twurl-0.6.0 lib/twurl/configuration_controller.rb