gnip_api 0.0.9 → 1.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7ef89c6c8f354d532f33e1653c01a5587910985
4
- data.tar.gz: 161b4cb6c80ecb1b81b3a3b73c948c0da9e708cd
3
+ metadata.gz: 070084aade9bec151ad135a35f172dc69375cc35
4
+ data.tar.gz: ae3fddc616369e500c39bbb8cb72202212883651
5
5
  SHA512:
6
- metadata.gz: ae3364b2e6de262b14bc4d252283cedfe7636b65bb59e3ad6f3ab843a7a796dbdec1403607925c4a3cc77af7b7f100ef78232c75cf3a1d3c86d7237d7742afad
7
- data.tar.gz: 4a1606261e57d5de690601aa24373e64bee728c23bb978c64b232944d0b9b0384f200f06afca873f7833548c448fcf0c88191e2be9af9876efd15f2662ec7e23
6
+ metadata.gz: 0c00d5542022a381ae9b563369367896fcf8496eab0c1be3b6f487b6c69edf5dbf9265ecf51d9310ab7ea334374c58fb20d0727ee30adeda6c359678d166c84b
7
+ data.tar.gz: d3395a4f285db4d9f95f9f1c6fe195f437788f9d1897ee908b53db777a4d8862a58c295fdf83567f97b81da430d8876da6dd2f707257c0067522d1842c1ccdb5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gnip_api (0.0.9)
4
+ gnip_api (1.0.0)
5
5
  addressable
6
6
  httparty
7
7
  yajl-ruby
@@ -11,6 +11,7 @@ GEM
11
11
  specs:
12
12
  addressable (2.4.0)
13
13
  awesome_print (1.2.0)
14
+ byebug (9.0.6)
14
15
  coderay (1.1.0)
15
16
  diff-lcs (1.2.5)
16
17
  httparty (0.14.0)
@@ -44,6 +45,7 @@ PLATFORMS
44
45
  DEPENDENCIES
45
46
  awesome_print
46
47
  bundler (~> 1.6)
48
+ byebug
47
49
  gnip_api!
48
50
  pry
49
51
  rake (~> 10.0)
data/README.md CHANGED
@@ -6,6 +6,7 @@ Connect with different Gnip APIs and get data from streams.
6
6
 
7
7
  ## Recent Changes
8
8
 
9
+ - 2.0 APIs implemented partially, more will come soon
9
10
  - Fixed a memory issue with HTTParty
10
11
  - Timeout for requests added to fail if API is non responsive, time can be configured
11
12
  - Search API returns parsed data either for counts or activities, which also makes Search API usable to get activities now
data/gnip_api.gemspec CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "awesome_print"
25
25
  spec.add_development_dependency "rspec"
26
26
  spec.add_development_dependency "timecop"
27
+ spec.add_development_dependency 'byebug'
27
28
 
28
29
  spec.add_dependency "httparty"
29
30
  spec.add_dependency "yajl-ruby"
@@ -50,7 +50,7 @@ module GnipApi
50
50
  else
51
51
  error_message = response.error_message
52
52
  @logger.error "#{response.request_method} request to #{response.request_uri} returned with status #{response.status} FAIL: #{error_message}"
53
- raise GnipApi::Errors::Adapter::RequestError.new, error_message
53
+ raise GnipApi::Errors::Adapter::RequestError.new error_message
54
54
  end
55
55
  end
56
56
 
@@ -7,7 +7,7 @@ module GnipApi
7
7
  end
8
8
 
9
9
  def delete request
10
- data = HTTParty.delete request.uri, :basic_auth => auth, :body => request.payload, :timeout => default_timeout
10
+ data = HTTParty.post request.uri, :basic_auth => auth, :body => request.payload, :timeout => default_timeout
11
11
  return response(request, data)
12
12
  end
13
13
 
@@ -2,11 +2,12 @@ module GnipApi
2
2
  module Apis
3
3
  module PowerTrack
4
4
  class Rule
5
- attr_accessor :value, :tag
5
+ attr_accessor :value, :tag, :id
6
6
 
7
7
  def initialize params={}
8
8
  @value = params[:value] || params['value']
9
9
  @tag = params[:tag] || params['tag']
10
+ @id = params[:id] || params['id']
10
11
  end
11
12
 
12
13
  def to_json
@@ -17,6 +18,7 @@ module GnipApi
17
18
  attrs = {}
18
19
  attrs[:value] = @value if @value
19
20
  attrs[:tag] = @tag if @tag
