tweetstream 2.6.0 → 2.6.1
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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/Rakefile +11 -1
- data/lib/tweetstream.rb +1 -1
- data/lib/tweetstream/arguments.rb +0 -1
- data/lib/tweetstream/client.rb +17 -19
- data/lib/tweetstream/configuration.rb +3 -3
- data/lib/tweetstream/daemon.rb +1 -2
- data/lib/tweetstream/site_stream_client.rb +14 -18
- data/lib/tweetstream/version.rb +1 -1
- data/spec/fixtures/delete.json +1 -1
- data/spec/fixtures/limit.json +1 -1
- data/spec/fixtures/scrub_geo.json +4 -4
- data/spec/fixtures/status_withheld.json +1 -1
- data/spec/fixtures/user_withheld.json +1 -1
- data/spec/helper.rb +9 -4
- data/spec/tweetstream/client_authentication_spec.rb +15 -15
- data/spec/tweetstream/client_site_stream_spec.rb +33 -33
- data/spec/tweetstream/client_spec.rb +104 -104
- data/spec/tweetstream/client_userstream_spec.rb +22 -22
- data/spec/tweetstream/daemon_spec.rb +6 -6
- data/spec/tweetstream/site_stream_client_spec.rb +51 -51
- data/spec/tweetstream_spec.rb +40 -40
- data/tweetstream.gemspec +5 -5
- metadata +22 -26
- data/lib/tweetstream/callback.rb +0 -10
- data/lib/tweetstream/middleware/builder.rb +0 -22
- data/lib/tweetstream/middleware/runner.rb +0 -42
- data/lib/tweetstream/util/parameter.rb +0 -19
data/tweetstream.gemspec
CHANGED
@@ -17,14 +17,14 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.add_dependency 'daemons', '~> 1.1'
|
18
18
|
spec.add_dependency 'em-http-request', '>= 1.1.1'
|
19
19
|
spec.add_dependency 'em-twitter', '~> 0.3'
|
20
|
-
spec.add_dependency 'twitter', '~>
|
20
|
+
spec.add_dependency 'twitter', '~> 5.5'
|
21
21
|
spec.add_dependency 'multi_json', '~> 1.3'
|
22
22
|
spec.add_development_dependency 'bundler', '~> 1.0'
|
23
23
|
|
24
24
|
spec.files = %w(.yardopts CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md Rakefile tweetstream.gemspec)
|
25
|
-
spec.files += Dir.glob(
|
26
|
-
spec.files += Dir.glob(
|
27
|
-
spec.test_files = Dir.glob(
|
25
|
+
spec.files += Dir.glob('lib/**/*.rb')
|
26
|
+
spec.files += Dir.glob('spec/**/*')
|
27
|
+
spec.test_files = Dir.glob('spec/**/*')
|
28
28
|
|
29
|
-
spec.require_paths = [
|
29
|
+
spec.require_paths = ['lib']
|
30
30
|
end
|
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.6.
|
4
|
+
version: 2.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bleigh
|
@@ -9,90 +9,90 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: daemons
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - ~>
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '1.1'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - ~>
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '1.1'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: em-http-request
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: 1.1.1
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: 1.1.1
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: em-twitter
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- - ~>
|
46
|
+
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0.3'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- - ~>
|
53
|
+
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0.3'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: twitter
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - ~>
|
60
|
+
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
62
|
+
version: '5.5'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - ~>
|
67
|
+
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
69
|
+
version: '5.5'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: multi_json
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - ~>
|
74
|
+
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '1.3'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - ~>
|
81
|
+
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '1.3'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: bundler
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- - ~>
|
88
|
+
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '1.0'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- - ~>
|
95
|
+
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '1.0'
|
98
98
|
description: TweetStream is a simple wrapper for consuming the Twitter Streaming API.
|
@@ -103,24 +103,19 @@ executables: []
|
|
103
103
|
extensions: []
|
104
104
|
extra_rdoc_files: []
|
105
105
|
files:
|
106
|
-
- .yardopts
|
106
|
+
- ".yardopts"
|
107
107
|
- CHANGELOG.md
|
108
108
|
- CONTRIBUTING.md
|
109
109
|
- LICENSE.md
|
110
110
|
- README.md
|
111
111
|
- Rakefile
|
112
|
-
- tweetstream.
|
112
|
+
- lib/tweetstream.rb
|
113
113
|
- lib/tweetstream/arguments.rb
|
114
|
-
- lib/tweetstream/callback.rb
|
115
114
|
- lib/tweetstream/client.rb
|
116
115
|
- lib/tweetstream/configuration.rb
|
117
116
|
- lib/tweetstream/daemon.rb
|
118
|
-
- lib/tweetstream/middleware/builder.rb
|
119
|
-
- lib/tweetstream/middleware/runner.rb
|
120
117
|
- lib/tweetstream/site_stream_client.rb
|
121
|
-
- lib/tweetstream/util/parameter.rb
|
122
118
|
- lib/tweetstream/version.rb
|
123
|
-
- lib/tweetstream.rb
|
124
119
|
- spec/fixtures/delete.json
|
125
120
|
- spec/fixtures/direct_messages.json
|
126
121
|
- spec/fixtures/favorite.json
|
@@ -140,6 +135,7 @@ files:
|
|
140
135
|
- spec/tweetstream/daemon_spec.rb
|
141
136
|
- spec/tweetstream/site_stream_client_spec.rb
|
142
137
|
- spec/tweetstream_spec.rb
|
138
|
+
- tweetstream.gemspec
|
143
139
|
homepage: https://github.com/tweetstream/tweetstream
|
144
140
|
licenses:
|
145
141
|
- MIT
|
@@ -150,17 +146,17 @@ require_paths:
|
|
150
146
|
- lib
|
151
147
|
required_ruby_version: !ruby/object:Gem::Requirement
|
152
148
|
requirements:
|
153
|
-
- -
|
149
|
+
- - ">="
|
154
150
|
- !ruby/object:Gem::Version
|
155
151
|
version: '0'
|
156
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
153
|
requirements:
|
158
|
-
- -
|
154
|
+
- - ">="
|
159
155
|
- !ruby/object:Gem::Version
|
160
156
|
version: '0'
|
161
157
|
requirements: []
|
162
158
|
rubyforge_project:
|
163
|
-
rubygems_version: 2.0
|
159
|
+
rubygems_version: 2.2.0
|
164
160
|
signing_key:
|
165
161
|
specification_version: 4
|
166
162
|
summary: TweetStream is a simple wrapper for consuming the Twitter Streaming API.
|
data/lib/tweetstream/callback.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
module TweetStream
|
2
|
-
module Middleware
|
3
|
-
class Builder
|
4
|
-
attr_accessor :options
|
5
|
-
|
6
|
-
def initialize(options={}, &block)
|
7
|
-
@options = options
|
8
|
-
@stack = []
|
9
|
-
yield self if block_given?
|
10
|
-
end
|
11
|
-
|
12
|
-
def use(middleware, *args)
|
13
|
-
@stack << [middleware, args]
|
14
|
-
end
|
15
|
-
|
16
|
-
def call(env=nil)
|
17
|
-
TweetStream::Runner.new(@stack.dup).call(env)
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
module TweetStream
|
2
|
-
module Middleware
|
3
|
-
class Runner
|
4
|
-
|
5
|
-
EMPTY_MIDDLEWARE = lambda { |env| env }
|
6
|
-
|
7
|
-
def initialize(stack)
|
8
|
-
@stack = stack
|
9
|
-
@chain = build_chain
|
10
|
-
end
|
11
|
-
|
12
|
-
def call(env)
|
13
|
-
@chain.call(env)
|
14
|
-
end
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def build_chain
|
19
|
-
@stack.reverse.inject(EMPTY_MIDDLEWARE) do |next_middleware, current_middleware|
|
20
|
-
# Unpack the actual item
|
21
|
-
klass, args = current_middleware
|
22
|
-
|
23
|
-
if klass.is_a?(Class)
|
24
|
-
# If the klass actually is a class, then instantiate it with
|
25
|
-
# the app and any other arguments given.
|
26
|
-
klass.new(next_middleware, *args)
|
27
|
-
elsif klass.respond_to?(:call)
|
28
|
-
# Make it a lambda which calls the item then forwards up
|
29
|
-
# the chain.
|
30
|
-
lambda do |env|
|
31
|
-
klass.call(env)
|
32
|
-
next_middleware.call(env)
|
33
|
-
end
|
34
|
-
else
|
35
|
-
raise "Invalid middleware, doesn't respond to `call`: #{klass.inspect}"
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
class Parameter
|
2
|
-
|
3
|
-
def initialize(params={})
|
4
|
-
@params = params
|
5
|
-
end
|
6
|
-
|
7
|
-
def to_h
|
8
|
-
query_parameters = @params.dup
|
9
|
-
[:follow, :track, :locations].each do |param|
|
10
|
-
if query_parameters[param].kind_of?(Array)
|
11
|
-
query_parameters[param] = query_parameters[param].flatten.collect { |q| q.to_s }.join(',')
|
12
|
-
elsif query_parameters[param]
|
13
|
-
query_parameters[param] = query_parameters[param].to_s
|
14
|
-
end
|
15
|
-
end
|
16
|
-
query_parameters
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|