Commits

Richo Healey committed d05b19a

\#config must actually return a config object, ya dikchead

Comments (0)

Files changed (2)

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
+          config.default_account.to_sym
         end
     end
 

lib/twat/config.rb

     def config
       begin
         @config ||= YAML.load_file(config_path)
-        validate(@config)
+        validate!(@config)
       rescue Errno::ENOENT
         raise NoConfigFile
       end
     end
 
-    def validate(conf)
+    def validate!(conf)
       # TODO Proper checks, instead of a series of hackish checks
       raise ConfigVersionIncorrect unless conf.include?(:accounts)
+      conf
     end
 
     def save!