21
+ attrs[:id] = @id if @id
20
22
  attrs
21
23
  end
22
24
 
@@ -0,0 +1,8 @@
1
+ module GnipApi
2
+ module Apis
3
+ module PowerTrack
4
+ class RuleValidator
5
+ end
6
+ end
7
+ end
8
+ end
@@ -14,7 +14,6 @@ module GnipApi
14
14
  def initialize params={}
15
15
  @adapter = GnipApi::Adapter.new
16
16
  @label = params[:label] || GnipApi.config.label
17
- @source = params[:source] || GnipApi.config.source
18
17
  end
19
18
 
20
19
  # Returns an array of defined rules
@@ -29,7 +28,9 @@ module GnipApi
29
28
  def create rules
30
29
  raise GnipApi::Errors::PowerTrack::MissingRules.new if rules.nil? || rules.empty?
31
30
  request = create_post_request(construct_rules(rules))
32
- adapter.post(request)
31
+ response = adapter.post(request)
32
+ return true if response.nil?
33
+ return GnipApi::JsonParser.new.parse(response)
33
34
  end
34
35
 
35
36
  # Deletes the specified rule. Parameters:
@@ -37,7 +38,9 @@ module GnipApi
37
38
  def delete rules
38
39
  raise GnipApi::Errors::PowerTrack::MissingRules.new if rules.nil? || rules.empty?
39
40
  request = create_delete_request(construct_rules(rules))
40
- adapter.delete(request)
41
+ response = adapter.delete(request)
42
+ return true if response.nil?
43
+ return GnipApi::JsonParser.new.parse(response)
41
44
  end
42
45
 
43
46
  # Parses an array of GnipApi::Apis::PowerTrack::Rule objects
@@ -52,12 +55,12 @@ module GnipApi
52
55
 
53
56
  def parse_rules data
54
57
  parsed_data = GnipApi::JsonParser.new.parse(data)
55
- parsed_data['rules'].map{|rule| GnipApi::Apis::PowerTrack::Rule.new(:value => rule['value'], :tag => rule['tag'])}
58
+ parsed_data['rules'].map{|rule| GnipApi::Apis::PowerTrack::Rule.new(:value => rule['value'], :tag => rule['tag'], :id => rule['id'])}
56
59
  end
57
60
 
58
61
  private
59
62
  def endpoint
60
- GnipApi::Endpoints.powertrack_rules(@source, @label)
63
+ GnipApi::Endpoints.powertrack_rules(@label)
61
64
  end
62
65
 
63
66
  def create_get_request
@@ -69,7 +72,11 @@ module GnipApi
69
72
  end
70
73
 
71
74
  def create_delete_request payload
72
- GnipApi::Request.new_delete(endpoint, payload)
75
+ delete_url = endpoint
76
+ delete_url.query = '_method=delete'
77
+ puts delete_url
78
+ puts payload
79
+ GnipApi::Request.new_delete(delete_url, payload)
73
80
  end
74
81
 
75
82
  end
@@ -6,7 +6,6 @@ module GnipApi
6
6
 
7
7
  def initialize params = {}
8
8
  @stream = params[:stream] || GnipApi.config.label
9
- @source = params[:source] || GnipApi.config.source
10
9
  set_config
11
10
  end
12
11
 
@@ -61,7 +60,6 @@ module GnipApi
61
60
 
62
61
  def set_config
63
62
  raise 'MissingStream' if @stream.nil?
64
- raise 'MissingSource' if @source.nil?
65
63
  @user = GnipApi.configuration.user
66
64
  @password = GnipApi.configuration.password
67
65
  @account = GnipApi.configuration.account
@@ -70,7 +68,7 @@ module GnipApi
70
68
  end
71
69
 
72
70
  def endpoint
73
- GnipApi::Endpoints.powertrack_stream(@source, @stream)
71
+ GnipApi::Endpoints.powertrack_stream(@stream)
74
72
  end
75
73
 
76
74
  end
@@ -1,12 +1,24 @@
1
1
  module GnipApi
2
2
  class Endpoints
3
3
  class << self
4
- def powertrack_rules source, label
5
- URI("https://api.gnip.com:443/accounts/#{account}/publishers/#{source}/streams/track/#{label}/rules.json")
4
+ def powertrack_rules label
5
+ URI("https://gnip-api.twitter.com/rules/powertrack/accounts/#{account}/publishers/twitter/#{label}.json")
6
6
  end
7
7
 
