Commits

Richo Healey  committed 959d1dc

Use account and default from newstyle config

  • Participants
  • Parent commits d05b19a

Comments (0)

Files changed (3)

File lib/twat/actions.rb

     end
 
     def show
-      puts account
-      return
       twitter_auth
       Twitter.home_timeline.each_with_index do |tweet, idx|
         puts "#{tweet.user.screen_name.bold.cyan}: #{tweet.text}"
         if opts.include?(:account)
           opts[:account]
         else
-          config.default_account.to_sym
+          config.default_account
         end
     end
 

File lib/twat/argparse.rb

 module Twat
-  REQUIRED = [:account]
+  REQUIRED = []
   MSG_REQUIRED = [:tweet]
 
   class ArgParse
       options = Hash.new
       @optparser = OptionParser.new do |opts|
         options[:action] = :tweet
-        options[:account] = :default
         opts.banner = "Usage: twat <tweet>"
 
         opts.on('-n', '--account ACCOUNT', 'Use ACCOUNT (or default)') do |acct| #{{{ --account ACCOUNT

File lib/twat/config.rb

 
     def default_account
       raise NoDefaultAccount unless config.include?(:default)
-      raise NoSuchAccount unless config[:accounts].include(config[:default])
-      return config[:accounts][config[:default]]
+      return config[:default].to_sym
     end
 
     def self.consumer_info