zero_push 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3eccff0e44935d797e6160a61ef05064ede94bcb
4
+ data.tar.gz: 0efedf88080e645e9d6cfd2d078402a25ff395e9
5
+ SHA512:
6
+ metadata.gz: 51d67f43b23eb7b775b719949a2e3315c43d317904171e7e898090639ff2c05122ea015751f192a8db76caa42d34939b3df1e33b1485793182f09696799b79c1
7
+ data.tar.gz: e44908c18525b36e72c94e428415bf97004ee734b52f057a8d52c9afe79d10165602eb8a46cfc7e44cb38ca317aff77c78338487305c3e02ed00b03d946b27f7
data/.travis.yml CHANGED
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  language: ruby
3
3
  rvm:
4
- - 1.9.2
5
4
  - 1.9.3
6
5
  - 2.0.0
7
6
  - jruby-19mode
data/Gemfile.lock CHANGED
@@ -2,79 +2,71 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  zero_push (2.4.0)
5
- faraday (~> 0.8.5)
5
+ faraday (~> 0.9.0)
6
6
  faraday_middleware (~> 0.9.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (3.2.13)
12
- activemodel (= 3.2.13)
13
- activesupport (= 3.2.13)
14
- builder (~> 3.0.0)
11
+ actionpack (4.1.4)
12
+ actionview (= 4.1.4)
13
+ activesupport (= 4.1.4)
14
+ rack (~> 1.5.2)
15
+ rack-test (~> 0.6.2)
16
+ actionview (4.1.4)
17
+ activesupport (= 4.1.4)
18
+ builder (~> 3.1)
15
19
  erubis (~> 2.7.0)
16
- journey (~> 1.0.4)
17
- rack (~> 1.4.5)
18
- rack-cache (~> 1.2)
19
- rack-test (~> 0.6.1)
20
- sprockets (~> 2.2.1)
21
- activemodel (3.2.13)
22
- activesupport (= 3.2.13)
23
- builder (~> 3.0.0)
24
- activesupport (3.2.13)
25
- i18n (= 0.6.1)
26
- multi_json (~> 1.0)
27
- builder (3.0.4)
20
+ activesupport (4.1.4)
21
+ i18n (~> 0.6, >= 0.6.9)
22
+ json (~> 1.7, >= 1.7.7)
23
+ minitest (~> 5.1)
24
+ thread_safe (~> 0.1)
25
+ tzinfo (~> 1.1)
26
+ builder (3.2.2)
27
+ coderay (1.1.0)
28
28
  erubis (2.7.0)
29
- faraday (0.8.9)
30
- multipart-post (~> 1.2.0)
31
- faraday_middleware (0.9.0)
32
- faraday (>= 0.7.4, < 0.9)
33
- hike (1.2.1)
34
- i18n (0.6.1)
35
- journey (1.0.4)
36
- json (1.7.7)
37
- metaclass (0.0.1)
38
- minitest (4.7.0)
39
- mocha (0.13.3)
29
+ faraday (0.9.0)
30
+ multipart-post (>= 1.2, < 3)
31
+ faraday_middleware (0.9.1)
32
+ faraday (>= 0.7.4, < 0.10)
33
+ i18n (0.6.9)
34
+ json (1.8.1)
35
+ metaclass (0.0.4)
36
+ method_source (0.8.2)
37
+ minitest (5.3.5)
38
+ minitest-around (0.2.0)
39
+ minitest (~> 5.0)
40
+ mocha (1.1.0)
40
41
  metaclass (~> 0.0.1)
41
- multi_json (1.7.1)
42
- multipart-post (1.2.0)
43
- rack (1.4.5)
44
- rack-cache (1.2)
45
- rack (>= 0.4)
46
- rack-ssl (1.3.3)
47
- rack
42
+ multipart-post (2.0.0)
43
+ pry (0.9.12.4)
44
+ coderay (~> 1.0)
45
+ method_source (~> 0.8)
46
+ slop (~> 3.4)
47
+ rack (1.5.2)
48
48
  rack-test (0.6.2)
49
49
  rack (>= 1.0)
50
- railties (3.2.13)
51
- actionpack (= 3.2.13)
52
- activesupport (= 3.2.13)
53
- rack-ssl (~> 1.3.2)
50
+ railties (4.1.4)
51
+ actionpack (= 4.1.4)
52
+ activesupport (= 4.1.4)
54
53
  rake (>= 0.8.7)
55
- rdoc (~> 3.4)
56
- thor (>= 0.14.6, < 2.0)
57
- rake (10.0.3)
58
- rdoc (3.12.2)
59
- json (~> 1.4)
60
- sprockets (2.2.2)
61
- hike (~> 1.2)
62
- multi_json (~> 1.0)
63
- rack (~> 1.0)
64
- tilt (~> 1.1, != 1.3.0)
65
- thor (0.17.0)
66
- tilt (1.3.6)
67
- vcr (2.4.0)
54
+ thor (>= 0.18.1, < 2.0)
55
+ rake (10.3.2)
56
+ slop (3.4.7)
57
+ thor (0.19.1)
58
+ thread_safe (0.3.4)
59
+ tzinfo (1.2.1)
60
+ thread_safe (~> 0.1)
68
61
 
69
62
  PLATFORMS
70
63
  ruby
71
64
 
72
65
  DEPENDENCIES
73
- actionpack (~> 3.2.11)
74
- activesupport (~> 3.2.11)
75
- minitest (~> 4.7.0)
76
- mocha (~> 0.13.3)
77
- railties (~> 3.2.11)
78
- rake (~> 10.0.3)
79
- vcr (~> 2.4.0)
66
+ minitest (~> 5.3.5)
67
+ minitest-around (~> 0.2.0)
68
+ mocha (~> 1.1.0)
69
+ pry
70
+ railties (~> 4.1.4)
71
+ rake (~> 10.3.2)
80
72
  zero_push!
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- [![ZeroPush](https://raw.github.com/SymmetricInfinity/zero_push/master/zeropush-header.png)](https://zeropush.com)
1
+ [![ZeroPush](https://raw.github.com/ZeroPush/zero_push/master/zeropush-header.png)](https://zeropush.com)
2
2
 
3
- Build Status: [![Build Status](https://travis-ci.org/SymmetricInfinity/zero_push.png?branch=master)](https://travis-ci.org/SymmetricInfinity/zero_push)
3
+ Build Status: [![Build Status](https://travis-ci.org/ZeroPush/zero_push.png?branch=master)](https://travis-ci.org/ZeroPush/zero_push)
4
4
 
5
5
  ## Installation
6
6
 
@@ -118,7 +118,7 @@ module ZeroPush
118
118
  c.token_auth self.auth_token
119
119
  c.request :url_encoded # form-encode POST params
120
120
  c.response :json, :content_type => /\bjson$/ # parse responses to JSON
121
- c.adapter Faraday.default_adapter # Net::HTTP
121
+ c.adapter Faraday.default_adapter
122
122
  end
123
123
  end
124
124
  end
@@ -1,3 +1,3 @@
1
1
  module ZeroPush
2
- VERSION = '2.4.0'
2
+ VERSION = '2.4.1'
3
3
  end
@@ -0,0 +1,25 @@
1
+ class ZeroPush::Client
2
+ def client
3
+ Faraday.new do |builder|
4
+ builder.token_auth self.auth_token
5
+ builder.response :json, :content_type => /\bjson$/ # parse responses to JSON
6
+ builder.adapter :test do |stub|
7
+ stub.get('/verify_credentials') do |env|
8
+ if env.request_headers['Authorization'] == "Token token=\"not a valid token\""
9
+ [401, {'Content-Type' => 'application/json'}, '{"error": "unauthorized"}']
10
+ else
11
+ [200, {'Content-Type' => 'application/json'}, '{"message": "authenticated"}']
12
+ end
13
+ end
14
+ stub.post('/register') { [200, {'Content-Type' => 'application/json'}, '{"message":"ok"}'] }
15
+ stub.delete('/unregister') { [200, {'Content-Type' => 'application/json'}, '{"message":"ok"}'] }
16
+ stub.post('/notify') { [200, {'Content-Type' => 'application/json'}, '{"sent_count":1, "inactive_tokens":[]}'] }
17
+ stub.post('/broadcast') { [200, {'Content-Type' => 'application/json'}, '{"sent_count":10}'] }
18
+ stub.post('/subscribe/foo_channel') { [200, {'Content-Type' => 'application/json'}, '{"device_token": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","channels":["foo_channel"]}'] }
19
+ stub.delete('/subscribe/foo_channel') { [200, {'Content-Type' => 'application/json'}, '{"device_token": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","channels":[]}'] }
20
+ stub.post('/set_badge') { [200, {'Content-Type' => 'application/json'}, '{"message":"ok"}'] }
21
+ stub.get('/inactive_tokens') { [200, {'Content-Type' => 'application/json'}, '[{"device_token": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","marked_inactive_at": "2013-03-11T16:25:14-04:00"}]'] }
22
+ end
23
+ end
24
+ end
25
+ end
@@ -8,7 +8,8 @@ class ZeroPush::GeneratorTest < Rails::Generators::TestCase
8
8
  test 'it copies the initializer' do
9
9
  production_token = 'production'
10
10
  development_token = 'development'
11
- $stdin.stubs(:gets).returns(production_token).then.returns(development_token)
11
+ ZeroPush::InstallGenerator.any_instance.stubs(:ask).returns(production_token).then.returns(development_token)
12
+
12
13
  run_generator
13
14
 
14
15
  assert_file 'config/initializers/zero_push.rb' do |initializer|
data/spec/spec_helper.rb CHANGED
@@ -1,16 +1,8 @@
1
- require 'minitest/spec'
2
1
  require 'minitest/autorun'
2
+ require 'minitest/spec'
3
3
  require 'zero_push'
4
- require 'vcr'
4
+ require 'pry'
5
+
6
+ ENV['AUTH_TOKEN'] ||= 'test-token'
5
7
 
6
- VCR.configure do |c|
7
- c.cassette_library_dir = 'spec/fixtures'
8
- c.hook_into :faraday
9
- c.default_cassette_options = {
10
- record: :new_episodes,
11
- match_requests_on: [:method, :uri, :headers]
12
- }
13
- #Note: in some cases it may be necessary to add
14
- #serialize_with: :syck to the default cassett options
15
- #when recording new cassettes
16
- end
8
+ require 'fixtures/responses' if ENV['AUTH_TOKEN'] == 'test-token'
@@ -2,17 +2,11 @@ require 'spec_helper'
2
2
 
3
3
  describe ZeroPush::Client do
4
4
 
5
- let(:auth_token){ENV['AUTH_TOKEN'] || 'test_token'}
6
- let(:client){ZeroPush.client(auth_token)}
5
+ let(:auth_token){ ENV['AUTH_TOKEN'] }
6
+ let(:client){ ZeroPush.client(auth_token) }
7
+ let(:device_token) { 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }
7
8
 
8
9
  describe '#verify_credentials' do
9
- before do
10
- VCR.insert_cassette 'verify_credentials'
11
- end
12
-
13
- after do
14
- VCR.eject_cassette
15
- end
16
10
 
17
11
  it 'should verify credentials successfully' do
18
12
  client.verify_credentials.must_equal true
@@ -26,72 +20,60 @@ describe ZeroPush::Client do
26
20
 
27
21
  describe '#notify' do
28
22
  before do
29
- VCR.insert_cassette 'notify'
23
+ client.register(device_token)
30
24
  end
31
25
 
32
26
  after do
33
- VCR.eject_cassette
27
+ client.unregister(device_token)
34
28
  end
35
29
 
36
- let(:response){client.notify(device_tokens: ['abc'], alert: 'hi')}
30
+ let(:response){client.notify(device_tokens: [device_token], alert: 'hi')}
37
31
 
38
32
  it 'should return a hash' do
39
33
  response.body.class.must_equal Hash
40
34
  end
41
35
 
42
36
  it 'should construct the request' do
43
- response.body['sent_count'].must_equal 0
37
+ response.body['sent_count'].must_equal 1
44
38
  response.body['inactive_tokens'].must_equal []
45
39
  end
46
40
  end
47
41
 
48
42
  describe '#register' do
49
- before do
50
- VCR.insert_cassette 'register'
51
- end
52
-
53
- after do
54
- VCR.eject_cassette
55
- end
56
43
 
57
44
  describe 'without a channel parameter' do
58
45
  it 'should return a hash' do
59
- client.register('abc').body.class.must_equal Hash
46
+ client.register(device_token).body.class.must_equal Hash
60
47
  end
61
48
 
62
49
  it 'should register the device' do
63
- client.register('abc').body['message'].must_equal 'ok'
50
+ client.register(device_token).body['message'].must_equal 'ok'
64
51
  end
65
52
  end
66
53
 
67
54
  describe 'with a channel parameter' do
68
55
  it 'should return a hash' do
69
- client.register('abc', 'foo').body.class.must_equal Hash
56
+ client.register(device_token, 'foo').body.class.must_equal Hash
70
57
  end
71
58
 
72
59
  it 'should register the device' do
73
- client.register('abc', 'foo').body['message'].must_equal 'ok'
60
+ client.register(device_token, 'foo').body['message'].must_equal 'ok'
74
61
  end
75
62
  end
76
63
  end
77
64
 
78
65
  describe '#unregister' do
79
-
80
66
  before do
81
- VCR.insert_cassette 'unregister'
82
- end
83
-
84
- after do
85
- VCR.eject_cassette
67
+ client.register(device_token)
86
68
  end
87
69
 
88
70
  describe 'when the device has been registered' do
89
71
  it 'should return a hash' do
90
- client.unregister('abc').body.class.must_equal Hash
72
+ client.unregister(device_token).body.class.must_equal Hash
91
73
  end
92
74
 
93
75
  it 'should unregister the device' do
94
- client.unregister('abc').body['message'].must_equal 'ok'
76
+ client.unregister(device_token).body['message'].must_equal 'ok'
95
77
  end
96
78
  end
97
79
 
@@ -99,55 +81,48 @@ describe ZeroPush::Client do
99
81
 
100
82
  describe '#subscribe' do
101
83
  before do
102
- VCR.insert_cassette 'subscribe'
84
+ client.register(device_token)
103
85
  end
104
86
 
105
87
  after do
106
- VCR.eject_cassette
88
+ client.unregister(device_token)
107
89
  end
108
90
 
109
- let(:response){client.subscribe('abc', 'foo_channel')}
91
+ let(:response){client.subscribe(device_token, 'foo_channel')}
110
92
 
111
93
  it 'should return a hash' do
112
94
  response.body.class.must_equal Hash
113
95
  end
114
96
 
115
97
  it 'should subscribe a device to a channel' do
116
- response.body['device_token'].must_equal 'abc'
117
- response.body['channels'].must_equal ['foo_channel']
98
+ response.body['device_token'].must_equal device_token
99
+ response.body['channels'].must_include 'foo_channel'
118
100
  end
119
101
  end
120
102
 
121
103
  describe '#unsubscribe' do
122
104
  before do
123
- VCR.insert_cassette 'unsubscribe'
105
+ client.register(device_token)
106
+ client.subscribe(device_token, 'foo_channel')
124
107
  end
125
108
 
126
109
  after do
127
- VCR.eject_cassette
110
+ client.unregister(device_token)
128
111
  end
129
112
 
130
- let(:response){client.unsubscribe('abc', 'foo_channel')}
113
+ let(:response){client.unsubscribe(device_token, 'foo_channel')}
131
114
 
132
115
  it 'should return a hash' do
133
116
  response.body.class.must_equal Hash
134
117
  end
135
118
 
136
119
  it 'should subscribe a device to a channel' do
137
- response.body['device_token'].must_equal 'abc'
138
- response.body['channels'].must_equal []
120
+ response.body['device_token'].must_equal device_token
121
+ response.body['channels'].wont_include 'foo_channel'
139
122
  end
140
123
  end
141
124
 
142
125
  describe '#broadcast' do
143
- before do
144
- VCR.insert_cassette 'broadcast'
145
- end
146
-
147
- after do
148
- VCR.eject_cassette
149
- end
150
-
151
126
  let(:response){client.broadcast(alert:'hi')}
152
127
 
153
128
  it 'should return a hash' do
@@ -161,14 +136,14 @@ describe ZeroPush::Client do
161
136
 
162
137
  describe '#set_badge' do
163
138
  before do
164
- VCR.insert_cassette 'set_badge'
139
+ client.register(device_token)
165
140
  end
166
141
 
167
142
  after do
168
- VCR.eject_cassette
143
+ client.unregister(device_token)
169
144
  end
170
145
 
171
- let(:response){client.set_badge('abc', 10)}
146
+ let(:response){client.set_badge(device_token, 10)}
172
147
 
173
148
  it 'should return a hash' do
174
149
  response.body.class.must_equal Hash
@@ -180,13 +155,6 @@ describe ZeroPush::Client do
180
155
  end
181
156
 
182
157
  describe '#inactive_tokens' do
183
- before do
184
- VCR.insert_cassette 'inactive_tokens'
185
- end
186
-
187
- after do
188
- VCR.eject_cassette
189
- end
190
158
 
191
159
  let(:response){client.inactive_tokens}
192
160
 
@@ -195,7 +163,7 @@ describe ZeroPush::Client do
195
163
  end
196
164
 
197
165
  it 'should get a list of inactive tokens' do
198
- response.body.count.must_equal 2
166
+ response.body.count.must_equal 1
199
167
  end
200
168
  end
201
169
  end
data/zero_push.gemspec CHANGED
@@ -19,14 +19,13 @@ Gem::Specification.new do |gem|
19
19
  gem.require_paths = ["lib"]
20
20
  gem.required_ruby_version = '>= 1.9'
21
21
 
22
- gem.add_dependency "faraday", "~> 0.8.5"
22
+ gem.add_dependency "faraday", "~> 0.9.0"
23
23
  gem.add_dependency "faraday_middleware", "~> 0.9.0"
24
24
 
25
- gem.add_development_dependency 'actionpack', '~> 3.2.11'
26
- gem.add_development_dependency 'activesupport', '~> 3.2.11'
27
- gem.add_development_dependency 'minitest', '~> 4.7.0'
28
- gem.add_development_dependency 'mocha', '~> 0.13.3'
29
- gem.add_development_dependency 'rake', '~> 10.0.3'
30
- gem.add_development_dependency 'railties', '~> 3.2.11'
31
- gem.add_development_dependency 'vcr', '~> 2.4.0'
25
+ gem.add_development_dependency 'minitest', '~> 5.3.5'
26
+ gem.add_development_dependency 'minitest-around', '~> 0.2.0'
27
+ gem.add_development_dependency 'mocha', '~> 1.1.0'
28
+ gem.add_development_dependency 'rake', '~> 10.3.2'
29
+ gem.add_development_dependency 'railties', '~> 4.1.4'
30
+ gem.add_development_dependency 'pry'
32
31
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zero_push
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
5
- prerelease:
4
+ version: 2.4.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Stefan Natchev
@@ -10,152 +9,120 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2014-05-06 00:00:00.000000000 Z
12
+ date: 2014-07-08 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: faraday
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ~>
18
+ - - "~>"
21
19
  - !ruby/object:Gem::Version
22
- version: 0.8.5
20
+ version: 0.9.0
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ~>
25
+ - - "~>"
29
26
  - !ruby/object:Gem::Version
30
- version: 0.8.5
27
+ version: 0.9.0
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: faraday_middleware
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ~>
32
+ - - "~>"
37
33
  - !ruby/object:Gem::Version
38
34
  version: 0.9.0
39
35
  type: :runtime
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ~>
39
+ - - "~>"
45
40
  - !ruby/object:Gem::Version
46
41
  version: 0.9.0
47
42
  - !ruby/object:Gem::Dependency
48
- name: actionpack
49
- requirement: !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: 3.2.11
55
- type: :development
56
- prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
60
- - - ~>
61
- - !ruby/object:Gem::Version
62
- version: 3.2.11
63
- - !ruby/object:Gem::Dependency
64
- name: activesupport
43
+ name: minitest
65
44
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
45
  requirements:
68
- - - ~>
46
+ - - "~>"
69
47
  - !ruby/object:Gem::Version
70
- version: 3.2.11
48
+ version: 5.3.5
71
49
  type: :development
72
50
  prerelease: false
73
51
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
52
  requirements:
76
- - - ~>
53
+ - - "~>"
77
54
  - !ruby/object:Gem::Version
78
- version: 3.2.11
55
+ version: 5.3.5
79
56
  - !ruby/object:Gem::Dependency
80
- name: minitest
57
+ name: minitest-around
81
58
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
59
  requirements:
84
- - - ~>
60
+ - - "~>"
85
61
  - !ruby/object:Gem::Version
86
- version: 4.7.0
62
+ version: 0.2.0
87
63
  type: :development
88
64
  prerelease: false
89
65
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
66
  requirements:
92
- - - ~>
67
+ - - "~>"
93
68
  - !ruby/object:Gem::Version
94
- version: 4.7.0
69
+ version: 0.2.0
95
70
  - !ruby/object:Gem::Dependency
96
71
  name: mocha
97
72
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
73
  requirements:
100
- - - ~>
74
+ - - "~>"
101
75
  - !ruby/object:Gem::Version
102
- version: 0.13.3
76
+ version: 1.1.0
103
77
  type: :development
104
78
  prerelease: false
105
79
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
80
  requirements:
108
- - - ~>
81
+ - - "~>"
109
82
  - !ruby/object:Gem::Version
110
- version: 0.13.3
83
+ version: 1.1.0
111
84
  - !ruby/object:Gem::Dependency
112
85
  name: rake
113
86
  requirement: !ruby/object:Gem::Requirement
114
- none: false
115
87
  requirements:
116
- - - ~>
88
+ - - "~>"
117
89
  - !ruby/object:Gem::Version
118
- version: 10.0.3
90
+ version: 10.3.2
119
91
  type: :development
120
92
  prerelease: false
121
93
  version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
94
  requirements:
124
- - - ~>
95
+ - - "~>"
125
96
  - !ruby/object:Gem::Version
126
- version: 10.0.3
97
+ version: 10.3.2
127
98
  - !ruby/object:Gem::Dependency
128
99
  name: railties
129
100
  requirement: !ruby/object:Gem::Requirement
130
- none: false
131
101
  requirements:
132
- - - ~>
102
+ - - "~>"
133
103
  - !ruby/object:Gem::Version
134
- version: 3.2.11
104
+ version: 4.1.4
135
105
  type: :development
136
106
  prerelease: false
137
107
  version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
108
  requirements:
140
- - - ~>
109
+ - - "~>"
141
110
  - !ruby/object:Gem::Version
142
- version: 3.2.11
111
+ version: 4.1.4
143
112
  - !ruby/object:Gem::Dependency
144
- name: vcr
113
+ name: pry
145
114
  requirement: !ruby/object:Gem::Requirement
146
- none: false
147
115
  requirements:
148
- - - ~>
116
+ - - ">="
149
117
  - !ruby/object:Gem::Version
150
- version: 2.4.0
118
+ version: '0'
151
119
  type: :development
152
120
  prerelease: false
153
121
  version_requirements: !ruby/object:Gem::Requirement
154
- none: false
155
122
  requirements:
156
- - - ~>
123
+ - - ">="
157
124
  - !ruby/object:Gem::Version
158
- version: 2.4.0
125
+ version: '0'
159
126
  description: ZeroPush is a simple service for sending iOS push notifications. (http://zeropush.com)
160
127
  email:
161
128
  - stefan.natchev@gmail.com
@@ -164,8 +131,8 @@ executables: []
164
131
  extensions: []
165
132
  extra_rdoc_files: []
166
133
  files:
167
- - .gitignore
168
- - .travis.yml
134
+ - ".gitignore"
135
+ - ".travis.yml"
169
136
  - Gemfile
170
137
  - Gemfile.lock
171
138
  - LICENSE
@@ -176,15 +143,7 @@ files:
176
143
  - lib/zero_push.rb
177
144
  - lib/zero_push/client.rb
178
145
  - lib/zero_push/version.rb
179
- - spec/fixtures/broadcast.yml
180
- - spec/fixtures/inactive_tokens.yml
181
- - spec/fixtures/notify.yml
182
- - spec/fixtures/register.yml
183
- - spec/fixtures/set_badge.yml
184
- - spec/fixtures/subscribe.yml
185
- - spec/fixtures/unregister.yml
186
- - spec/fixtures/unsubscribe.yml
187
- - spec/fixtures/verify_credentials.yml
146
+ - spec/fixtures/responses.rb
188
147
  - spec/generator_spec.rb
189
148
  - spec/spec_helper.rb
190
149
  - spec/zero_push_client_spec.rb
@@ -194,40 +153,30 @@ files:
194
153
  homepage: https://zeropush.com
195
154
  licenses:
196
155
  - MIT
156
+ metadata: {}
197
157
  post_install_message:
198
158
  rdoc_options: []
199
159
  require_paths:
200
160
  - lib
201
161
  required_ruby_version: !ruby/object:Gem::Requirement
202
- none: false
203
162
  requirements:
204
- - - ! '>='
163
+ - - ">="
205
164
  - !ruby/object:Gem::Version
206
165
  version: '1.9'
207
166
  required_rubygems_version: !ruby/object:Gem::Requirement
208
- none: false
209
167
  requirements:
210
- - - ! '>='
168
+ - - ">="
211
169
  - !ruby/object:Gem::Version
212
170
  version: '0'
213
171
  requirements: []
214
172
  rubyforge_project:
215
- rubygems_version: 1.8.23
173
+ rubygems_version: 2.2.2
216
174
  signing_key:
217
- specification_version: 3
175
+ specification_version: 4
218
176
  summary: A gem for interacting with the ZeroPush API. (http://zeropush.com)
219
177
  test_files:
220
- - spec/fixtures/broadcast.yml
221
- - spec/fixtures/inactive_tokens.yml
222
- - spec/fixtures/notify.yml
223
- - spec/fixtures/register.yml
224
- - spec/fixtures/set_badge.yml
225
- - spec/fixtures/subscribe.yml
226
- - spec/fixtures/unregister.yml
227
- - spec/fixtures/unsubscribe.yml
228
- - spec/fixtures/verify_credentials.yml
178
+ - spec/fixtures/responses.rb
229
179
  - spec/generator_spec.rb
230
180
  - spec/spec_helper.rb
231
181
  - spec/zero_push_client_spec.rb
232
182
  - spec/zero_push_spec.rb
233
- has_rdoc:
@@ -1,57 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://api.zeropush.com/broadcast
6
- body:
7
- encoding: US-ASCII
8
- string: alert=hi
9
- headers:
10
- Authorization:
11
- - Token token="test_token"
12
- User-Agent:
13
- - Faraday v0.8.9
14
- Content-Type:
15
- - application/x-www-form-urlencoded
16
- response:
17
- status:
18
- code: 200
19
- message:
20
- headers:
21
- server:
22
- - nginx/1.2.6
23
- date:
24
- - Thu, 06 Jun 2013 20:13:18 GMT
25
- content-type:
26
- - application/json; charset=utf-8
27
- transfer-encoding:
28
- - chunked
29
- connection:
30
- - close
31
- status:
32
- - 200 OK
33
- strict-transport-security:
34
- - max-age=31536000
35
- x-ua-compatible:
36
- - IE=Edge,chrome=1
37
- etag:
38
- - ! '"58f271cd44a149e655e5c75c6ac3d588"'
39
- cache-control:
40
- - max-age=0, private, must-revalidate
41
- set-cookie:
42
- - _zero-push-session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTAyN2ZlNmZiYmE2NDAwZTAwNDhkZjljMDhjOTk5MDMzBjsAVA%3D%3D--123a1dc1afeac26db5bea15eea8574e82e0d91b2;
43
- path=/; secure; HttpOnly
44
- x-request-id:
45
- - cb7a26e273628f7f0c9f3c4bbcfb5007
46
- x-runtime:
47
- - '0.045243'
48
- x-rack-cache:
49
- - invalidate, pass
50
- x-powered-by:
51
- - Phusion Passenger 4.0.2
52
- body:
53
- encoding: US-ASCII
54
- string: ! '{"sent_count":10}'
55
- http_version:
56
- recorded_at: Thu, 06 Jun 2013 20:13:18 GMT
57
- recorded_with: VCR 2.4.0
@@ -1,52 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://api.zeropush.com/inactive_tokens
6
- body:
7
- encoding: US-ASCII
8
- string: ""
9
- headers:
10
- Authorization:
11
- - Token token="test_token"
12
- User-Agent:
13
- - Faraday v0.8.9
14
- response:
15
- status:
16
- code: 200
17
- message:
18
- headers:
19
- server:
20
- - nginx/1.2.6
21
- date:
22
- - Fri, 09 Aug 2013 01:19:03 GMT
23
- content-type:
24
- - application/json; charset=utf-8
25
- transfer-encoding:
26
- - chunked
27
- connection:
28
- - close
29
- status:
30
- - 200 OK
31
- strict-transport-security:
32
- - max-age=31536000
33
- x-ua-compatible:
34
- - IE=Edge
35
- etag:
36
- - "\"9c9190eec43ccacbad112e6a77dc6a83\""
37
- cache-control:
38
- - must-revalidate, private, max-age=0
39
- x-request-id:
40
- - dc4287a5b6dfe69125d0c6b36ab958f9
41
- x-runtime:
42
- - "0.079937"
43
- x-rack-cache:
44
- - miss
45
- x-powered-by:
46
- - Phusion Passenger 4.0.2
47
- body:
48
- encoding: ASCII-8BIT
49
- string: "[{\"device_token\":\"238b8cb09011850cb4bd544dfe0c8f5eeab73d7eeaae9bdca59076db4ae49947\",\"marked_inactive_at\":\"2013-07-17T01:27:53-04:00\"},{\"device_token\":\"8c97be6643eea2143322005bc4c44a1aee5e549bce5e2bb2116114f45484ddaf\",\"marked_inactive_at\":\"2013-07-17T01:27:50-04:00\"}]"
50
- http_version:
51
- recorded_at: Fri, 09 Aug 2013 01:19:04 GMT
52
- recorded_with: VCR 2.4.0
@@ -1,57 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://api.zeropush.com/notify
6
- body:
7
- encoding: US-ASCII
8
- string: device_tokens%5B%5D=abc&alert=hi
9
- headers:
10
- Authorization:
11
- - Token token="test_token"
12
- User-Agent:
13
- - Faraday v0.8.9
14
- Content-Type:
15
- - application/x-www-form-urlencoded
16
- response:
17
- status:
18
- code: 200
19
- message:
20
- headers:
21
- server:
22
- - nginx/1.2.6
23
- date:
24
- - Thu, 06 Jun 2013 20:13:18 GMT
25
- content-type:
26
- - application/json; charset=utf-8
27
- transfer-encoding:
28
- - chunked
29
- connection:
30
- - close
31
- status:
32
- - 200 OK
33
- strict-transport-security:
34
- - max-age=31536000
35
- x-ua-compatible:
36
- - IE=Edge,chrome=1
37
- etag:
38
- - ! '"58f271cd44a149e655e5c75c6ac3d588"'
39
- cache-control:
40
- - max-age=0, private, must-revalidate
41
- set-cookie:
42
- - _zero-push-session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTAyN2ZlNmZiYmE2NDAwZTAwNDhkZjljMDhjOTk5MDMzBjsAVA%3D%3D--123a1dc1afeac26db5bea15eea8574e82e0d91b2;
43
- path=/; secure; HttpOnly
44
- x-request-id:
45
- - cb7a26e273628f7f0c9f3c4bbcfb5007
46
- x-runtime:
47
- - '0.045243'
48
- x-rack-cache:
49
- - invalidate, pass
50
- x-powered-by:
51
- - Phusion Passenger 4.0.2
52
- body:
53
- encoding: US-ASCII
54
- string: ! '{"sent_count":0,"inactive_tokens":[],"unregistered_tokens":["abc"]}'
55
- http_version:
56
- recorded_at: Thu, 06 Jun 2013 20:13:18 GMT
57
- recorded_with: VCR 2.4.0
@@ -1,106 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://api.zeropush.com/register
6
- body:
7
- encoding: US-ASCII
8
- string: device_token=abc
9
- headers:
10
- Authorization:
11
- - Token token="test_token"
12
- User-Agent:
13
- - Faraday v0.8.9
14
- Content-Type:
15
- - application/x-www-form-urlencoded
16
- response:
17
- status:
18
- code: 200
19
- message:
20
- headers:
21
- server:
22
- - nginx/1.2.6
23
- date:
24
- - Thu, 08 Aug 2013 23:50:40 GMT
25
- content-type:
26
- - application/json; charset=utf-8
27
- transfer-encoding:
28
- - chunked
29
- connection:
30
- - close
31
- status:
32
- - 200 OK
33
- strict-transport-security:
34
- - max-age=31536000
35
- x-ua-compatible:
36
- - IE=Edge
37
- etag:
38
- - ! '"4548a4f1a11a241120f97a1c3737817a"'
39
- cache-control:
40
- - max-age=0, private, must-revalidate
41
- set-cookie:
42
- - _zero-push-session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJWM0YWVlZjMxMWRlODM5OGI5MTk5MDQyZWZmNTc0YTg5BjsAVA%3D%3D--7832266b6f7ce258d10744496757e9d73192399d;
43
- path=/; secure; HttpOnly
44
- x-request-id:
45
- - 09b0b1f839a3648dd1de9617e80f7583
46
- x-runtime:
47
- - '0.018914'
48
- x-rack-cache:
49
- - invalidate, pass
50
- x-powered-by:
51
- - Phusion Passenger 4.0.2
52
- body:
53
- encoding: US-ASCII
54
- string: ! '{"message":"ok"}'
55
- http_version:
56
- recorded_at: Thu, 08 Aug 2013 23:50:39 GMT
57
- - request:
58
- method: post
59
- uri: https://api.zeropush.com/register
60
- body:
61
- encoding: US-ASCII
62
- string: device_token=abc&channel=foo
63
- headers:
64
- Authorization:
65
- - Token token="test_token"
66
- User-Agent:
67
- - Faraday v0.8.9
68
- Content-Type:
69
- - application/x-www-form-urlencoded
70
- response:
71
- status:
72
- code: 200
73
- message:
74
- headers:
75
- server:
76
- - nginx
77
- date:
78
- - Fri, 21 Mar 2014 04:38:14 GMT
79
- content-type:
80
- - application/json; charset=utf-8
81
- transfer-encoding:
82
- - chunked
83
- connection:
84
- - close
85
- status:
86
- - 200 OK
87
- strict-transport-security:
88
- - max-age=31536000
89
- x-frame-options:
90
- - SAMEORIGIN
91
- x-xss-protection:
92
- - 1; mode=block
93
- x-content-type-options:
94
- - nosniff
95
- x-ua-compatible:
96
- - chrome=1
97
- cache-control:
98
- - no-cache
99
- x-request-id:
100
- - 1eb2b29a-00f7-4554-80f3-63aaafbd04ee
101
- body:
102
- encoding: US-ASCII
103
- string: ! '{"message":"ok"}'
104
- http_version:
105
- recorded_at: Fri, 21 Mar 2014 04:38:18 GMT
106
- recorded_with: VCR 2.4.0
@@ -1,57 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://api.zeropush.com/set_badge
6
- body:
7
- encoding: US-ASCII
8
- string: device_token=abc&badge=10
9
- headers:
10
- Authorization:
11
- - Token token="test_token"
12
- User-Agent:
13
- - Faraday v0.8.9
14
- Content-Type:
15
- - application/x-www-form-urlencoded
16
- response:
17
- status:
18
- code: 200
19
- message:
20
- headers:
21
- server:
22
- - nginx/1.2.6
23
- date:
24
- - Fri, 09 Aug 2013 00:57:11 GMT
25
- content-type:
26
- - application/json; charset=utf-8
27
- transfer-encoding:
28
- - chunked
29
- connection:
30
- - close
31
- status:
32
- - 200 OK
33
- strict-transport-security:
34
- - max-age=31536000
35
- x-ua-compatible:
36
- - IE=Edge
37
- etag:
38
- - ! '"4548a4f1a11a241120f97a1c3737817a"'
39
- cache-control:
40
- - max-age=0, private, must-revalidate
41
- set-cookie:
42
- - _zero-push-session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTdmMmJkMTRmNzVkNGI2NzI1ODA2MjlhMjdlZjdlYjAyBjsAVA%3D%3D--888243f320504a8621f826f76ec84ccb94f81b33;
43
- path=/; secure; HttpOnly
44
- x-request-id:
45
- - fdb9461a5c2e67b8553c871a31d72695
46
- x-runtime:
47
- - '0.021581'
48
- x-rack-cache:
49
- - invalidate, pass
50
- x-powered-by:
51
- - Phusion Passenger 4.0.2
52
- body:
53
- encoding: US-ASCII
54
- string: ! '{"message":"ok"}'
55
- http_version:
56
- recorded_at: Fri, 09 Aug 2013 00:57:11 GMT
57
- recorded_with: VCR 2.4.0
@@ -1,46 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://api.zeropush.com/subscribe/foo_channel
6
- body:
7
- encoding: US-ASCII
8
- string: device_token=abc
9
- headers:
10
- Authorization:
11
- - Token token="test_token"
12
- User-Agent:
13
- - Faraday v0.8.9
14
- Content-Type:
15
- - application/x-www-form-urlencoded
16
- response:
17
- status:
18
- code: 200
19
- message:
20
- headers:
21
- server:
22
- - nginx/1.2.6
23
- date:
24
- - Tue, 24 Sep 2013 21:04:42 GMT
25
- content-type:
26
- - application/json; charset=utf-8
27
- transfer-encoding:
28
- - chunked
29
- connection:
30
- - close
31
- status:
32
- - 200 OK
33
- strict-transport-security:
34
- - max-age=31536000
35
- etag:
36
- - "\"87bf21d9412e1d8611e6bdbe67ee3701\""
37
- cache-control:
38
- - max-age=0, private, must-revalidate
39
- x-request-id:
40
- - 79f5fe32-7d1e-4ffd-b90f-d17eaa7547da
41
- body:
42
- encoding: US-ASCII
43
- string: "{\"device_token\":\"abc\",\"channels\":[\"foo_channel\"]}"
44
- http_version:
45
- recorded_at: Tue, 24 Sep 2013 21:04:42 GMT
46
- recorded_with: VCR 2.4.0
@@ -1,50 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: delete
5
- uri: https://api.zeropush.com/unregister?device_token=abc
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Authorization:
11
- - Token token="test_token"
12
- User-Agent:
13
- - Faraday v0.8.9
14
- response:
15
- status:
16
- code: 200
17
- message:
18
- headers:
19
- server:
20
- - nginx
21
- date:
22
- - Tue, 06 May 2014 19:28:44 GMT
23
- content-type:
24
- - application/json; charset=utf-8
25
- transfer-encoding:
26
- - chunked
27
- connection:
28
- - close
29
- status:
30
- - 200 OK
31
- strict-transport-security:
32
- - max-age=31536000
33
- x-device-quota:
34
- - '100'
35
- x-device-quota-remaining:
36
- - '97'
37
- x-device-quota-overage:
38
- - '0'
39
- etag:
40
- - ! '"4548a4f1a11a241120f97a1c3737817a"'
41
- cache-control:
42
- - max-age=0, private, must-revalidate
43
- x-request-id:
44
- - 9a580c69-b5b9-4b57-91c0-2da521799fd9
45
- body:
46
- encoding: US-ASCII
47
- string: ! '{"message":"ok"}'
48
- http_version:
49
- recorded_at: Tue, 06 May 2014 19:28:43 GMT
50
- recorded_with: VCR 2.4.0
@@ -1,44 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: delete
5
- uri: https://api.zeropush.com/subscribe/foo_channel?device_token=abc
6
- body:
7
- encoding: US-ASCII
8
- string: ""
9
- headers:
10
- Authorization:
11
- - Token token="test_token"
12
- User-Agent:
13
- - Faraday v0.8.9
14
- response:
15
- status:
16
- code: 200
17
- message:
18
- headers:
19
- server:
20
- - nginx/1.2.6
21
- date:
22
- - Tue, 24 Sep 2013 21:04:42 GMT
23
- content-type:
24
- - application/json; charset=utf-8
25
- transfer-encoding:
26
- - chunked
27
- connection:
28
- - close
29
- status:
30
- - 200 OK
31
- strict-transport-security:
32
- - max-age=31536000
33
- etag:
34
- - "\"87bf21d9412e1d8611e6bdbe67ee3701\""
35
- cache-control:
36
- - max-age=0, private, must-revalidate
37
- x-request-id:
38
- - 79f5fe32-7d1e-4ffd-b90f-d17eaa7547da
39
- body:
40
- encoding: US-ASCII
41
- string: "{\"device_token\":\"abc\",\"channels\":[]}"
42
- http_version:
43
- recorded_at: Tue, 24 Sep 2013 21:04:42 GMT
44
- recorded_with: VCR 2.4.0
@@ -1,114 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://api.zeropush.com/verify_credentials
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Authorization:
11
- - Token token="test_token"
12
- User-Agent:
13
- - Faraday v0.8.9
14
- response:
15
- status:
16
- code: 200
17
- message:
18
- headers:
19
- server:
20
- - !binary |-
21
- bmdpbngvMS4yLjY=
22
- date:
23
- - !binary |-
24
- VGh1LCAwNiBKdW4gMjAxMyAyMDoxMzoxOCBHTVQ=
25
- content-type:
26
- - !binary |-
27
- YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA==
28
- transfer-encoding:
29
- - !binary |-
30
- Y2h1bmtlZA==
31
- connection:
32
- - !binary |-
33
- Y2xvc2U=
34
- status:
35
- - !binary |-
36
- MjAwIE9L
37
- strict-transport-security:
38
- - !binary |-
39
- bWF4LWFnZT0zMTUzNjAwMA==
40
- x-ua-compatible:
41
- - !binary |-
42
- SUU9RWRnZSxjaHJvbWU9MQ==
43
- etag:
44
- - !binary |-
45
- ImJiYzAwYmM1Nzg4ZDY0MTNhMjhkMTY4M2IwYTMzMGEzIg==
46
- cache-control:
47
- - !binary |-
48
- bXVzdC1yZXZhbGlkYXRlLCBwcml2YXRlLCBtYXgtYWdlPTA=
49
- x-request-id:
50
- - !binary |-
51
- M2ZjZDgzNGQyM2ZhM2M4YjdlODExMzQ4NTRjYjhmMjI=
52
- x-runtime:
53
- - !binary |-
54
- MC4wMDY5Mjk=
55
- x-rack-cache:
56
- - !binary |-
57
- bWlzcw==
58
- x-powered-by:
59
- - !binary |-
60
- UGh1c2lvbiBQYXNzZW5nZXIgNC4wLjI=
61
- body:
62
- encoding: ASCII-8BIT
63
- string: !binary |-
64
- eyJtZXNzYWdlIjoiYXV0aGVudGljYXRlZCJ9
65
- http_version:
66
- recorded_at: Thu, 06 Jun 2013 20:13:18 GMT
67
- - request:
68
- method: get
69
- uri: https://api.zeropush.com/verify_credentials
70
- body:
71
- encoding: US-ASCII
72
- string: ''
73
- headers:
74
- Authorization:
75
- - Token token="not a valid token"
76
- User-Agent:
77
- - Faraday v0.8.9
78
- response:
79
- status:
80
- code: 401
81
- message:
82
- headers:
83
- server:
84
- - nginx/1.2.6
85
- date:
86
- - Thu, 06 Jun 2013 20:13:18 GMT
87
- content-type:
88
- - application/json; charset=utf-8
89
- transfer-encoding:
90
- - chunked
91
- connection:
92
- - close
93
- status:
94
- - 401 Unauthorized
95
- strict-transport-security:
96
- - max-age=31536000
97
- x-ua-compatible:
98
- - IE=Edge,chrome=1
99
- cache-control:
100
- - no-cache, private
101
- x-request-id:
102
- - 091630dcd5d1e8c4a8cbe821940c8747
103
- x-runtime:
104
- - '0.004298'
105
- x-rack-cache:
106
- - miss
107
- x-powered-by:
108
- - Phusion Passenger 4.0.2
109
- body:
110
- encoding: US-ASCII
111
- string: ! '{"error":"unauthorized"}'
112
- http_version:
113
- recorded_at: Thu, 06 Jun 2013 20:13:19 GMT
114
- recorded_with: VCR 2.4.0