8
- def powertrack_stream source, label
9
- URI("https://stream.gnip.com:443/accounts/#{account}/publishers/#{source}/streams/track/#{label}.json")
8
+ def powertrack_stream label
9
+ URI("https://gnip-stream.twitter.com/stream/powertrack/accounts/#{account}/publishers/twitter/#{label}.json")
10
+ end
11
+
12
+ def powertrack_rule_validator label
13
+ URI("https://gnip-api.twitter.com/rules/powertrack/accounts/#{account}/publishers/twitter/#{label}/validation.json")
14
+ end
15
+
16
+ def powertrack_stream_replay label
17
+ URI("https://gnip-stream.twitter.com/replay/powertrack/accounts/#{account}/publishers/twitter/#{label}.json")
18
+ end
19
+
20
+ def powertrack_rule_replay label
21
+ URI("https://gnip-api.twitter.com/rules/powertrack-replay/accounts/#{account}/publishers/twitter/#{label}.json")
10
22
  end
11
23
 
12
24
  def search_activities label
@@ -1,6 +1,6 @@
1
1
  module Gnip
2
2
  class Url < Gnip::Message
3
- attr_reader :url, :expanded_url, :expanded_status, :display_url, :indices
3
+ attr_reader :url, :expanded_url, :expanded_status, :display_url, :indices, :expanded_url_title, :expanded_url_description
4
4
 
5
5
  def initialize params={}
6
6
  @url = params['url']
@@ -8,6 +8,8 @@ module Gnip
8
8
  @display_url = params['display_url']
9
9
  @expanded_status = params['expanded_status']
10
10
  @indices = params['indices']
11
+ @expanded_url_title = params['expanded_url_title']
12
+ @expanded_url_description = params['expanded_url_description']
11
13
  end
12
14
 
13
15
  def url
@@ -21,6 +23,7 @@ module Gnip
21
23
  def original_attributes
