notifiable-apns-grocer 0.12.2 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +1 -27
- data/lib/notifiable/apns/grocer/stream.rb +7 -5
- data/lib/notifiable/apns/grocer/version.rb +1 -1
- data/lib/notifiable/apns/grocer.rb +1 -3
- data/notifiable-apns-grocer.gemspec +4 -4
- data/spec/spec_helper.rb +4 -0
- data/spec/stream_spec.rb +8 -8
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ede6dedfe7e69539c8a801a6f77222a70c66b619
|
4
|
+
data.tar.gz: 938f7d8314bc277c82fbb5511fbe1696ffbf28f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad80166bb9fb3ab60a2d81b518a9355d710e6bdf5ebfb0d8c00d76974a279ac9e8d53becc01e9975050ba1b90ca6c38f70a610e88ba397c8667a5d020ab3457d
|
7
|
+
data.tar.gz: 59a60a1b7bd225dcda5fe8aa4854b10671d5014e8d8d3e2d444866b00368c31bf2c8e0204ea6214bc6148fa7434f030bfb4dec931c299154d6937ab3fb1e573c
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,29 +1,3 @@
|
|
1
1
|
# Notifiable::Apns::Grocer
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
gem 'notifiable-apns-grocer'
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself as:
|
16
|
-
|
17
|
-
$ gem install notifiable-apns-grocer
|
18
|
-
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
TODO: Write usage instructions here
|
22
|
-
|
23
|
-
## Contributing
|
24
|
-
|
25
|
-
1. Fork it
|
26
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
-
5. Create new Pull Request
|
3
|
+
Please refer to the [notifiable-rails](https://github.com/FutureWorkshops/notifiable-rails) Readme for further information.
|
@@ -7,7 +7,9 @@ module Notifiable
|
|
7
7
|
module Grocer
|
8
8
|
class Stream < Notifiable::NotifierBase
|
9
9
|
|
10
|
-
|
10
|
+
notifier_attribute :certificate, :passphrase, :connection_pool_size, :connection_pool_timeout, :gateway_host, :gateway_port, :feedback_host, :feedback_port
|
11
|
+
|
12
|
+
attr_reader :certificate, :passphrase
|
11
13
|
|
12
14
|
def gateway_host
|
13
15
|
@gateway_host || "gateway.push.apple.com"
|
@@ -31,7 +33,7 @@ module Notifiable
|
|
31
33
|
|
32
34
|
def connection_pool_timeout
|
33
35
|
@connection_pool_timeout || 10
|
34
|
-
end
|
36
|
+
end
|
35
37
|
|
36
38
|
def close
|
37
39
|
super
|
@@ -78,9 +80,9 @@ module Notifiable
|
|
78
80
|
def feedback_config
|
79
81
|
{
|
80
82
|
certificate: certificate,
|
81
|
-
passphrase:
|
82
|
-
gateway:
|
83
|
-
port:
|
83
|
+
passphrase: passphrase,
|
84
|
+
gateway: feedback_host,
|
85
|
+
port: feedback_port,
|
84
86
|
retries: 3
|
85
87
|
}
|
86
88
|
end
|
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Kamil Kocemba", "Matt Brooke-Smith"]
|
10
10
|
spec.email = ["kamil@futureworkshops.com", "matt@futureworkshops.com"]
|
11
11
|
spec.homepage = "http://www.futureworkshops.com"
|
12
|
-
spec.description = "
|
13
|
-
spec.summary = "
|
12
|
+
spec.description = "Notifiable APNS plugin for Grocer"
|
13
|
+
spec.summary = "Notifiable APNS plugin for Grocer"
|
14
14
|
spec.license = "Apache 2.0"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "notifiable-rails", ">=0.
|
22
|
-
spec.add_dependency "grocer", '~> 0.
|
21
|
+
spec.add_dependency "notifiable-rails", ">=0.24.1"
|
22
|
+
spec.add_dependency "grocer", '~> 0.6.1'
|
23
23
|
spec.add_dependency "connection_pool", '~> 2.0.0'
|
24
24
|
|
25
25
|
spec.add_development_dependency "bundler", "~> 1.3"
|
data/spec/spec_helper.rb
CHANGED
@@ -21,11 +21,15 @@ DatabaseCleaner.strategy = :truncation
|
|
21
21
|
|
22
22
|
Rails.logger = Logger.new(STDOUT)
|
23
23
|
|
24
|
+
require 'byebug'
|
25
|
+
|
24
26
|
RSpec.configure do |config|
|
25
27
|
config.mock_with :rspec
|
26
28
|
config.order = "random"
|
27
29
|
|
28
30
|
config.before(:all) {
|
31
|
+
Notifiable.notifier_classes[:apns] = Notifiable::Apns::Grocer::Stream
|
32
|
+
Notifiable::App.define_configuration_accessors(Notifiable.notifier_classes)
|
29
33
|
|
30
34
|
# DB setup
|
31
35
|
ActiveRecord::Base.establish_connection(
|
data/spec/stream_spec.rb
CHANGED
@@ -4,16 +4,16 @@ describe Notifiable::Apns::Grocer::Stream do
|
|
4
4
|
|
5
5
|
let(:a) { Notifiable::App.create }
|
6
6
|
let(:n1) { Notifiable::Notification.create(:app => a) }
|
7
|
-
let!(:ln) { Notifiable::LocalizedNotification.create(:message => "Test message", :params => {:flag => true}, :notification => n1, :locale =>
|
8
|
-
let(:d) { Notifiable::DeviceToken.create(:token => "ABC123", :provider => :apns, :app => a, :locale =>
|
7
|
+
let!(:ln) { Notifiable::LocalizedNotification.create(:message => "Test message", :params => {:flag => true}, :notification => n1, :locale => 'en') }
|
8
|
+
let(:d) { Notifiable::DeviceToken.create(:token => "ABC123", :provider => :apns, :app => a, :locale => 'en') }
|
9
9
|
|
10
10
|
before(:each) do
|
11
|
-
a.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
a.apns_gateway_host = "localhost"
|
12
|
+
a.apns_gateway_port = 2195
|
13
|
+
a.apns_feedback_host = "localhost"
|
14
|
+
a.apns_feedback_port = 2196
|
15
|
+
a.apns_certificate = File.join(File.dirname(__FILE__), "fixtures", "apns-development.pem")
|
16
|
+
a.save_notification_statuses = true
|
17
17
|
end
|
18
18
|
|
19
19
|
it "sends a single notification" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notifiable-apns-grocer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kamil Kocemba
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-03-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: notifiable-rails
|
@@ -17,28 +17,28 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
20
|
+
version: 0.24.1
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
27
|
+
version: 0.24.1
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: grocer
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 0.
|
34
|
+
version: 0.6.1
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 0.
|
41
|
+
version: 0.6.1
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: connection_pool
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,7 +179,7 @@ dependencies:
|
|
179
179
|
- - ">="
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
|
-
description:
|
182
|
+
description: Notifiable APNS plugin for Grocer
|
183
183
|
email:
|
184
184
|
- kamil@futureworkshops.com
|
185
185
|
- matt@futureworkshops.com
|
@@ -232,7 +232,7 @@ rubyforge_project:
|
|
232
232
|
rubygems_version: 2.4.3
|
233
233
|
signing_key:
|
234
234
|
specification_version: 4
|
235
|
-
summary:
|
235
|
+
summary: Notifiable APNS plugin for Grocer
|
236
236
|
test_files:
|
237
237
|
- spec/fixtures/apns-development.pem
|
238
238
|
- spec/spec_helper.rb
|