houston 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/coverage/index.html +2 -2
- data/lib/houston/client.rb +1 -1
- data/lib/houston/version.rb +1 -1
- data/spec/client_spec.rb +1 -2
- data/spec/notification_spec.rb +15 -2
- metadata +2 -3
- data/houston-2.2.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dd4fa1b395058b3407bdb64aa5d79cc1a98633c
|
4
|
+
data.tar.gz: c5372346f173057ac25105ed33fd632d033a392f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7abc4177818be915fa327204025e769b718325237cd7298f24f5d78655b60ec9e1408c258733f634c8041b2a717df27d30b21a184dc837eca08f0bbbb66d260a
|
7
|
+
data.tar.gz: d7d05b64143c6c5684471e97dd85c62ed570364c87f2dfbbfa5e58ce19d34036bf4e6597f2f527ac57371ad90088005dc5252ff3ef6d8e5781ce14c53183f199
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
![Houston](https://raw.github.com/
|
1
|
+
![Houston](https://raw.github.com/nomad/nomad.github.io/assets/houston-banner.png)
|
2
2
|
|
3
3
|
Push Notifications don't have to be difficult.
|
4
4
|
|
@@ -10,7 +10,7 @@ Another caveat is that Houston doesn't manage device tokens for you. For that, y
|
|
10
10
|
|
11
11
|
> Houston is named for [Houston, TX](http://en.wikipedia.org/wiki/Houston), the metonymical home of [NASA's Johnson Space Center](http://en.wikipedia.org/wiki/Lyndon_B._Johnson_Space_Center), as in _Houston, We Have Liftoff!_.
|
12
12
|
|
13
|
-
> It's part of a series of world-class command-line utilities for iOS development, which includes [Cupertino](https://github.com/mattt/cupertino) (Apple Dev Center management), [Shenzhen](https://github.com/mattt/shenzhen) (Building & Distribution), [Venice](https://github.com/mattt/venice) (In-App Purchase Receipt Verification),
|
13
|
+
> It's part of a series of world-class command-line utilities for iOS development, which includes [Cupertino](https://github.com/mattt/cupertino) (Apple Dev Center management), [Shenzhen](https://github.com/mattt/shenzhen) (Building & Distribution), [Venice](https://github.com/mattt/venice) (In-App Purchase Receipt Verification), [Dubai](https://github.com/mattt/dubai) (Passbook pass generation), and [Nashville](https://github.com/nomad/nashville) (iTunes Store API).
|
14
14
|
|
15
15
|
> This project is also part of a series of open source libraries covering the mission-critical aspects of an iOS app's infrastructure. Be sure to check out its sister projects: [GroundControl](https://github.com/mattt/GroundControl), [SkyLab](https://github.com/mattt/SkyLab), [houston](https://github.com/mattt/houston), and [Orbiter](https://github.com/mattt/Orbiter).
|
16
16
|
|
data/coverage/index.html
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
<img src="./assets/0.8.0/loading.gif" alt="loading"/>
|
15
15
|
</div>
|
16
16
|
<div id="wrapper" style="display:none;">
|
17
|
-
<div class="timestamp">Generated <abbr class="timeago" title="
|
17
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2015-01-18T09:23:41-08:00">2015-01-18T09:23:41-08:00</abbr></div>
|
18
18
|
<ul class="group_tabs"></ul>
|
19
19
|
|
20
20
|
<div id="content">
|
@@ -339,7 +339,7 @@
|
|
339
339
|
<li class="covered" data-hits="13" data-linenumber="30">
|
340
340
|
<span class="hits">13</span>
|
341
341
|
|
342
|
-
<code class="ruby"> @certificate = ENV['APN_CERTIFICATE']</code>
|
342
|
+
<code class="ruby"> @certificate = File.read(ENV['APN_CERTIFICATE']) if ENV['APN_CERTIFICATE']</code>
|
343
343
|
</li>
|
344
344
|
|
345
345
|
<li class="covered" data-hits="13" data-linenumber="31">
|
data/lib/houston/client.rb
CHANGED
@@ -27,7 +27,7 @@ module Houston
|
|
27
27
|
def initialize
|
28
28
|
@gateway_uri = ENV['APN_GATEWAY_URI']
|
29
29
|
@feedback_uri = ENV['APN_FEEDBACK_URI']
|
30
|
-
@certificate = ENV['APN_CERTIFICATE']
|
30
|
+
@certificate = File.read(ENV['APN_CERTIFICATE']) if ENV['APN_CERTIFICATE']
|
31
31
|
@passphrase = ENV['APN_CERTIFICATE_PASSPHRASE']
|
32
32
|
@timeout = Float(ENV['APN_TIMEOUT'] || 0.5)
|
33
33
|
end
|
data/lib/houston/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -39,7 +39,6 @@ describe Houston::Client do
|
|
39
39
|
context 'passing options through ENV' do
|
40
40
|
ENV['APN_GATEWAY_URI'] = "apn://gateway.example.com"
|
41
41
|
ENV['APN_FEEDBACK_URI'] = "apn://feedback.example.com"
|
42
|
-
ENV['APN_CERTIFICATE'] = "path/to/certificate"
|
43
42
|
ENV['APN_CERTIFICATE_PASSPHRASE'] = "passphrase"
|
44
43
|
ENV['APN_TIMEOUT'] = "10.0"
|
45
44
|
|
@@ -59,7 +58,7 @@ describe Houston::Client do
|
|
59
58
|
|
60
59
|
describe '#certificate' do
|
61
60
|
subject { super().certificate }
|
62
|
-
it { should
|
61
|
+
it { should be_nil }
|
63
62
|
end
|
64
63
|
|
65
64
|
describe '#passphrase' do
|
data/spec/notification_spec.rb
CHANGED
@@ -7,6 +7,7 @@ describe Houston::Notification do
|
|
7
7
|
alert: 'Houston, we have a problem.',
|
8
8
|
badge: 2701,
|
9
9
|
sound: 'sosumi.aiff',
|
10
|
+
category: 'INVITE_CATEGORY',
|
10
11
|
expiry: 1234567890,
|
11
12
|
id: 42,
|
12
13
|
priority: 10,
|
@@ -38,6 +39,11 @@ describe Houston::Notification do
|
|
38
39
|
it { should == 'sosumi.aiff' }
|
39
40
|
end
|
40
41
|
|
42
|
+
describe '#category' do
|
43
|
+
subject { super().category }
|
44
|
+
it { should == 'INVITE_CATEGORY' }
|
45
|
+
end
|
46
|
+
|
41
47
|
describe '#expiry' do
|
42
48
|
subject { super().expiry }
|
43
49
|
it { should == 1234567890 }
|
@@ -83,6 +89,7 @@ describe Houston::Notification do
|
|
83
89
|
'alert' => 'Houston, we have a problem.',
|
84
90
|
'badge' => 2701,
|
85
91
|
'sound' => 'sosumi.aiff',
|
92
|
+
'category' => 'INVITE_CATEGORY',
|
86
93
|
'content-available' => 1
|
87
94
|
},
|
88
95
|
'key1' => 1,
|
@@ -116,6 +123,12 @@ describe Houston::Notification do
|
|
116
123
|
})
|
117
124
|
end
|
118
125
|
|
126
|
+
it 'should create a dictionary only with category' do
|
127
|
+
expect(Houston::Notification.new(category: 'INVITE_CATEGORY').payload).to eq({
|
128
|
+
'aps' => { 'category' => 'INVITE_CATEGORY' }
|
129
|
+
})
|
130
|
+
end
|
131
|
+
|
119
132
|
it 'should create a dictionary only with content-available' do
|
120
133
|
expect(Houston::Notification.new(content_available: true).payload).to eq({
|
121
134
|
'aps' => { 'content-available' => 1 }
|
@@ -162,7 +175,7 @@ describe Houston::Notification do
|
|
162
175
|
|
163
176
|
it 'should create a message with correct frame length' do
|
164
177
|
_1, length, _2 = subject.message.unpack('cNa*')
|
165
|
-
expect(length).to eq(
|
178
|
+
expect(length).to eq(211)
|
166
179
|
end
|
167
180
|
|
168
181
|
def parse_items(items_stream)
|
@@ -189,7 +202,7 @@ describe Houston::Notification do
|
|
189
202
|
it 'should include an item #2 with the payload as JSON' do
|
190
203
|
_1, _2, items_stream = subject.message.unpack('cNa*')
|
191
204
|
items = parse_items(items_stream)
|
192
|
-
expect(items).to include([2,
|
205
|
+
expect(items).to include([2, 155, '{"key1":1,"key2":"abc","aps":{"alert":"Houston, we have a problem.","badge":2701,"sound":"sosumi.aiff","category":"INVITE_CATEGORY","content-available":1}}'])
|
193
206
|
end
|
194
207
|
|
195
208
|
it 'should include an item #3 with the identifier' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: houston
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mattt Thompson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|
@@ -155,7 +155,6 @@ files:
|
|
155
155
|
- ./coverage/index.html
|
156
156
|
- ./Gemfile
|
157
157
|
- ./Gemfile.lock
|
158
|
-
- ./houston-2.2.0.gem
|
159
158
|
- ./houston.gemspec
|
160
159
|
- ./lib/houston/client.rb
|
161
160
|
- ./lib/houston/connection.rb
|
data/houston-2.2.0.gem
DELETED
Binary file
|