22
24
  {
23
25
  :url => @url,
26
+ :title => @title,
24
27
  :display_url => @display_url,
25
28
  :expanded_url => @expanded_url,
26
29
  :expanded_status => @expanded_status,
@@ -12,7 +12,7 @@ module GnipApi
12
12
  end
13
13
 
14
14
  def new_delete uri, payload, headers=nil
15
- new(:uri => uri, :headers => headers, :payload => payload, :request_method => GnipApi::Adapter::DELETE)
15
+ new(:uri => uri, :headers => headers, :payload => payload, :request_method => GnipApi::Adapter::POST)
16
16
  end
17
17
  end
18
18
 
@@ -27,7 +27,7 @@ module GnipApi
27
27
  def error_message
28
28
  if @body && !@body.empty?
29
29
  parsed = GnipApi::JsonParser.new.parse(@body)
30
- return parsed['error']['message'] if parsed['error']
30
+ return parsed
31
31
  end
32
32
  return nil
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module GnipApi
2
- VERSION = "0.0.9"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -1,227 +1,115 @@
1
1
  {
2
- "id": "tag:search.twitter.com,2005:593895901623496704",
3
- "objectType": "activity",
4
- "actor": {
5
- "objectType": "person",
6
- "id": "id:twitter.com:2993982541",
7
- "link": "http://www.twitter.com/jondee_test",
8
- "displayName": "Test Demo",
9
- "postedTime": "2015-01-24T00:12:53.000Z",
10
- "image": "https://pbs.twimg.com/profile_images/593893018911907840/YM9oLru3_normal.png",
11
- "summary": "this is a test account.",
12
- "links": [
13
- {
14
- "href": null,
15
- "rel": "me"
16
- }
17
- ],
18
- "friendsCount": 43,
19
- "followersCount": 2,
20
- "listedCount": 0,
21
- "statusesCount": 30,
22
- "twitterTimeZone": "Mountain Time (US & Canada)",
23
- "verified": false,
24
- "utcOffset": "-21600",
25
- "preferredUsername": "jondee_test",
26
- "languages": [
27
- "en"
28
- ],
29
- "location": {
30
- "objectType": "place",
31
- "displayName": "Denver, CO"
32
- },
33
- "favoritesCount": 0
34
- },
35
- "verb": "post",
36
- "postedTime": "2015-04-30T21:53:11.000Z",
37
- "generator": {
38
- "displayName": "Twitter Web Client",
39
- "link": "http://twitter.com"
40
- },
41
- "provider": {
42
- "objectType": "service",
43
- "displayName": "Twitter",
44
- "link": "http://www.twitter.com"
45
- },
46
- "link": "http://twitter.com/jondee_test/statuses/593895901623496704",
47
- "body": "This is a #test tweet @LoveforTestingT with an image. http://t.co/ZvgHovKZq4",
48
- "object": {
49
- "objectType": "note",
50
- "id": "object:search.twitter.com,2005:593895901623496704",
51
- "summary": "This is a #test tweet @LoveforTestingT with an image. http://t.co/ZvgHovKZq4",
52
- "link": "http://twitter.com/jondee_test/statuses/593895901623496704",
53
- "postedTime": "2015-04-30T21:53:11.000Z"
54
- },
55
- "favoritesCount": 0,
56
- "location": {
57
- "objectType": "place",
58
- "displayName": "Boulder, CO",
59
- "name": "Boulder",
60
- "country_code": "United States",
61
- "twitter_country_code": "US",
62
- "link": "https://api.twitter.com/1.1/geo/id/fd70c22040963ac7.json",
63
- "geo": {
64
- "type": "Polygon",
65
- "coordinates": [
66
- [
67
- [
68
- -105.3017759,
69
- 39.953552
70
- ],
71
- [
72
- -105.3017759,
73
- 40.094411
74
- ],
75
- [
76
- -105.183597,
77
- 40.094411
78
- ],
79
- [
80
- -105.183597,
81
- 39.953552
82
- ]
83
- ]
84
- ]
85
- },
86
- "twitter_place_type": "city"
87
- },
88
- "twitter_entities": {
89
- "hashtags": [
90
- {
91
- "text": "test",
92
- "indices": [
93
- 10,
94
- 15
95
- ]
96
- }
97
- ],
98
- "trends": [],
99
- "urls": [],
100
- "user_mentions": [
101
- {
102
- "screen_name": "LoveforTestingT",
103
- "name": "Leah ",
104
- "id": 2432909010,
105
- "id_str": "2432909010",
106
- "indices": [
107
- 22,
108
- 38
109
- ]
110
- }
111
- ],
112
- "symbols": [],
113
- "media": [
114
- {
115
- "id": 593895901145346000,
116
- "id_str": "593895901145346048",
117
- "indices": [
118
- 54,
119
- 76
120
- ],
121
- "media_url": "http://pbs.twimg.com/media/CD3xLO1UMAAvBgO.png",
122
- "media_url_https": "https://pbs.twimg.com/media/CD3xLO1UMAAvBgO.png",
123
- "url": "http://t.co/ZvgHovKZq4",
124
- "display_url": "pic.twitter.com/ZvgHovKZq4",
125
- "expanded_url": "http://twitter.com/johnd_test/status/593895901623496704/photo/1",
126
- "type": "photo",
127
- "sizes": {
128
- "small": {
129
- "w": 340,
130
- "h": 340,
131
- "resize": "fit"
132
- },
133
- "thumb": {
134
- "w": 150,
135
- "h": 150,
136
- "resize": "crop"
137
- },
138
- "large": {
139
- "w": 512,
140
- "h": 512,
141
- "resize": "fit"
142
- },
143
- "medium": {
144
- "w": 512,
145
- "h": 512,
146
- "resize": "fit"
147
- }
148
- }
149
- }
150
- ]
151
- },
152
- "twitter_extended_entities": {
153
- "media": [
154
- {
155
- "id": 593895901145346000,
156
- "id_str": "593895901145346048",
157
- "indices": [
158
- 54,
159
- 76
160
- ],
161
- "media_url": "http://pbs.twimg.com/media/CD3xLO1UMAAvBgO.png",
162
- "media_url_https": "https://pbs.twimg.com/media/CD3xLO1UMAAvBgO.png",
163
- "url": "http://t.co/ZvgHovKZq4",
164
- "display_url": "pic.twitter.com/ZvgHovKZq4",
165
- "expanded_url": "http://twitter.com/johnd_test/status/593895901623496704/photo/1",
166
- "type": "photo",
167
- "sizes": {
168
- "small": {
169
- "w": 340,
170
- "h": 340,
171
- "resize": "fit"
172
- },
173
- "thumb": {
174
- "w": 150,
175
- "h": 150,
176
- "resize": "crop"
177
- },
178
- "large": {
179
- "w": 512,
180
- "h": 512,
181
- "resize": "fit"
182
- },
183
- "medium": {
184
- "w": 512,
185
- "h": 512,
186
- "resize": "fit"
187
- }
188
- }
189
- }
190
- ]
191
- },
192
- "twitter_filter_level": "low",
193
- "twitter_lang": "en",
194
- "retweetCount": 0,
195
- "gnip": {
196
- "urls": [
197
- {
198
- "url": "http://t.co/ZvgHovKZq4",
199
- "expanded_url": "http://twitter.com/johnd_test/status/593895901623496704/photo/1",
200
- "expanded_status": 200
201
- }
202
- ],
203
- "language": {
204
- "value": "en"
205
- },
206
- "profileLocations": [
207
- {
208
- "objectType": "place",
209
- "geo": {
210
- "type": "point",
211
- "coordinates": [
212
- -104.9847,
213
- 39.73915
214
- ]
215
- },
216
- "address": {
217
- "country": "United States",
218
- "countryCode": "US",
219
- "locality": "Denver",
220
- "region": "Colorado",
221
- "subRegion": "Denver County"
222
- },
223
- "displayName": "Denver, Colorado, United States"
224
- }
225
- ]
226
- }
2
+ "id": "tag:search.twitter.com,2005:715999188836827140",
3
+ "objectType": "activity",
4
+ "verb": "post",
5
+ "postedTime": "2016-04-01T20:28:03.000Z",
6
+ "generator": {
7
+ "displayName": "Twitter Web Client",
8
+ "link": "http:\/\/twitter.com"
9
+ },
10
+ "provider": {
11
+ "objectType": "service",
12
+ "displayName": "Twitter",
13
+ "link": "http:\/\/www.twitter.com"
14
+ },
15
+ "link": "http:\/\/twitter.com\/furiouscamper\/statuses\/715999188836827140",
16
+ "body": "It's Friday!!! \ud83d\udc79 #AprilFools - funny pranks https:\/\/t.co\/b9ZdzRxzFK",
17
+ "actor": {
18
+ "objectType": "person",
19
+ "id": "id:twitter.com:3001969357",
20
+ "link": "http:\/\/www.twitter.com\/furiouscamper",
21
+ "displayName": "Jordan Brinks",
22
+ "postedTime": "2015-01-29T18:27:49.340Z",
23
+ "image": "https:\/\/pbs.twimg.com\/profile_images\/601155672395227136\/qakfE9EU_normal.jpg",
24
+ "summary": "Alter Ego - Twitter PE",
25
+ "friendsCount": 24,
26
+ "followersCount": 15,
27
+ "listedCount": 1,
28
+ "statusesCount": 222,
29
+ "twitterTimeZone": "Mountain Time (US & Canada)",
30
+ "verified": false,
31
+ "utcOffset": "-21600",
32
+ "preferredUsername": "furiouscamper",
33
+ "languages": ["en"],
34
+ "links": [{
35
+ "href": "http:\/\/indigofiddle.com",
36
+ "rel": "me"
37
+ }],
38
+ "location": {
39
+ "objectType": "place",
40
+ "displayName": "Birmingham"
41
+ },
42
+ "favoritesCount": 14
43
+ },
44
+ "object": {
45
+ "objectType": "note",
46
+ "id": "object:search.twitter.com,2005:715999188836827140",
47
+ "summary": "It's Friday!!! \ud83d\udc79 #AprilFools - funny pranks https:\/\/t.co\/b9ZdzRxzFK",
48
+ "link": "http:\/\/twitter.com\/furiouscamper\/statuses\/715999188836827140",
49
+ "postedTime": "2016-04-01T20:28:03.000Z"
50
+ },
51
+ "location": {
52
+ "objectType": "place",
53
+ "displayName": "Boulder, CO",
54
+ "name": "Boulder",
55
+ "country_code": "United States",
56
+ "twitter_country_code": "US",
57
+ "twitter_place_type": "city",
58
+ "link": "https:\/\/api.twitter.com\/1.1\/geo\/id\/fd70c22040963ac7.json",
59
+ "geo": {
60
+ "type": "Polygon",
61
+ "coordinates": [
62
+ [
63
+ [-105.301776, 39.953552],
64
+ [-105.301776, 40.094411],
65
+ [-105.183597, 40.094411],
66
+ [-105.183597, 39.953552]
67
+ ]
68
+ ]
69
+ }
70
+ },
71
+ "twitter_entities": {
72
+ "hashtags": [{
73
+ "text": "AprilFools",
74
+ "indices": [17, 28]
75
+ }],
76
+ "urls": [{
77
+ "url": "https:\/\/t.co\/b9ZdzRxzFK",
78
+ "expanded_url": "http:\/\/www.today.com\/parents\/joke-s-you-kid-11-family-friendly-april-fools-pranks-t83276",
79
+ "display_url": "today.com\/parents\/joke-s\u2026",
80
+ "indices": [44, 67]
81
+ }],
82
+ "user_mentions": [],
83
+ "symbols": []
84
+ },
85
+ "twitter_lang": "en",
86
+ "gnip": {
87
+ "matching_rules": [{
88
+ "tag": null,
89
+ "id": 715947673707089920
90
+ }],
91
+ "urls": [{
92
+ "url": "https:\/\/t.co\/b9ZdzRxzFK",
93
+ "expanded_url": "http:\/\/www.today.com\/parents\/joke-s-you-kid-11-family-friendly-april-fools-pranks-t83276",
94
+ "expanded_status": 200,
95
+ "expanded_url_title": "The joke's on you, kid: 11 family-friendly April Fools pranks",
96
+ "expanded_url_description": "If your kids are practical jokers, turn this April Fools' Day into a family affair."
97
+ }],
98
+ "profileLocations": [{
99
+ "address": {
100
+ "country": "United States",
101
+ "countryCode": "US",
102
+ "locality": "Birmingham",
103
+ "region": "Alabama",
104
+ "subRegion": "Jefferson County"
105
+ },
106
+ "displayName": "Birmingham, Alabama, United States",
107
+ "geo": {
108
+ "coordinates": [-86.80249, 33.52066],
109
+ "type": "point"
110
+ },
111
+ "objectType": "place"
112
+ }]
113
+ },
114
+ "twitter_filter_level": "low"
227
115
  }
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe GnipApi::Apis::PowerTrack::Stream do
4
4
  before do
5
5
  configure_gem
6
- @stream = GnipApi::Apis::PowerTrack::Stream.new(:source => 'source', :stream => 'stream')
6
+ @stream = GnipApi::Apis::PowerTrack::Stream.new
7
7
  end
8
8
 
9
9
  describe '#process_entries' do
@@ -9,15 +9,12 @@ describe GnipApi::Endpoints do
9
9
 
10
10
  describe '.powertrack_rules' do
11
11
  it 'returns URI object' do
12
- expect(GnipApi::Endpoints.powertrack_rules(@source, @label).kind_of?(URI)).to eq(true)
12
+ expect(GnipApi::Endpoints.powertrack_rules(@label).kind_of?(URI)).to eq(true)
13
13
  end
14
14
 
15
15
  describe 'URI returned' do
16
16
  before do
17
- @uri = GnipApi::Endpoints.powertrack_rules(@source, @label)
18
- end
19
- it 'contains source in path' do
20
- expect(@uri.path.include?(@source)).to eq(true)
17
+ @uri = GnipApi::Endpoints.powertrack_rules(@label)
21
18
  end
22
19
 
23
20
  it 'contains label in path' do
@@ -32,15 +29,12 @@ describe GnipApi::Endpoints do
32
29
 
33
30
  describe '.powertrack_stream' do
34
31
  it 'returns URI object' do
35
- expect(GnipApi::Endpoints.powertrack_stream(@source, @label).kind_of?(URI)).to eq(true)
32
+ expect(GnipApi::Endpoints.powertrack_stream(@label).kind_of?(URI)).to eq(true)
36
33
  end
37
34
 
38
35
  describe 'URI returned' do
39
36
  before do
40
- @uri = GnipApi::Endpoints.powertrack_stream(@source, @label)
41
- end
42
- it 'contains source in path' do
43
- expect(@uri.path.include?(@source)).to eq(true)
37
+ @uri = GnipApi::Endpoints.powertrack_stream(@label)
44
38
  end
45
39
 
46
40
  it 'contains label in path' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnip_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rayko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-28 00:00:00.000000000 Z
11
+ date: 2016-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: byebug
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: httparty
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -159,6 +173,7 @@ files:
159
173
  - lib/gnip_api/adapters/httparty_adapter.rb
160
174
  - lib/gnip_api/apis/power_track/buffer.rb
161
175
  - lib/gnip_api/apis/power_track/rule.rb
176
+ - lib/gnip_api/apis/power_track/rule_validator.rb
162
177
  - lib/gnip_api/apis/power_track/rules.rb
163
178
  - lib/gnip_api/apis/power_track/stream.rb
164
179
  - lib/gnip_api/apis/search.rb