gnip-rules 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjY1MDg4MmE3NDU5ZWFhNTNjZTUwYzA5NzZjYjVlYzRkMzJlMDczNQ==
4
+ NmM3MmY3ZTI4NGJlMzE2ODJhNGQ0OTU2YTk2ZTMyMzdlMmM3MjM3ZA==
5
5
  data.tar.gz: !binary |-
6
- YmU3ZmIxOTE3ODNkMTE2MzVhMTQ0OWIzOWRjNDUxMjQ3MGMzNjY1YQ==
6
+ MjFjOWQ0MjI2MDFlNWIzZjNkYTgzOWZhMzViN2Q1NjQ2YWVhMzZmNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjJhNDM2OTZhOWI0MTI4MzFkMzhjNjcxOGNiMDkwZWMxZjIwNWM4NTI5OTMy
10
- NzRjODNmNmY5MDZlNGRlY2Y4NjJmZmFmMjgxOTE2ZTQxZDcwY2Q4OGYyYzky
11
- YTAxNjQxNGEzMGNjZGNjMDJjNTg1N2Y3ZDFmZGQ5MjVmNWFmYTA=
9
+ ODNjNTA1ZTE5YzI1MDRlNzY5NTc1NTM4MjEzMzk0NzhjZDc3ZjJlY2E4ZDRl
10
+ YTRmODEzYTM4M2Q3ZjI5MDA1NjEzMTQxZGM2NGY3M2M1NWI4MzI3NDcyMDVi
11
+ NjM2NTI5N2QxZWYxOTM3NWFjNmMzZDE2YTU2MGNhNDZmODBhOGE=
12
12
  data.tar.gz: !binary |-
13
- NmZjYzdhZjA4NmE2NGI3NTM5ODI3YTY5NTA5NDMzZDJkMTZjMDM5NTIyMGQ1
14
- NjU0NDk1ZjNjNWZjYTE2MTdhOGRlMTgwMDIwMDZjMTZhMzY5YWI1NmQzNTIw
15
- ODgyMmY5NmE0MjIwYzZiZDM5ZGFjMDA5ODNlOTE2OGFmOWY3YTU=
13
+ NDZkYTY0YzQ4MWRhYjM4NzAxN2JkZWFhNzAyZjI5YTZlYTk1MGMwMjg0ZTBj
14
+ YTFiMzE0M2ZmMWY1MTVmZjA5ZjhmMTM5OGNiZjU5ZTRiMGI2Njk3MDNiMjI4
15
+ YThiZjkxNjZmOGI3MGNhMTc3OWJjZWY1ZGU5M2EwZGQ5ZWY4MGI=
data/Gemfile CHANGED
@@ -1,8 +1,9 @@
1
- gemspec name: 'gnip-rules-test.gemspec'
1
+ gemspec
2
+ source 'https://rubygems.org'
2
3
 
3
- gem 'httparty', '~> 0.8.1'
4
+ gem 'httparty', '~> 0.13.1'
4
5
  gem 'rake', '>= 0.9.2.2'
5
- gem 'json', '~> 1.6.1'
6
+ gem 'json', '~> 1.8'
6
7
  gem 'activesupport', '~> 3.1.3'
7
8
 
8
9
  # Add dependencies to develop your gem here.
@@ -11,6 +12,6 @@ group :development do
11
12
  gem 'shoulda-context'
12
13
  gem 'turn'
13
14
  gem 'assert2'
14
- gem "bundler", "~> 1.0.0"
15
+ gem "bundler", "~> 1.5.0"
15
16
  gem "rcov", ">= 0"
16
17
  end
data/README.md CHANGED
@@ -50,20 +50,22 @@ There are two ways you can provide credentials to the gnip-api gem.
50
50
  ### Listing
51
51
 
52
52
  ```ruby
53
- response = @gnip_rules.list
53
+ response = @gnip_rules.list.rules
54
54
  p response #=> {"rules": {"value":"larl -bang", "value":"#larloperator"} }
55
55
  ```
56
56
 
57
57
  ### Removing All Rules
58
58
 
59
- This is really just for convienience while testing. You probably shouldn't ever use this in production.
59
+ This is really just for convienience while testing. You probably shouldn't ever use this in production. This method loads all the rules from gnip and passes them to the remove method. There is a 3 second pause in between the list and delete to avoid rate limiting.
60
60
 
61
61
  ```ruby
62
62
  response = @gnip_rules.delete_all!
63
63
  p response #=> 200 OK
64
- @gnip.list["rules"].empty? #=> true
64
+ @gnip.list.rules.empty? #=> true
65
65
  ```
66
66
 
67
+
68
+
67
69
  ## Running Tests
68
70
 
69
71
  Make sure you have the config file mentioned above at config/gnip.yml
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.2.1
data/gnip-rules.gemspec CHANGED
@@ -5,7 +5,7 @@ require 'gnip-rules/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "gnip-rules"
8
- spec.version = Gnip::Rules::VERSION
8
+ spec.version = Gnip::VERSION
9
9
  spec.authors = ["Spencer Markowski", "The Able Few"]
10
10
  spec.email = ["spencer@theablefew.com"]
11
11
  spec.description = "Remove, Add and List your Gnip Rules"
@@ -14,5 +14,12 @@ module Gnip
14
14
  def list
15
15
  Gnip::Response.new self.class.get( '/rules.json' )
16
16
  end
17
+
18
+ def delete_all!
19
+ rules = self.list.rules
20
+ sleep 3
21
+ self.remove( rules )
22
+ end
23
+
17
24
  end
18
25
  end
@@ -44,5 +44,13 @@ module Gnip
44
44
  code == 200
45
45
  end
46
46
 
47
+ def success?
48
+ ok?
49
+ end
50
+
51
+ def error
52
+ http_party_response["error"]
53
+ end
54
+
47
55
  end
48
56
  end
@@ -0,0 +1,3 @@
1
+ module Gnip
2
+ VERSION = File.open('VERSION', 'rb') { |f| f.read }
3
+ end
data/lib/gnip-rules.rb CHANGED
@@ -27,11 +27,6 @@ module Gnip
27
27
  self.class.base_uri uri
28
28
  end
29
29
 
30
- def delete_all!
31
- rules = self.list.rules
32
- sleep 3
33
- self.remove( rules )
34
- end
35
30
 
36
31
  private
37
32
 
@@ -43,9 +38,9 @@ module Gnip
43
38
  You must provide a configuration file at config/gnip.yml
44
39
 
45
40
  development: &development
46
- username: omg@omg.com
47
- password: larl!
48
- account: larloperator
41
+ username: omg@omg.com
42
+ password: your_password
43
+ account: your_account
49
44
  streaming_url: 'https://stream.gnip.com:443/accounts/YOUR_ACCOUNT/publishers/twitter/streams/track/prod/'
50
45
 
51
46
  RUBY
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gnip-rules
3
3
  version: !ruby/object:Gem::Version
4
4
  version: !binary |-
5
- MS4yLjA=
5
+ MS4yLjE=
6
6
  platform: ruby
7
7
  authors:
8
8
  - Spencer Markowski
@@ -59,6 +59,7 @@ files:
59
59
  - lib/gnip-rules/api.rb
60
60
  - lib/gnip-rules/response.rb
61
61
  - lib/gnip-rules/rule.rb
62
+ - lib/gnip-rules/version.rb
62
63
  - test/helper.rb
63
64
  - test/test_gnip-rules.rb
64
65
  - test/test_rule.rb