twat 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/TODO +2 -0
  2. data/lib/twat.rb +7 -1
  3. data/lib/twat/actions.rb +2 -0
  4. metadata +5 -5
data/TODO CHANGED
@@ -15,3 +15,5 @@ method.. which means abstracting it's output..)
15
15
 
16
16
  On the upside, it'll make unit testing similar.
17
17
  (Add unit tests)
18
+
19
+ Add an option to beep when you're mentioned.
@@ -11,6 +11,8 @@ require 'oauth'
11
11
  end
12
12
 
13
13
  class String
14
+ # TODO - It'd be nice to implement the colors support here, maybe even only
15
+ # mix this in if it's enabled?
14
16
  def red
15
17
  "#{self}"
16
18
  end
@@ -34,12 +36,16 @@ class String
34
36
  def bold
35
37
  "#{self}"
36
38
  end
39
+
40
+ def mentions?(name)
41
+ return self.downcase.include?(name.to_s.downcase)
42
+ end
37
43
  end
38
44
 
39
45
  module Twat
40
46
  VERSION_MAJOR = 0
41
47
  VERSION_MINOR = 4
42
- VERSION_PATCH = 3
48
+ VERSION_PATCH = 4
43
49
 
44
50
  VERSION = "#{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_PATCH}"
45
51
  class Twat
@@ -132,6 +132,8 @@ module Twat
132
132
  if config.colors?
133
133
  if twt.user.screen_name == account_name.to_s
134
134
  puts "#{twt.user.screen_name.bold.blue}: #{twt.text}"
135
+ elsif twt.text.mentions?(account_name)
136
+ puts "#{twt.user.screen_name.bold.red}: #{twt.text}"
135
137
  else
136
138
  puts "#{twt.user.screen_name.bold.cyan}: #{twt.text}"
137
139
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-10-07 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: twitter
16
- requirement: &14528640 !ruby/object:Gem::Requirement
16
+ requirement: &20814960 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *14528640
24
+ version_requirements: *20814960
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: oauth
27
- requirement: &14528080 !ruby/object:Gem::Requirement
27
+ requirement: &20814260 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *14528080
35
+ version_requirements: *20814260
36
36
  description: Command line tool for tweeting and whatnot
37
37
  email:
38
38
  - richo@psych0tik.net