notifiable-apns-apnotic 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5669eda6c7b3a099220cafea08e92964341cfecd
4
- data.tar.gz: 0e8ada831fdf93677c0b4af28ef25840556fe0c6
2
+ SHA256:
3
+ metadata.gz: 30ee127117cadea3bf299a7172c9e919ce97fbc17141d689b36c3b9e974ba08e
4
+ data.tar.gz: b3d161b342c17fb0a766ca265ebe746d69aa38ea881f0a144c138337ca1bd347
5
5
  SHA512:
6
- metadata.gz: c1eeecadd785ee552d72ba366c7c29e90c10763a069fd184a32cd6e4985ef869fd23c4f083e3151a01e7ccf6deffc18e8c34a700d8afd8ddc7525c8cb4774d24
7
- data.tar.gz: bf2453178483da22d9d0e081ba5f81257e5b6c8436d24512d9f76e13522be7285d237259cbe940192c4a4a04e08834b6ae138a14e4b907323547ffc6b51d4bfd
6
+ metadata.gz: '0888843fb164aded146ab56ab1512014be3012f184d2f0117acf34e3186fe2bbed0cda64bad542ff3a2c100adc69e9b5fd0eb0f2ff18a031827a87e85c2ee5fc'
7
+ data.tar.gz: 6efb82c65c040ca97d7f9f6e6ba705670123131a2ec5061bd30fd3000f4a7afde797faee7ee1f528798eae5bb6c211d64a8d8a56109ec66ff302ae51c1c05359
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
  /db
13
+ /.byebug_history
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- notifiable-apns-apnotic (0.2.2)
4
+ notifiable-apns-apnotic (0.2.3)
5
5
  apnotic (~> 1.4.1)
6
6
  notifiable-core (>= 0.1.3)
7
7
 
@@ -25,8 +25,10 @@ GEM
25
25
  connection_pool (~> 2.0)
26
26
  net-http2 (>= 0.18, < 2)
27
27
  arel (9.0.0)
28
+ byebug (10.0.2)
28
29
  concurrent-ruby (1.0.5)
29
30
  connection_pool (2.2.2)
31
+ database_cleaner (1.7.0)
30
32
  diff-lcs (1.3)
31
33
  factory_bot (4.11.0)
32
34
  activesupport (>= 3.0.0)
@@ -63,6 +65,8 @@ PLATFORMS
63
65
 
64
66
  DEPENDENCIES
65
67
  bundler (~> 1.16)
68
+ byebug
69
+ database_cleaner
66
70
  factory_bot
67
71
  notifiable-apns-apnotic!
68
72
  pg
@@ -22,14 +22,7 @@ module Notifiable
22
22
  apnotic_notification = build_notification(device, notification)
23
23
 
24
24
  push = connection.prepare_push(apnotic_notification)
25
- push.on(:response) do |response|
26
- if response.ok?
27
- processed(device)
28
- else
29
- processed(device, response.status, response.body['reason'])
30
- device.destroy if response.status == '410' || (response.status == '400' && response.body['reason'] == 'BadDeviceToken')
31
- end
32
- end
25
+ push.on(:response) {|response| process_response(response, device) }
33
26
 
34
27
  connection.push_async(push)
35
28
  end
@@ -40,6 +33,15 @@ module Notifiable
40
33
  self.sandbox? ? ::Apnotic::APPLE_DEVELOPMENT_SERVER_URL : ::Apnotic::APPLE_PRODUCTION_SERVER_URL
41
34
  end
42
35
 
36
+ def process_response(response, device)
37
+ if response.ok?
38
+ processed(device)
39
+ else
40
+ processed(device, response.status, response.body['reason'])
41
+ device.destroy if response.status == '410' || (response.status == '400' && ['BadDeviceToken', 'DeviceTokenNotForTopic'].include?(response.body['reason']))
42
+ end
43
+ end
44
+
43
45
  def flush
44
46
  connection.join
45
47
  connection.close
@@ -1,7 +1,7 @@
1
1
  module Notifiable
2
2
  module Apns
3
3
  module Apnotic
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
6
6
  end
7
7
  end
@@ -29,5 +29,8 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency "rspec-mocks"
30
30
  spec.add_development_dependency "pg"
31
31
  spec.add_development_dependency "factory_bot"
32
+ spec.add_development_dependency "byebug"
33
+ spec.add_development_dependency "database_cleaner"
34
+
32
35
 
33
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notifiable-apns-apnotic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brooke-Smith
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-27 00:00:00.000000000 Z
11
+ date: 2018-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: notifiable-core
@@ -122,6 +122,34 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: byebug
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: database_cleaner
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
125
153
  description:
126
154
  email:
127
155
  - matt@futureworkshops.com
@@ -164,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
192
  version: '0'
165
193
  requirements: []
166
194
  rubyforge_project:
167
- rubygems_version: 2.6.14
195
+ rubygems_version: 2.7.3
168
196
  signing_key:
169
197
  specification_version: 4
170
198
  summary: Apnotic APNS connector for Notifiable