Sha256: e5fd05b7e7ff04e7c85b1f0b464363692256feb263af1ece9ff0bade5292dfd6

Contents?: true

Size: 693 Bytes

Versions: 15

Compression:

Stored size: 693 Bytes

Contents

module Twurl
  class AccountInformationController < AbstractCommandController
    NO_AUTHORIZED_ACCOUNTS_MESSAGE = "No authorized accounts"

    def dispatch
      rcfile = OAuthClient.rcfile
      if rcfile.empty?
        CLI.puts NO_AUTHORIZED_ACCOUNTS_MESSAGE
      else
        profiles = rcfile.profiles
        profiles.keys.sort.each do |account_name|
          CLI.puts account_name
          profiles[account_name].each do |consumer_key, _|
            account_summary = "  #{consumer_key}"
            account_summary << " (default)" if rcfile.default_profile == [account_name, consumer_key]
            CLI.puts account_summary
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

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