twat 0.4.4 → 0.4.5

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.
data/doc/twat.1 CHANGED
@@ -34,7 +34,9 @@ Options include
34
34
  .IP default=account
35
35
  Sets account as the default
36
36
  .IP colors=<true|false>
37
- Turns colors on or off in the output from twat.
37
+ Turns colors on or off in the output from twat. [defaults on]
38
+ .IP beep=<true|false>
39
+ Beep when a new tweet mentioning you is recieved (Handy in tmux). [defaults off]
38
40
  .IP --update-config
39
41
  Twat is a rolling release and as such, sometimes it is necessary to change the
40
42
  format of it's internal config file. Rather than making changes without user
data/lib/twat/actions.rb CHANGED
@@ -72,6 +72,7 @@ module Twat
72
72
  def process_followed(tweets)
73
73
  last_id = nil
74
74
  tweets.reverse.each do |tweet|
75
+ beep if config.beep? && tweet.text.mentions?(account_name)
75
76
  format(tweet)
76
77
  last_id = tweet.id
77
78
  end
@@ -175,5 +176,9 @@ module Twat
175
176
  end
176
177
  end
177
178
 
179
+ def beep
180
+ print "\a"
181
+ end
182
+
178
183
  end
179
184
  end
data/lib/twat/config.rb CHANGED
@@ -53,6 +53,11 @@ module Twat
53
53
  Options.bool_true?(colors)
54
54
  end
55
55
 
56
+ def beep?
57
+ beep = config[:beep] || "false"
58
+ Options.bool_true?(beep)
59
+ end
60
+
56
61
  def default_account
57
62
  raise NoDefaultAccount unless config.include?(:default)
58
63
  return config[:default].to_sym
data/lib/twat/options.rb CHANGED
@@ -46,5 +46,12 @@ module Twat
46
46
  config.save!
47
47
  end
48
48
 
49
+ def beep=(value)
50
+ val = value.to_sym
51
+ raise InvalidBool unless Options.bool_valid?(val)
52
+ config[:beep] = val
53
+ config.save!
54
+ end
55
+
49
56
  end
50
57
  end
data/lib/twat.rb CHANGED
@@ -45,7 +45,7 @@ end
45
45
  module Twat
46
46
  VERSION_MAJOR = 0
47
47
  VERSION_MINOR = 4
48
- VERSION_PATCH = 4
48
+ VERSION_PATCH = 5
49
49
 
50
50
  VERSION = "#{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_PATCH}"
51
51
  class Twat
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.4
4
+ version: 0.4.5
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: &20814960 !ruby/object:Gem::Requirement
16
+ requirement: &15590620 !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: *20814960
24
+ version_requirements: *15590620
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: oauth
27
- requirement: &20814260 !ruby/object:Gem::Requirement
27
+ requirement: &15590160 !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: *20814260
35
+ version_requirements: *15590160
36
36
  description: Command line tool for tweeting and whatnot
37
37
  email:
38
38
  - richo@psych0tik.net