rapns 3.3.1 → 3.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/README.md +2 -0
- data/lib/generators/templates/add_gcm.rb +3 -4
- data/lib/rapns/daemon/gcm/delivery.rb +3 -3
- data/lib/rapns/version.rb +1 -1
- data/spec/unit_spec_helper.rb +2 -1
- metadata +59 -51
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 3.3.2 (June 30, 2013)
|
2
|
+
* Fix Rails 3.0.x compatibility (#138) (@yoppi).
|
3
|
+
* Ensure Rails does not set a default value for text columns (#137).
|
4
|
+
* Fix error in down action for add_gcm migration (#135) (@alexperto).
|
5
|
+
|
1
6
|
## 3.3.1 (June 2, 2013)
|
2
7
|
* Fix compatibility with postgres_ext (#104).
|
3
8
|
* Add ability to switch the logger (@maxsz).
|
data/README.md
CHANGED
@@ -166,3 +166,5 @@ Thank you to the following wonderful people for contributing:
|
|
166
166
|
* [@maxsz](https://github.com/maxsz)
|
167
167
|
* [@wilg](https://github.com/wilg)
|
168
168
|
* [@perezda](https://github.com/perezda)
|
169
|
+
* [@alexperto](https://github.com/alexperto)
|
170
|
+
* [@yoppi](https://github.com/yoppi)
|
@@ -22,9 +22,9 @@ class AddGcm < ActiveRecord::Migration
|
|
22
22
|
change_column :rapns_notifications, :device_token, :string, { :null => true, :limit => 64 }
|
23
23
|
change_column :rapns_notifications, :expiry, :integer, { :null => true, :default => 1.day.to_i }
|
24
24
|
change_column :rapns_apps, :environment, :string, :null => true
|
25
|
-
change_column :rapns_apps, :certificate, :text, :null => true
|
25
|
+
change_column :rapns_apps, :certificate, :text, :null => true, :default => nil
|
26
26
|
|
27
|
-
change_column :rapns_notifications, :error_description, :text
|
27
|
+
change_column :rapns_notifications, :error_description, :text, :null => true, :default => nil
|
28
28
|
change_column :rapns_notifications, :sound, :string, :default => 'default'
|
29
29
|
|
30
30
|
rename_column :rapns_notifications, :attributes_for_device, :data
|
@@ -65,7 +65,7 @@ class AddGcm < ActiveRecord::Migration
|
|
65
65
|
change_column :rapns_apps, :environment, :string, :null => false
|
66
66
|
change_column :rapns_apps, :certificate, :text, :null => false
|
67
67
|
|
68
|
-
change_column :rapns_notifications, :error_description, :string
|
68
|
+
change_column :rapns_notifications, :error_description, :string, :null => true, :default => nil
|
69
69
|
change_column :rapns_notifications, :sound, :string, :default => '1.aiff'
|
70
70
|
|
71
71
|
rename_column :rapns_notifications, :data, :attributes_for_device
|
@@ -87,7 +87,6 @@ class AddGcm < ActiveRecord::Migration
|
|
87
87
|
Rapns::Notification.update_all(['app = ?', app.key], ['app_id = ?', app.id])
|
88
88
|
end
|
89
89
|
|
90
|
-
change_column :rapns_notifications, :key, :string, :null => false
|
91
90
|
remove_column :rapns_notifications, :app_id
|
92
91
|
|
93
92
|
remove_index :rapns_notifications, :name => "index_rapns_notifications_multi"
|
@@ -62,9 +62,9 @@ module Rapns
|
|
62
62
|
errors[i] = result['error'] if result['error']
|
63
63
|
end
|
64
64
|
|
65
|
-
if body['success'].to_i == 0 && errors.values.all? { |error|
|
65
|
+
if body['success'].to_i == 0 && errors.values.all? { |error| UNAVAILABLE_STATES.include?(error) }
|
66
66
|
all_devices_unavailable(response)
|
67
|
-
elsif errors.values.any? { |error|
|
67
|
+
elsif errors.values.any? { |error| UNAVAILABLE_STATES.include?(error) }
|
68
68
|
some_devices_unavailable(response, errors)
|
69
69
|
else
|
70
70
|
raise Rapns::DeliveryError.new(nil, @notification.id, describe_errors(errors))
|
@@ -106,7 +106,7 @@ module Rapns
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def some_devices_unavailable(response, errors)
|
109
|
-
unavailable_idxs = errors.find_all { |i, error|
|
109
|
+
unavailable_idxs = errors.find_all { |i, error| UNAVAILABLE_STATES.include?(error) }.map(&:first)
|
110
110
|
new_notification = create_new_notification(response, unavailable_idxs)
|
111
111
|
raise Rapns::DeliveryError.new(nil, @notification.id,
|
112
112
|
describe_errors(errors) + " #{unavailable_idxs.join(', ')} will be retried as notification #{new_notification.id}.")
|
data/lib/rapns/version.rb
CHANGED
data/spec/unit_spec_helper.rb
CHANGED
@@ -26,7 +26,8 @@ if ENV['TRAVIS']
|
|
26
26
|
DATABASE_CONFIG[$adapter]['username'] = 'postgres'
|
27
27
|
else
|
28
28
|
require 'etc'
|
29
|
-
|
29
|
+
username = $adapter =~ /mysql/ ? 'root' : Etc.getlogin
|
30
|
+
DATABASE_CONFIG[$adapter]['username'] = username
|
30
31
|
end
|
31
32
|
|
32
33
|
puts "Using #{$adapter} adapter."
|
metadata
CHANGED
@@ -1,56 +1,61 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rapns
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 3
|
8
|
+
- 3
|
9
|
+
- 2
|
10
|
+
version: 3.3.2
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Ian Leitch
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2013-06-30 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: multi_json
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '1.0'
|
22
|
-
type: :runtime
|
23
22
|
prerelease: false
|
24
|
-
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
24
|
none: false
|
26
|
-
requirements:
|
25
|
+
requirements:
|
27
26
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 15
|
29
|
+
segments:
|
30
|
+
- 1
|
31
|
+
- 0
|
32
|
+
version: "1.0"
|
38
33
|
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: net-http-persistent
|
39
37
|
prerelease: false
|
40
|
-
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
39
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id002
|
46
49
|
description: Professional grade APNs and GCM for Ruby
|
47
|
-
email:
|
50
|
+
email:
|
48
51
|
- port001@gmail.com
|
49
|
-
executables:
|
52
|
+
executables:
|
50
53
|
- rapns
|
51
54
|
extensions: []
|
55
|
+
|
52
56
|
extra_rdoc_files: []
|
53
|
-
|
57
|
+
|
58
|
+
files:
|
54
59
|
- CHANGELOG.md
|
55
60
|
- LICENSE
|
56
61
|
- README.md
|
@@ -162,35 +167,38 @@ files:
|
|
162
167
|
- bin/rapns
|
163
168
|
homepage: https://github.com/ileitch/rapns
|
164
169
|
licenses: []
|
170
|
+
|
165
171
|
post_install_message:
|
166
172
|
rdoc_options: []
|
167
|
-
|
173
|
+
|
174
|
+
require_paths:
|
168
175
|
- lib
|
169
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
176
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
170
177
|
none: false
|
171
|
-
requirements:
|
172
|
-
- -
|
173
|
-
- !ruby/object:Gem::Version
|
174
|
-
|
175
|
-
segments:
|
178
|
+
requirements:
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
hash: 3
|
182
|
+
segments:
|
176
183
|
- 0
|
177
|
-
|
178
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
|
+
version: "0"
|
185
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
186
|
none: false
|
180
|
-
requirements:
|
181
|
-
- -
|
182
|
-
- !ruby/object:Gem::Version
|
183
|
-
|
184
|
-
segments:
|
187
|
+
requirements:
|
188
|
+
- - ">="
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
hash: 3
|
191
|
+
segments:
|
185
192
|
- 0
|
186
|
-
|
193
|
+
version: "0"
|
187
194
|
requirements: []
|
195
|
+
|
188
196
|
rubyforge_project:
|
189
|
-
rubygems_version: 1.8.
|
197
|
+
rubygems_version: 1.8.24
|
190
198
|
signing_key:
|
191
199
|
specification_version: 3
|
192
200
|
summary: Professional grade APNs and GCM for Ruby
|
193
|
-
test_files:
|
201
|
+
test_files:
|
194
202
|
- config/database.yml
|
195
203
|
- spec/acceptance/gcm_upgrade_spec.rb
|
196
204
|
- spec/acceptance_spec_helper.rb
|