tweetstream 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of tweetstream might be problematic. Click here for more details.
- data/README.md +12 -11
- data/lib/tweetstream/client.rb +158 -199
- data/lib/tweetstream/version.rb +1 -1
- data/spec/fixtures/delete.json +8 -0
- data/spec/fixtures/favorite.json +150 -0
- data/spec/fixtures/limit.json +5 -0
- data/spec/fixtures/scrub_geo.json +8 -0
- data/spec/fixtures/status_withheld.json +7 -0
- data/spec/fixtures/user_withheld.json +6 -0
- data/spec/spec_helper.rb +10 -12
- data/spec/tweetstream/client_authentication_spec.rb +2 -2
- data/spec/tweetstream/client_site_stream_spec.rb +5 -5
- data/spec/tweetstream/client_spec.rb +52 -63
- data/spec/tweetstream/client_userstream_spec.rb +16 -5
- data/tweetstream.gemspec +1 -1
- metadata +121 -34
@@ -34,29 +34,40 @@ describe TweetStream::Client do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
it "uses the userstream uri" do
|
37
|
-
|
37
|
+
@client.should_receive(:start).once.with("/2/user.json", an_instance_of(Hash)).and_return(@stream)
|
38
38
|
@client.userstream
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'supports "replies"' do
|
42
|
-
@client.should_receive(:start).once.with(
|
42
|
+
@client.should_receive(:start).once.with("/2/user.json", hash_including(:replies => 'all')).and_return(@stream)
|
43
43
|
@client.userstream(:replies => 'all')
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'supports "stall_warnings"' do
|
47
|
-
@client.should_receive(:start).once.with(
|
47
|
+
@client.should_receive(:start).once.with("/2/user.json", hash_including(:stall_warnings => 'true')).and_return(@stream)
|
48
48
|
@client.userstream(:stall_warnings => 'true')
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'supports "with followings"' do
|
52
|
-
@client.should_receive(:start).once.with(
|
52
|
+
@client.should_receive(:start).once.with("/2/user.json", hash_including(:with => 'followings')).and_return(@stream)
|
53
53
|
@client.userstream(:with => 'followings')
|
54
54
|
end
|
55
55
|
|
56
56
|
it 'supports "with user"' do
|
57
|
-
@client.should_receive(:start).once.with(
|
57
|
+
@client.should_receive(:start).once.with("/2/user.json", hash_including(:with => 'user')).and_return(@stream)
|
58
58
|
@client.userstream(:with => 'user')
|
59
59
|
end
|
60
|
+
|
61
|
+
it 'supports event callbacks' do
|
62
|
+
event = nil
|
63
|
+
@stream.should_receive(:each).and_yield(fixture('favorite.json'))
|
64
|
+
@client.on_event(:favorite) do |e|
|
65
|
+
event = e
|
66
|
+
end.userstream
|
67
|
+
|
68
|
+
event[:source].should_not be_nil
|
69
|
+
event[:target].should_not be_nil
|
70
|
+
end
|
60
71
|
end
|
61
72
|
end
|
62
73
|
|
data/tweetstream.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.homepage = 'http://github.com/intridea/tweetstream'
|
13
13
|
|
14
14
|
s.add_dependency 'em-twitter', '~> 0.1'
|
15
|
-
s.add_dependency 'twitter', '~>
|
15
|
+
s.add_dependency 'twitter', '~> 4.0'
|
16
16
|
s.add_dependency 'daemons', '~> 1.1'
|
17
17
|
s.add_dependency 'multi_json', '~> 1.3'
|
18
18
|
s.add_dependency 'em-http-request', '~> 1.0.2'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tweetstream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-09-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: em-twitter
|
17
|
-
requirement:
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,21 +22,31 @@ dependencies:
|
|
22
22
|
version: '0.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements:
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0.1'
|
26
31
|
- !ruby/object:Gem::Dependency
|
27
32
|
name: twitter
|
28
|
-
requirement:
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
29
34
|
none: false
|
30
35
|
requirements:
|
31
36
|
- - ~>
|
32
37
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
38
|
+
version: '4.0'
|
34
39
|
type: :runtime
|
35
40
|
prerelease: false
|
36
|
-
version_requirements:
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '4.0'
|
37
47
|
- !ruby/object:Gem::Dependency
|
38
48
|
name: daemons
|
39
|
-
requirement:
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
40
50
|
none: false
|
41
51
|
requirements:
|
42
52
|
- - ~>
|
@@ -44,10 +54,15 @@ dependencies:
|
|
44
54
|
version: '1.1'
|
45
55
|
type: :runtime
|
46
56
|
prerelease: false
|
47
|
-
version_requirements:
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '1.1'
|
48
63
|
- !ruby/object:Gem::Dependency
|
49
64
|
name: multi_json
|
50
|
-
requirement:
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
51
66
|
none: false
|
52
67
|
requirements:
|
53
68
|
- - ~>
|
@@ -55,10 +70,15 @@ dependencies:
|
|
55
70
|
version: '1.3'
|
56
71
|
type: :runtime
|
57
72
|
prerelease: false
|
58
|
-
version_requirements:
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ~>
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '1.3'
|
59
79
|
- !ruby/object:Gem::Dependency
|
60
80
|
name: em-http-request
|
61
|
-
requirement:
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
62
82
|
none: false
|
63
83
|
requirements:
|
64
84
|
- - ~>
|
@@ -66,10 +86,15 @@ dependencies:
|
|
66
86
|
version: 1.0.2
|
67
87
|
type: :runtime
|
68
88
|
prerelease: false
|
69
|
-
version_requirements:
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ~>
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 1.0.2
|
70
95
|
- !ruby/object:Gem::Dependency
|
71
96
|
name: guard-rspec
|
72
|
-
requirement:
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
73
98
|
none: false
|
74
99
|
requirements:
|
75
100
|
- - ! '>='
|
@@ -77,10 +102,15 @@ dependencies:
|
|
77
102
|
version: '0'
|
78
103
|
type: :development
|
79
104
|
prerelease: false
|
80
|
-
version_requirements:
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
81
111
|
- !ruby/object:Gem::Dependency
|
82
112
|
name: json
|
83
|
-
requirement:
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
84
114
|
none: false
|
85
115
|
requirements:
|
86
116
|
- - ! '>='
|
@@ -88,10 +118,15 @@ dependencies:
|
|
88
118
|
version: '0'
|
89
119
|
type: :development
|
90
120
|
prerelease: false
|
91
|
-
version_requirements:
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ! '>='
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
92
127
|
- !ruby/object:Gem::Dependency
|
93
128
|
name: pry
|
94
|
-
requirement:
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
95
130
|
none: false
|
96
131
|
requirements:
|
97
132
|
- - ! '>='
|
@@ -99,10 +134,15 @@ dependencies:
|
|
99
134
|
version: '0'
|
100
135
|
type: :development
|
101
136
|
prerelease: false
|
102
|
-
version_requirements:
|
137
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
103
143
|
- !ruby/object:Gem::Dependency
|
104
144
|
name: rake
|
105
|
-
requirement:
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
106
146
|
none: false
|
107
147
|
requirements:
|
108
148
|
- - ! '>='
|
@@ -110,10 +150,15 @@ dependencies:
|
|
110
150
|
version: '0'
|
111
151
|
type: :development
|
112
152
|
prerelease: false
|
113
|
-
version_requirements:
|
153
|
+
version_requirements: !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ! '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
114
159
|
- !ruby/object:Gem::Dependency
|
115
160
|
name: rdiscount
|
116
|
-
requirement:
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
117
162
|
none: false
|
118
163
|
requirements:
|
119
164
|
- - ! '>='
|
@@ -121,10 +166,15 @@ dependencies:
|
|
121
166
|
version: '0'
|
122
167
|
type: :development
|
123
168
|
prerelease: false
|
124
|
-
version_requirements:
|
169
|
+
version_requirements: !ruby/object:Gem::Requirement
|
170
|
+
none: false
|
171
|
+
requirements:
|
172
|
+
- - ! '>='
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '0'
|
125
175
|
- !ruby/object:Gem::Dependency
|
126
176
|
name: rspec
|
127
|
-
requirement:
|
177
|
+
requirement: !ruby/object:Gem::Requirement
|
128
178
|
none: false
|
129
179
|
requirements:
|
130
180
|
- - ! '>='
|
@@ -132,10 +182,15 @@ dependencies:
|
|
132
182
|
version: '0'
|
133
183
|
type: :development
|
134
184
|
prerelease: false
|
135
|
-
version_requirements:
|
185
|
+
version_requirements: !ruby/object:Gem::Requirement
|
186
|
+
none: false
|
187
|
+
requirements:
|
188
|
+
- - ! '>='
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '0'
|
136
191
|
- !ruby/object:Gem::Dependency
|
137
192
|
name: simplecov
|
138
|
-
requirement:
|
193
|
+
requirement: !ruby/object:Gem::Requirement
|
139
194
|
none: false
|
140
195
|
requirements:
|
141
196
|
- - ! '>='
|
@@ -143,10 +198,15 @@ dependencies:
|
|
143
198
|
version: '0'
|
144
199
|
type: :development
|
145
200
|
prerelease: false
|
146
|
-
version_requirements:
|
201
|
+
version_requirements: !ruby/object:Gem::Requirement
|
202
|
+
none: false
|
203
|
+
requirements:
|
204
|
+
- - ! '>='
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: '0'
|
147
207
|
- !ruby/object:Gem::Dependency
|
148
208
|
name: webmock
|
149
|
-
requirement:
|
209
|
+
requirement: !ruby/object:Gem::Requirement
|
150
210
|
none: false
|
151
211
|
requirements:
|
152
212
|
- - ! '>='
|
@@ -154,10 +214,15 @@ dependencies:
|
|
154
214
|
version: '0'
|
155
215
|
type: :development
|
156
216
|
prerelease: false
|
157
|
-
version_requirements:
|
217
|
+
version_requirements: !ruby/object:Gem::Requirement
|
218
|
+
none: false
|
219
|
+
requirements:
|
220
|
+
- - ! '>='
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
158
223
|
- !ruby/object:Gem::Dependency
|
159
224
|
name: yajl-ruby
|
160
|
-
requirement:
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
161
226
|
none: false
|
162
227
|
requirements:
|
163
228
|
- - ! '>='
|
@@ -165,10 +230,15 @@ dependencies:
|
|
165
230
|
version: '0'
|
166
231
|
type: :development
|
167
232
|
prerelease: false
|
168
|
-
version_requirements:
|
233
|
+
version_requirements: !ruby/object:Gem::Requirement
|
234
|
+
none: false
|
235
|
+
requirements:
|
236
|
+
- - ! '>='
|
237
|
+
- !ruby/object:Gem::Version
|
238
|
+
version: '0'
|
169
239
|
- !ruby/object:Gem::Dependency
|
170
240
|
name: yard
|
171
|
-
requirement:
|
241
|
+
requirement: !ruby/object:Gem::Requirement
|
172
242
|
none: false
|
173
243
|
requirements:
|
174
244
|
- - ! '>='
|
@@ -176,7 +246,12 @@ dependencies:
|
|
176
246
|
version: '0'
|
177
247
|
type: :development
|
178
248
|
prerelease: false
|
179
|
-
version_requirements:
|
249
|
+
version_requirements: !ruby/object:Gem::Requirement
|
250
|
+
none: false
|
251
|
+
requirements:
|
252
|
+
- - ! '>='
|
253
|
+
- !ruby/object:Gem::Version
|
254
|
+
version: '0'
|
180
255
|
description: TweetStream allows you to easily consume the Twitter Streaming API utilizing
|
181
256
|
the YAJL Ruby gem.
|
182
257
|
email:
|
@@ -208,10 +283,16 @@ files:
|
|
208
283
|
- lib/tweetstream/daemon.rb
|
209
284
|
- lib/tweetstream/site_stream_client.rb
|
210
285
|
- lib/tweetstream/version.rb
|
286
|
+
- spec/fixtures/delete.json
|
211
287
|
- spec/fixtures/direct_messages.json
|
288
|
+
- spec/fixtures/favorite.json
|
212
289
|
- spec/fixtures/ids.json
|
213
290
|
- spec/fixtures/info.json
|
291
|
+
- spec/fixtures/limit.json
|
292
|
+
- spec/fixtures/scrub_geo.json
|
293
|
+
- spec/fixtures/status_withheld.json
|
214
294
|
- spec/fixtures/statuses.json
|
295
|
+
- spec/fixtures/user_withheld.json
|
215
296
|
- spec/spec_helper.rb
|
216
297
|
- spec/tweetstream/client_authentication_spec.rb
|
217
298
|
- spec/tweetstream/client_site_stream_spec.rb
|
@@ -241,15 +322,21 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
241
322
|
version: '0'
|
242
323
|
requirements: []
|
243
324
|
rubyforge_project:
|
244
|
-
rubygems_version: 1.8.
|
325
|
+
rubygems_version: 1.8.23
|
245
326
|
signing_key:
|
246
327
|
specification_version: 3
|
247
328
|
summary: TweetStream is a simple wrapper for consuming the Twitter Streaming API.
|
248
329
|
test_files:
|
330
|
+
- spec/fixtures/delete.json
|
249
331
|
- spec/fixtures/direct_messages.json
|
332
|
+
- spec/fixtures/favorite.json
|
250
333
|
- spec/fixtures/ids.json
|
251
334
|
- spec/fixtures/info.json
|
335
|
+
- spec/fixtures/limit.json
|
336
|
+
- spec/fixtures/scrub_geo.json
|
337
|
+
- spec/fixtures/status_withheld.json
|
252
338
|
- spec/fixtures/statuses.json
|
339
|
+
- spec/fixtures/user_withheld.json
|
253
340
|
- spec/spec_helper.rb
|
254
341
|
- spec/tweetstream/client_authentication_spec.rb
|
255
342
|
- spec/tweetstream/client_site_stream_spec.rb
|