gnip_api 0.0.2 → 0.0.3

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: 74edd623bf1f6bb85470235633add59192a90448
4
- data.tar.gz: 51786aa16a0f9df12bf3e44595441096e0e0db1c
3
+ metadata.gz: 30453afea5af2169290ebd12fea604202c5b6a6a
4
+ data.tar.gz: b08163b715a94d679ea8e91e71de2de46b77de9e
5
5
  SHA512:
6
- metadata.gz: e49dafce62bb9f34c05127676b6099ee687c35667d849d609e241cf198c11196069b41f7ab979ee3a67a5f56d670bf4fd07cf7a1a5f1642aa367ff56724427f2
7
- data.tar.gz: c88927e42d3da21e5b8ebd59ae391733d8f79a50e5d42c77c21498368a161827790329da94a80a100b66856a4f91b5c302407235d0c9ba72edce2434ee489aff
6
+ metadata.gz: 5c0917aee021bedecdb4e7757e10d9d6e9d98d091b6c360be6b6f7c708c8f0ddccee460f4695ac596f51973f6e7d348de3868fd60b3dcbc24093dc00e5887024
7
+ data.tar.gz: 2dec8144d33e7e366c5dacc865ebb71d98cf4a88e5ead30d7c308060e7e79a795098acf652f928cae5e4719fe01f2790462d7c90c050680710d3bb528c41bc9c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gnip_api (0.0.2)
4
+ gnip_api (0.0.3)
5
5
  activesupport
6
6
  httparty
7
7
  json
@@ -15,7 +15,7 @@ module Gnip
15
15
  end
16
16
 
17
17
  def expanded_url
18
- URI(@expanded_url) unless @url.nil?
18
+ URI(@expanded_url) unless @expanded_url.nil?
19
19
  end
20
20
 
21
21
  def original_attributes
@@ -1,3 +1,3 @@
1
1
  module GnipApi
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -0,0 +1 @@
1
+ {"id":"tag:search.twitter.com,2005:753160349944197120","objectType":"activity","actor":{"objectType":"person","id":"id:twitter.com:3224498552","link":"http://www.twitter.com/actually_miguel","displayName":"lil Migo⁶","postedTime":"2015-05-23T18:08:54.000Z","image":"https://pbs.twimg.com/profile_images/753157176974200833/devZQpcw_normal.jpg","summary":null,"links":[{"href":null,"rel":"me"}],"friendsCount":216,"followersCount":241,"listedCount":0,"statusesCount":3112,"twitterTimeZone":null,"verified":false,"utcOffset":null,"preferredUsername":"actually_miguel","languages":["en"],"location":null,"favoritesCount":3489},"verb":"post","postedTime":"2016-07-13T09:33:15.000Z","generator":{"displayName":"Twitter for iPhone","link":"http://twitter.com/download/iphone"},"provider":{"objectType":"service","displayName":"Twitter","link":"http://www.twitter.com"},"link":"http://twitter.com/actually_miguel/statuses/753160349944197120","body":"THIS IS WHY I DONT FUCK WITH POKEMON GO AT NIGHT https://t.co/PYsldvNKd6","object":{"objectType":"note","id":"object:search.twitter.com,2005:753160349944197120","summary":"THIS IS WHY I DONT FUCK WITH POKEMON GO AT NIGHT https://t.co/PYsldvNKd6","link":"http://twitter.com/actually_miguel/statuses/753160349944197120","postedTime":"2016-07-13T09:33:15.000Z"},"favoritesCount":0,"twitter_entities":{"hashtags":[],"urls":[],"user_mentions":[],"symbols":[],"media":[{"id":753160344546062337,"id_str":"753160344546062337","indices":[49,72],"media_url":"http://pbs.twimg.com/media/CnPDV8uUMAE3RqQ.jpg","media_url_https":"https://pbs.twimg.com/media/CnPDV8uUMAE3RqQ.jpg","url":"https://t.co/PYsldvNKd6","display_url":"pic.twitter.com/PYsldvNKd6","expanded_url":"http://twitter.com/actually_miguel/status/753160349944197120/photo/1","type":"photo","sizes":{"small":{"w":382,"h":680,"resize":"fit"},"thumb":{"w":150,"h":150,"resize":"crop"},"medium":{"w":675,"h":1200,"resize":"fit"},"large":{"w":750,"h":1334,"resize":"fit"}}}]},"twitter_filter_level":"low","twitter_lang":"en","retweetCount":0,"gnip":{"matching_rules":[{"tag":"25809"}],"urls":[{"url":"https://t.co/PYsldvNKd6"}],"language":{"value":"en"}}}
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Gnip::GnipData do
4
- context 'when urls have nil' do
4
+ context 'when all urls have nil' do
5
5
  before do
6
6
  @activity = File.read(fixture_path.join('activities', 'nil_urls.json'))
7
7
  @activity = JSON.parse(@activity)
@@ -17,6 +17,22 @@ describe Gnip::GnipData do
17
17
  end
18
18
  end
19
19
 
20
+ context 'when expanded urls have nil' do
21
+ before do
22
+ @activity = File.read(fixture_path.join('activities', 'nil_urls2.json'))
23
+ @activity = JSON.parse(@activity)
24
+ @gnip = Gnip::GnipData.new(@activity['gnip'])
25
+ end
26
+
27
+ it 'does not fail using expanded urls' do
28
+ expect(Proc.new{@gnip.urls.first.expanded_url}).not_to raise_error
29
+ end
30
+
31
+ it 'does not fail using expanded urls' do
32
+ expect(Proc.new{@gnip.urls.first.url}).not_to raise_error
33
+ end
34
+ end
35
+
20
36
  context 'with long rules' do
21
37
  before do
22
38
  @activity = File.read(fixture_path.join('activities', 'real_activity_long_rules.json'))
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.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rayko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-13 00:00:00.000000000 Z
11
+ date: 2016-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -181,6 +181,7 @@ files:
181
181
  - lib/gnip_api/version.rb
182
182
  - spec/fixtures/activities/full_activity.json
183
183
  - spec/fixtures/activities/nil_urls.json
184
+ - spec/fixtures/activities/nil_urls2.json
184
185
  - spec/fixtures/activities/real_activity.json
185
186
  - spec/fixtures/activities/real_activity_long_rules.json
186
187
  - spec/fixtures/system_messages/error.json
@@ -246,6 +247,7 @@ summary: GnipApi provides exposes all Gnip APIs.
246
247
  test_files:
247
248
  - spec/fixtures/activities/full_activity.json
248
249
  - spec/fixtures/activities/nil_urls.json
250
+ - spec/fixtures/activities/nil_urls2.json
249
251
  - spec/fixtures/activities/real_activity.json
250
252
  - spec/fixtures/activities/real_activity_long_rules.json
251
253
  - spec/fixtures/system_messages/error.json