zeppelin 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.travis.yml +6 -3
- data/Changelog.md +4 -0
- data/Gemfile +1 -1
- data/README.md +4 -4
- data/lib/zeppelin.rb +1 -1
- data/lib/zeppelin/middleware/response_raise_error.rb +2 -2
- data/lib/zeppelin/version.rb +1 -1
- data/spec/middleware/response_raise_error_spec.rb +38 -10
- data/spec/zeppelin_spec.rb +3 -1
- data/zeppelin.gemspec +2 -1
- metadata +45 -36
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c566b4e3072aede4569314a824909d54d8afe7a6
|
4
|
+
data.tar.gz: 546ca84012ebfc6a4b4e10468359fe1ceb5b4e72
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f5ac23d69645aa49d0f4f87ebae987d4904b34b0971f5cccc56d296936e93a2c2e8654d19cfd2e701c616b99c9c53b864bc6411dd42de19559f81b6331bdd59f
|
7
|
+
data.tar.gz: afbf72d35badea3b61425efffe53c85353a023589705a64407270cf5a5806575e9d97e1b68c52399caac12b3f38405c4ca424735d821cf501b7a73382e3486f0
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
ADDED
Binary file
|
data/.travis.yml
CHANGED
data/Changelog.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# zeppelin - Urban Airship library for Ruby [![StillMaintained Status](http://stillmaintained.com/CapnKernul/zeppelin.png)](http://stillmaintained.com/CapnKernul/zeppelin) [![Build Status](
|
1
|
+
# zeppelin - Urban Airship library for Ruby [![StillMaintained Status](http://stillmaintained.com/CapnKernul/zeppelin.png)](http://stillmaintained.com/CapnKernul/zeppelin) [![Build Status](https://travis-ci.org/kern/zeppelin.png)](https://travis-ci.org/kern/zeppelin)
|
2
2
|
|
3
3
|
Ruby client for the [Urban Airship](http://urbanairship.com) Push Notification
|
4
4
|
API.
|
@@ -34,9 +34,9 @@ Check out the docs for more ways of querying the API.
|
|
34
34
|
|
35
35
|
## Resources ##
|
36
36
|
|
37
|
-
* [GitHub Repository](https://github.com/
|
38
|
-
* [Documentation](http://rubydoc.info/github/
|
39
|
-
* [Issues](https://github.com/
|
37
|
+
* [GitHub Repository](https://github.com/kern/zeppelin)
|
38
|
+
* [Documentation](http://rubydoc.info/github/kern/zeppelin)
|
39
|
+
* [Issues](https://github.com/kern/zeppelin/issues)
|
40
40
|
|
41
41
|
## License ##
|
42
42
|
|
data/lib/zeppelin.rb
CHANGED
@@ -13,9 +13,9 @@ class Zeppelin
|
|
13
13
|
def on_complete(env)
|
14
14
|
super
|
15
15
|
rescue Faraday::Error::ResourceNotFound => msg
|
16
|
-
raise ResourceNotFound, msg
|
16
|
+
raise ResourceNotFound, msg.response
|
17
17
|
rescue Faraday::Error::ClientError => msg
|
18
|
-
raise ClientError, msg
|
18
|
+
raise ClientError, msg.response
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
data/lib/zeppelin/version.rb
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Zeppelin::Middleware::ResponseRaiseError do
|
4
|
+
|
5
|
+
let(:not_found_response) { [404, { 'X-Reason' => 'because' }, 'keep looking'] }
|
6
|
+
let(:error_response) { [500, { 'X-Error' => 'bailout' }, 'fail' ] }
|
7
|
+
|
4
8
|
subject do
|
5
9
|
Faraday.new do |b|
|
6
10
|
b.use(described_class)
|
7
11
|
b.adapter :test do |stub|
|
8
12
|
stub.get('ok') { [200, { 'Content-Type' => 'text/html' }, '<body></body>'] }
|
9
|
-
stub.get('not-found') {
|
10
|
-
stub.get('error') {
|
13
|
+
stub.get('not-found') { not_found_response }
|
14
|
+
stub.get('error') { error_response }
|
11
15
|
end
|
12
16
|
end
|
13
17
|
end
|
@@ -18,15 +22,39 @@ describe Zeppelin::Middleware::ResponseRaiseError do
|
|
18
22
|
}.to_not raise_error
|
19
23
|
end
|
20
24
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
+
context 'resource not found' do
|
26
|
+
it 'raises Zeppelin::ResourceNotFound error' do
|
27
|
+
expect {
|
28
|
+
subject.get('not-found')
|
29
|
+
}.to raise_error(Zeppelin::ResourceNotFound)
|
30
|
+
end
|
31
|
+
|
32
|
+
it "does not destroy the response object stored in the error" do
|
33
|
+
begin
|
34
|
+
subject.get('not-found')
|
35
|
+
rescue Zeppelin::ResourceNotFound => ex
|
36
|
+
expect(ex.response[:status]).to eql(not_found_response[0])
|
37
|
+
expect(ex.response[:headers]).to eql(not_found_response[1])
|
38
|
+
expect(ex.response[:body]).to eql(not_found_response[2])
|
39
|
+
end
|
40
|
+
end
|
25
41
|
end
|
26
42
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
43
|
+
context 'client error' do
|
44
|
+
it 'raises Zeppelin::ClientError error' do
|
45
|
+
expect {
|
46
|
+
subject.get('error')
|
47
|
+
}.to raise_error(Zeppelin::ClientError)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "does not destroy the response object stored in the error" do
|
51
|
+
begin
|
52
|
+
subject.get('error')
|
53
|
+
rescue Zeppelin::ClientError => ex
|
54
|
+
expect(ex.response[:status]).to eql(error_response[0])
|
55
|
+
expect(ex.response[:headers]).to eql(error_response[1])
|
56
|
+
expect(ex.response[:body]).to eql(error_response[2])
|
57
|
+
end
|
58
|
+
end
|
31
59
|
end
|
32
60
|
end
|
data/spec/zeppelin_spec.rb
CHANGED
@@ -344,9 +344,11 @@ describe Zeppelin do
|
|
344
344
|
end
|
345
345
|
|
346
346
|
describe '#batch_push' do
|
347
|
+
let(:device_token) { '123456789' }
|
348
|
+
|
347
349
|
let(:message1) {
|
348
350
|
{
|
349
|
-
:device_tokens => [
|
351
|
+
:device_tokens => [device_token],
|
350
352
|
:aps => { :alert => 'Hello from Urban Airship!' }
|
351
353
|
}
|
352
354
|
}
|
data/zeppelin.gemspec
CHANGED
@@ -8,9 +8,10 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ['Alexander Kern', 'James Herdman']
|
10
10
|
s.email = ['alex@kernul.com', 'james.herdman@me.com']
|
11
|
-
s.homepage = 'https://github.com/
|
11
|
+
s.homepage = 'https://github.com/kern/zeppelin'
|
12
12
|
s.summary = %q{Urban Airship library for Ruby}
|
13
13
|
s.description = %q{Ruby client for the Urban Airship Push Notification API}
|
14
|
+
s.license = 'MIT'
|
14
15
|
|
15
16
|
s.rubyforge_project = 'zeppelin'
|
16
17
|
|
metadata
CHANGED
@@ -1,95 +1,105 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zeppelin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
5
|
-
prerelease:
|
4
|
+
version: 0.8.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Alexander Kern
|
9
8
|
- James Herdman
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
|
-
cert_chain:
|
13
|
-
|
11
|
+
cert_chain:
|
12
|
+
- |
|
13
|
+
-----BEGIN CERTIFICATE-----
|
14
|
+
MIIDNjCCAh6gAwIBAgIBAjANBgkqhkiG9w0BAQUFADBBMRYwFAYDVQQDDA1qYW1l
|
15
|
+
cy5oZXJkbWFuMRIwEAYKCZImiZPyLGQBGRYCbWUxEzARBgoJkiaJk/IsZAEZFgNj
|
16
|
+
b20wHhcNMTQwMzE5MTQzNDM5WhcNMTUwMzE5MTQzNDM5WjBBMRYwFAYDVQQDDA1q
|
17
|
+
YW1lcy5oZXJkbWFuMRIwEAYKCZImiZPyLGQBGRYCbWUxEzARBgoJkiaJk/IsZAEZ
|
18
|
+
FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDM2pjeyg2NKXUh
|
19
|
+
EGVHr182PtsMFhOLJ+5o2V5493s77v7UjsJKzVKCf3tJgJWsMSeZ0dCJyO//t2aH
|
20
|
+
pvCRMc7obXCbfZyOrtjshDgcrpYhFX8v6cabKmGWMn51sUidzWKFJAyfHg6xVTxX
|
21
|
+
OUwqkcZ8tYxm3fkDhs1zzJdCqFCexyKtqIRzQSrIZ4tFxuQG0IJH5ZmI9zHzCyJY
|
22
|
+
6Isk4nEHm6C41alermyns20U85t9jboTk1dgeFvjkkH29j91P/2ID7LLYdFlUVAz
|
23
|
+
AkxDxfwb5vYhEDuPtrFo1ITQZ/JOXddDphoKMx9ZWWKtQLTI8rfHX42Kc1JcGkI+
|
24
|
+
sEK2nBqzAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
25
|
+
BBSh529HngcW9eCkSEaq304xSzbh2TANBgkqhkiG9w0BAQUFAAOCAQEAyhbTA5kL
|
26
|
+
O9l2LIm1OijSV/hzzthsUdrKBo1zr6LuT8KfEMJGFBCKhW0DF74w+Kj5KndJ6oJw
|
27
|
+
DH8S91lq+wC298tCVwP1BCf5GFs6Gg0V3G41obj+6RNp80LnbszIu+c0UhU9FIXQ
|
28
|
+
FUjfah9R1gYjYt/O71SZl26rhvdLWfKaHBoenu2QmCCS6q1GdOHCuuNm5TmlNgz5
|
29
|
+
EQtRuSeUuw4yYbVeP7DzP9lNv6BbB5Ogi01Z/Vt9Oda1cX3HGhEYamWPo/CoIwlQ
|
30
|
+
o/ak9fu0FG0No4A0GaRIxNIw/meBBdGJBamWEB9nTSKFaQtBEZV/mOFkOIVu1TYG
|
31
|
+
k4PRiaAnqs4Cwg==
|
32
|
+
-----END CERTIFICATE-----
|
33
|
+
date: 2014-03-19 00:00:00.000000000 Z
|
14
34
|
dependencies:
|
15
35
|
- !ruby/object:Gem::Dependency
|
16
36
|
name: faraday
|
17
37
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
38
|
requirements:
|
20
|
-
- -
|
39
|
+
- - ">="
|
21
40
|
- !ruby/object:Gem::Version
|
22
41
|
version: '0'
|
23
42
|
type: :runtime
|
24
43
|
prerelease: false
|
25
44
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
45
|
requirements:
|
28
|
-
- -
|
46
|
+
- - ">="
|
29
47
|
- !ruby/object:Gem::Version
|
30
48
|
version: '0'
|
31
49
|
- !ruby/object:Gem::Dependency
|
32
50
|
name: faraday_middleware
|
33
51
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
52
|
requirements:
|
36
|
-
- -
|
53
|
+
- - ">="
|
37
54
|
- !ruby/object:Gem::Version
|
38
55
|
version: '0'
|
39
56
|
type: :runtime
|
40
57
|
prerelease: false
|
41
58
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
59
|
requirements:
|
44
|
-
- -
|
60
|
+
- - ">="
|
45
61
|
- !ruby/object:Gem::Version
|
46
62
|
version: '0'
|
47
63
|
- !ruby/object:Gem::Dependency
|
48
64
|
name: rspec
|
49
65
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
66
|
requirements:
|
52
|
-
- -
|
67
|
+
- - ">="
|
53
68
|
- !ruby/object:Gem::Version
|
54
69
|
version: '0'
|
55
70
|
type: :development
|
56
71
|
prerelease: false
|
57
72
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
73
|
requirements:
|
60
|
-
- -
|
74
|
+
- - ">="
|
61
75
|
- !ruby/object:Gem::Version
|
62
76
|
version: '0'
|
63
77
|
- !ruby/object:Gem::Dependency
|
64
78
|
name: rake
|
65
79
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
80
|
requirements:
|
68
|
-
- -
|
81
|
+
- - ">="
|
69
82
|
- !ruby/object:Gem::Version
|
70
83
|
version: '0'
|
71
84
|
type: :development
|
72
85
|
prerelease: false
|
73
86
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
87
|
requirements:
|
76
|
-
- -
|
88
|
+
- - ">="
|
77
89
|
- !ruby/object:Gem::Version
|
78
90
|
version: '0'
|
79
91
|
- !ruby/object:Gem::Dependency
|
80
92
|
name: json
|
81
93
|
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
94
|
requirements:
|
84
|
-
- -
|
95
|
+
- - ">="
|
85
96
|
- !ruby/object:Gem::Version
|
86
97
|
version: '0'
|
87
98
|
type: :development
|
88
99
|
prerelease: false
|
89
100
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
101
|
requirements:
|
92
|
-
- -
|
102
|
+
- - ">="
|
93
103
|
- !ruby/object:Gem::Version
|
94
104
|
version: '0'
|
95
105
|
description: Ruby client for the Urban Airship Push Notification API
|
@@ -100,9 +110,9 @@ executables: []
|
|
100
110
|
extensions: []
|
101
111
|
extra_rdoc_files: []
|
102
112
|
files:
|
103
|
-
- .gitignore
|
104
|
-
- .travis.yml
|
105
|
-
- .yardopts
|
113
|
+
- ".gitignore"
|
114
|
+
- ".travis.yml"
|
115
|
+
- ".yardopts"
|
106
116
|
- Changelog.md
|
107
117
|
- Gemfile
|
108
118
|
- Guardfile
|
@@ -117,32 +127,31 @@ files:
|
|
117
127
|
- spec/spec_helper.rb
|
118
128
|
- spec/zeppelin_spec.rb
|
119
129
|
- zeppelin.gemspec
|
120
|
-
homepage: https://github.com/
|
121
|
-
licenses:
|
130
|
+
homepage: https://github.com/kern/zeppelin
|
131
|
+
licenses:
|
132
|
+
- MIT
|
133
|
+
metadata: {}
|
122
134
|
post_install_message:
|
123
135
|
rdoc_options: []
|
124
136
|
require_paths:
|
125
137
|
- lib
|
126
138
|
required_ruby_version: !ruby/object:Gem::Requirement
|
127
|
-
none: false
|
128
139
|
requirements:
|
129
|
-
- -
|
140
|
+
- - ">="
|
130
141
|
- !ruby/object:Gem::Version
|
131
142
|
version: '0'
|
132
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
|
-
none: false
|
134
144
|
requirements:
|
135
|
-
- -
|
145
|
+
- - ">="
|
136
146
|
- !ruby/object:Gem::Version
|
137
147
|
version: '0'
|
138
148
|
requirements: []
|
139
149
|
rubyforge_project: zeppelin
|
140
|
-
rubygems_version:
|
150
|
+
rubygems_version: 2.2.2
|
141
151
|
signing_key:
|
142
|
-
specification_version:
|
152
|
+
specification_version: 4
|
143
153
|
summary: Urban Airship library for Ruby
|
144
154
|
test_files:
|
145
155
|
- spec/middleware/response_raise_error_spec.rb
|
146
156
|
- spec/spec_helper.rb
|
147
157
|
- spec/zeppelin_spec.rb
|
148
|
-
has_rdoc:
|
metadata.gz.sig
ADDED
Binary file
|