Commits

Richo Healey committed a7ea408 Merge

Merge branch 'master' into config

Comments (0)

Files changed (2)

     "#{self}"
   end
 
+  def green
+    "#{self}"
+  end
+
+  def yellow
+    "#{self}"
+  end
+
+  def blue
+    "#{self}"
+  end
+
   def cyan
     "#{self}"
   end
 module Twat
   VERSION_MAJOR = 0
   VERSION_MINOR = 4
-  VERSION_PATCH = 0
+  VERSION_PATCH = 1
 
   VERSION = "#{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_PATCH}"
   class Twat

lib/twat/actions.rb

     def show
       twitter_auth
       Twitter.home_timeline.each_with_index do |tweet, idx|
-        puts "#{tweet.user.screen_name.bold.cyan}: #{tweet.text}"
+        format(tweet)
 
         break if idx == opts[:count]
       end
 
     private
 
+    # Format a tweet all pretty like
+    def format(twt)
+      # if config.color
+      if twt.user.screen_name == account_name.to_s
+        puts "#{twt.user.screen_name.bold.blue}: #{twt.text}"
+      else
+        puts "#{twt.user.screen_name.bold.cyan}: #{twt.text}"
+      end
+    end
+
     def twitter_auth
       Twitter.configure do |twit|
         account.each do |key, value|