room 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/VERSION +1 -1
  2. data/bin/room +2 -0
  3. data/room.gemspec +2 -2
  4. data/rooms/tweets.rb +13 -6
  5. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/bin/room CHANGED
@@ -67,6 +67,8 @@ loop do
67
67
  x
68
68
  end
69
69
 
70
+ save!
71
+
70
72
  break unless line
71
73
  Room.do line.chomp
72
74
 
data/room.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{room}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tom Lieber"]
12
- s.date = %q{2011-04-18}
12
+ s.date = %q{2011-04-20}
13
13
  s.default_executable = %q{room}
14
14
  s.description = %q{the game is making the game}
15
15
  s.email = %q{tom@alltom.com}
data/rooms/tweets.rb CHANGED
@@ -34,6 +34,16 @@ def authorize_url
34
34
  request_token.authorize_url
35
35
  end
36
36
 
37
+ def configure
38
+ Twitter.configure do |config|
39
+ config.consumer_key = $ALPHA
40
+ config.consumer_secret = $OMEGA
41
+ config.oauth_token = $state[:twitter_token]
42
+ config.oauth_token_secret = $state[:twitter_secret]
43
+ end
44
+ $configured = true
45
+ end
46
+
37
47
  def authorize pin
38
48
  begin
39
49
  access = request_token.get_access_token(:oauth_verifier => pin)
@@ -41,12 +51,7 @@ def authorize pin
41
51
  $state[:twitter_token] = access.token
42
52
  $state[:twitter_secret] = access.secret
43
53
 
44
- Twitter.configure do |config|
45
- config.consumer_key = $ALPHA
46
- config.consumer_secret = $OMEGA
47
- config.oauth_token = $state[:twitter_token]
48
- config.oauth_token_secret = $state[:twitter_secret]
49
- end
54
+ configure
50
55
  rescue Exception
51
56
  nil
52
57
  end
@@ -57,6 +62,8 @@ def tweet_display_format message
57
62
  end
58
63
 
59
64
  def latest_tweets
65
+ configure unless $configured
66
+
60
67
  tweets = begin
61
68
  Twitter.home_timeline($state[:last_tweet_id] ? { :since_id => $state[:last_tweet_id] } : {}).reverse
62
69
  rescue Twitter::Unauthorized
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: room
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tom Lieber
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-18 00:00:00 -07:00
18
+ date: 2011-04-20 00:00:00 -07:00
19
19
  default_executable: room
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency