Sha256: 1312659c5e5cf6daf389b7f751fa513310c65db47d92290f11f6ea21f95603f3

Contents?: true

Size: 692 Bytes

Versions: 7

Compression:

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

7 entries across 7 versions & 2 rubygems

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