Commits

Richo Healey committed 7a38954

Highlight tweets at you in red

Comments (0)

Files changed (3)

 
 On the upside, it'll make unit testing similar.  
 (Add unit tests)
+
+Add an option to beep when you're mentioned.
 end
 
 class String
+  # TODO - It'd be nice to implement the colors support here, maybe even only
+  # mix this in if it's enabled?
   def red
     "#{self}"
   end
   def bold
     "#{self}"
   end
+
+  def mentions?(name)
+    return self.downcase.include?(name.to_s.downcase)
+  end
 end
 
 module Twat

lib/twat/actions.rb

       if config.colors?
         if twt.user.screen_name == account_name.to_s
           puts "#{twt.user.screen_name.bold.blue}: #{twt.text}"
+        elsif twt.text.mentions?(account_name)
+          puts "#{twt.user.screen_name.bold.red}: #{twt.text}"
         else
           puts "#{twt.user.screen_name.bold.cyan}: #{twt.text}"
         end
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.