Commits

Richo Healey  committed 36d3910 Merge

Merge branch 'colors'

  • Participants
  • Parent commits 3fa89ba, dc80d16

Comments (0)

Files changed (2)

     "#{self}"
   end
 
+  def green
+    "#{self}"
+  end
+
+  def yellow
+    "#{self}"
+  end
+
+  def blue
+    "#{self}"
+  end
+
   def cyan
     "#{self}"
   end

File 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|