houston 2.2.4 → 2.4.0
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 +4 -4
- data/Gemfile.lock +24 -27
- data/README.md +36 -14
- data/bin/apn +2 -2
- data/coverage/assets/0.7.1/application.css +1110 -0
- data/coverage/assets/0.7.1/application.js +626 -0
- data/coverage/assets/0.7.1/fancybox/blank.gif +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_close.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_loading.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_nav_left.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_nav_right.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_title_left.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_title_main.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_title_over.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancy_title_right.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancybox-x.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancybox-y.png +0 -0
- data/coverage/assets/0.7.1/fancybox/fancybox.png +0 -0
- data/coverage/assets/{0.10.0 → 0.8.0}/application.js +931 -1079
- data/coverage/assets/0.8.0/favicon_green.png +0 -0
- data/coverage/assets/0.8.0/favicon_red.png +0 -0
- data/coverage/assets/0.8.0/favicon_yellow.png +0 -0
- data/coverage/assets/0.8.0/loading.gif +0 -0
- data/coverage/assets/0.8.0/magnify.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/coverage/assets/0.8.0/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coverage/index.html +184 -296
- data/houston-2.2.2.gem +0 -0
- data/houston-2.2.3.gem +0 -0
- data/lib/houston/client.rb +2 -2
- data/lib/houston/connection.rb +2 -2
- data/lib/houston/notification.rb +8 -1
- data/lib/houston/version.rb +1 -1
- data/spec/notification_spec.rb +26 -5
- metadata +69 -27
- /data/coverage/assets/{0.10.0 → 0.7.1}/favicon_green.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/favicon_red.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/favicon_yellow.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/loading.gif +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/magnify.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/smoothness/images/ui-icons_222222_256x240.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/smoothness/images/ui-icons_454545_256x240.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/smoothness/images/ui-icons_888888_256x240.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.7.1}/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.8.0}/application.css +0 -0
- /data/coverage/assets/{0.10.0 → 0.8.0}/colorbox/border.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.8.0}/colorbox/controls.png +0 -0
- /data/coverage/assets/{0.10.0 → 0.8.0}/colorbox/loading.gif +0 -0
- /data/coverage/assets/{0.10.0 → 0.8.0}/colorbox/loading_background.png +0 -0
data/houston-2.2.2.gem
ADDED
Binary file
|
data/houston-2.2.3.gem
ADDED
Binary file
|
data/lib/houston/client.rb
CHANGED
@@ -50,10 +50,10 @@ module Houston
|
|
50
50
|
connection.write(notification.message)
|
51
51
|
notification.mark_as_sent!
|
52
52
|
|
53
|
-
read_socket,
|
53
|
+
read_socket, _write_socket = IO.select([ssl], [ssl], [ssl], nil)
|
54
54
|
if (read_socket && read_socket[0])
|
55
55
|
if error = connection.read(6)
|
56
|
-
|
56
|
+
_command, status, index = error.unpack('ccN')
|
57
57
|
notification.apns_error_code = status
|
58
58
|
notification.mark_as_unsent!
|
59
59
|
end
|
data/lib/houston/connection.rb
CHANGED
data/lib/houston/notification.rb
CHANGED
@@ -30,7 +30,7 @@ module Houston
|
|
30
30
|
MAXIMUM_PAYLOAD_SIZE = 2048
|
31
31
|
|
32
32
|
attr_accessor :token, :alert, :badge, :sound, :category, :content_available, :mutable_content,
|
33
|
-
:custom_data, :id, :expiry, :priority
|
33
|
+
:custom_data, :id, :expiry, :priority, :url_args, :thread_id
|
34
34
|
attr_reader :sent_at
|
35
35
|
attr_writer :apns_error_code
|
36
36
|
|
@@ -48,8 +48,13 @@ module Houston
|
|
48
48
|
@priority = options.delete(:priority)
|
49
49
|
@content_available = options.delete(:content_available)
|
50
50
|
@mutable_content = options.delete(:mutable_content)
|
51
|
+
@url_args = options.delete(:url_args)
|
52
|
+
@thread_id = options.delete(:thread_id)
|
51
53
|
|
52
54
|
@custom_data = options
|
55
|
+
|
56
|
+
@sent_at = nil
|
57
|
+
@apns_error_code = nil
|
53
58
|
end
|
54
59
|
|
55
60
|
def payload
|
@@ -62,6 +67,8 @@ module Houston
|
|
62
67
|
json['aps']['category'] = @category if @category
|
63
68
|
json['aps']['content-available'] = 1 if @content_available
|
64
69
|
json['aps']['mutable-content'] = 1 if @mutable_content
|
70
|
+
json['aps']['url-args'] = @url_args if @url_args
|
71
|
+
json['aps']['thread-id'] = @thread_id if @thread_id
|
65
72
|
|
66
73
|
json
|
67
74
|
end
|
data/lib/houston/version.rb
CHANGED
data/spec/notification_spec.rb
CHANGED
@@ -13,7 +13,9 @@ describe Houston::Notification do
|
|
13
13
|
priority: 10,
|
14
14
|
content_available: true,
|
15
15
|
key1: 1,
|
16
|
-
key2: 'abc'
|
16
|
+
key2: 'abc',
|
17
|
+
url_args: %w[boarding A998],
|
18
|
+
thread_id: 'notify-team-ios'
|
17
19
|
}
|
18
20
|
}
|
19
21
|
|
@@ -69,6 +71,16 @@ describe Houston::Notification do
|
|
69
71
|
it { should == { key1: 1, key2: 'abc' } }
|
70
72
|
end
|
71
73
|
|
74
|
+
describe '#url_args' do
|
75
|
+
subject { super().url_args }
|
76
|
+
it { should == %w[boarding A998] }
|
77
|
+
end
|
78
|
+
|
79
|
+
describe '#thread_id' do
|
80
|
+
subject { super().thread_id }
|
81
|
+
it { should == 'notify-team-ios' }
|
82
|
+
end
|
83
|
+
|
72
84
|
context 'using :device instead of :token' do
|
73
85
|
subject do
|
74
86
|
notification_options[:device] = notification_options[:token]
|
@@ -84,12 +96,15 @@ describe Houston::Notification do
|
|
84
96
|
|
85
97
|
describe '#payload' do
|
86
98
|
it 'should create a compliant dictionary' do
|
87
|
-
expect(subject.payload).to eq(
|
99
|
+
expect(subject.payload).to eq(
|
100
|
+
'aps' => {
|
88
101
|
'alert' => 'Houston, we have a problem.',
|
89
102
|
'badge' => 2701,
|
90
103
|
'sound' => 'sosumi.aiff',
|
91
104
|
'category' => 'INVITE_CATEGORY',
|
92
|
-
'content-available' => 1
|
105
|
+
'content-available' => 1,
|
106
|
+
'url-args' => %w[boarding A998],
|
107
|
+
'thread-id' => 'notify-team-ios'
|
93
108
|
},
|
94
109
|
'key1' => 1,
|
95
110
|
'key2' => 'abc')
|
@@ -139,6 +154,12 @@ describe Houston::Notification do
|
|
139
154
|
)
|
140
155
|
end
|
141
156
|
|
157
|
+
it 'should create a dictionary only with thread-id' do
|
158
|
+
expect(Houston::Notification.new(thread_id: 'notify-ios-team').payload).to eq(
|
159
|
+
'aps' => { 'thread-id' => 'notify-ios-team' }
|
160
|
+
)
|
161
|
+
end
|
162
|
+
|
142
163
|
it 'should allow custom data inside aps key' do
|
143
164
|
notification_options = { :badge => 567, 'aps' => { 'loc-key' => 'my-key' } }
|
144
165
|
expect(Houston::Notification.new(notification_options).payload).to eq(
|
@@ -179,7 +200,7 @@ describe Houston::Notification do
|
|
179
200
|
|
180
201
|
it 'should create a message with correct frame length' do
|
181
202
|
_1, length, _2 = subject.message.unpack('cNa*')
|
182
|
-
expect(length).to eq(
|
203
|
+
expect(length).to eq(272)
|
183
204
|
end
|
184
205
|
|
185
206
|
def parse_items(items_stream)
|
@@ -206,7 +227,7 @@ describe Houston::Notification do
|
|
206
227
|
it 'should include an item #2 with the payload as JSON' do
|
207
228
|
_1, _2, items_stream = subject.message.unpack('cNa*')
|
208
229
|
items = parse_items(items_stream)
|
209
|
-
expect(items).to include([2,
|
230
|
+
expect(items).to include([2, 216, '{"key1":1,"key2":"abc","aps":{"alert":"Houston, we have a problem.","badge":2701,"sound":"sosumi.aiff","category":"INVITE_CATEGORY","content-available":1,"url-args":["boarding","A998"],"thread-id":"notify-team-ios"}}'])
|
210
231
|
end
|
211
232
|
|
212
233
|
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.
|
4
|
+
version: 2.4.0
|
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: 2018-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|
@@ -93,31 +93,73 @@ files:
|
|
93
93
|
- "./LICENSE"
|
94
94
|
- "./README.md"
|
95
95
|
- "./Rakefile"
|
96
|
-
- "./coverage/assets/0.
|
97
|
-
- "./coverage/assets/0.
|
98
|
-
- "./coverage/assets/0.
|
99
|
-
- "./coverage/assets/0.
|
100
|
-
- "./coverage/assets/0.
|
101
|
-
- "./coverage/assets/0.
|
102
|
-
- "./coverage/assets/0.
|
103
|
-
- "./coverage/assets/0.
|
104
|
-
- "./coverage/assets/0.
|
105
|
-
- "./coverage/assets/0.
|
106
|
-
- "./coverage/assets/0.
|
107
|
-
- "./coverage/assets/0.
|
108
|
-
- "./coverage/assets/0.
|
109
|
-
- "./coverage/assets/0.
|
110
|
-
- "./coverage/assets/0.
|
111
|
-
- "./coverage/assets/0.
|
112
|
-
- "./coverage/assets/0.
|
113
|
-
- "./coverage/assets/0.
|
114
|
-
- "./coverage/assets/0.
|
115
|
-
- "./coverage/assets/0.
|
116
|
-
- "./coverage/assets/0.
|
117
|
-
- "./coverage/assets/0.
|
118
|
-
- "./coverage/assets/0.
|
119
|
-
- "./coverage/assets/0.
|
96
|
+
- "./coverage/assets/0.7.1/application.css"
|
97
|
+
- "./coverage/assets/0.7.1/application.js"
|
98
|
+
- "./coverage/assets/0.7.1/fancybox/blank.gif"
|
99
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_close.png"
|
100
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_loading.png"
|
101
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_nav_left.png"
|
102
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_nav_right.png"
|
103
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_shadow_e.png"
|
104
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_shadow_n.png"
|
105
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png"
|
106
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png"
|
107
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_shadow_s.png"
|
108
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_shadow_se.png"
|
109
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png"
|
110
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_shadow_w.png"
|
111
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_title_left.png"
|
112
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_title_main.png"
|
113
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_title_over.png"
|
114
|
+
- "./coverage/assets/0.7.1/fancybox/fancy_title_right.png"
|
115
|
+
- "./coverage/assets/0.7.1/fancybox/fancybox-x.png"
|
116
|
+
- "./coverage/assets/0.7.1/fancybox/fancybox-y.png"
|
117
|
+
- "./coverage/assets/0.7.1/fancybox/fancybox.png"
|
118
|
+
- "./coverage/assets/0.7.1/favicon_green.png"
|
119
|
+
- "./coverage/assets/0.7.1/favicon_red.png"
|
120
|
+
- "./coverage/assets/0.7.1/favicon_yellow.png"
|
121
|
+
- "./coverage/assets/0.7.1/loading.gif"
|
122
|
+
- "./coverage/assets/0.7.1/magnify.png"
|
123
|
+
- "./coverage/assets/0.7.1/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png"
|
124
|
+
- "./coverage/assets/0.7.1/smoothness/images/ui-bg_flat_75_ffffff_40x100.png"
|
125
|
+
- "./coverage/assets/0.7.1/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png"
|
126
|
+
- "./coverage/assets/0.7.1/smoothness/images/ui-bg_glass_65_ffffff_1x400.png"
|
127
|
+
- "./coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_dadada_1x400.png"
|
128
|
+
- "./coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png"
|
129
|
+
- "./coverage/assets/0.7.1/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png"
|
130
|
+
- "./coverage/assets/0.7.1/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png"
|
131
|
+
- "./coverage/assets/0.7.1/smoothness/images/ui-icons_222222_256x240.png"
|
132
|
+
- "./coverage/assets/0.7.1/smoothness/images/ui-icons_2e83ff_256x240.png"
|
133
|
+
- "./coverage/assets/0.7.1/smoothness/images/ui-icons_454545_256x240.png"
|
134
|
+
- "./coverage/assets/0.7.1/smoothness/images/ui-icons_888888_256x240.png"
|
135
|
+
- "./coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png"
|
136
|
+
- "./coverage/assets/0.8.0/application.css"
|
137
|
+
- "./coverage/assets/0.8.0/application.js"
|
138
|
+
- "./coverage/assets/0.8.0/colorbox/border.png"
|
139
|
+
- "./coverage/assets/0.8.0/colorbox/controls.png"
|
140
|
+
- "./coverage/assets/0.8.0/colorbox/loading.gif"
|
141
|
+
- "./coverage/assets/0.8.0/colorbox/loading_background.png"
|
142
|
+
- "./coverage/assets/0.8.0/favicon_green.png"
|
143
|
+
- "./coverage/assets/0.8.0/favicon_red.png"
|
144
|
+
- "./coverage/assets/0.8.0/favicon_yellow.png"
|
145
|
+
- "./coverage/assets/0.8.0/loading.gif"
|
146
|
+
- "./coverage/assets/0.8.0/magnify.png"
|
147
|
+
- "./coverage/assets/0.8.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png"
|
148
|
+
- "./coverage/assets/0.8.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png"
|
149
|
+
- "./coverage/assets/0.8.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png"
|
150
|
+
- "./coverage/assets/0.8.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png"
|
151
|
+
- "./coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png"
|
152
|
+
- "./coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png"
|
153
|
+
- "./coverage/assets/0.8.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png"
|
154
|
+
- "./coverage/assets/0.8.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png"
|
155
|
+
- "./coverage/assets/0.8.0/smoothness/images/ui-icons_222222_256x240.png"
|
156
|
+
- "./coverage/assets/0.8.0/smoothness/images/ui-icons_2e83ff_256x240.png"
|
157
|
+
- "./coverage/assets/0.8.0/smoothness/images/ui-icons_454545_256x240.png"
|
158
|
+
- "./coverage/assets/0.8.0/smoothness/images/ui-icons_888888_256x240.png"
|
159
|
+
- "./coverage/assets/0.8.0/smoothness/images/ui-icons_cd0a0a_256x240.png"
|
120
160
|
- "./coverage/index.html"
|
161
|
+
- "./houston-2.2.2.gem"
|
162
|
+
- "./houston-2.2.3.gem"
|
121
163
|
- "./houston.gemspec"
|
122
164
|
- "./lib/houston.rb"
|
123
165
|
- "./lib/houston/client.rb"
|
@@ -148,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
190
|
version: '0'
|
149
191
|
requirements: []
|
150
192
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.6.
|
193
|
+
rubygems_version: 2.6.14
|
152
194
|
signing_key:
|
153
195
|
specification_version: 4
|
154
196
|
summary: Send Apple Push Notifications
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/data/coverage/assets/{0.10.0 → 0.7.1}/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|