notifiable-apns-grocer 0.17.1 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +3 -1
- data/config/database.yml +12 -0
- data/lib/notifiable/apns/grocer/stream.rb +1 -1
- data/lib/notifiable/apns/grocer/version.rb +1 -1
- data/notifiable-apns-grocer.gemspec +5 -4
- data/spec/spec_helper.rb +6 -26
- data/spec/stream_spec.rb +1 -1
- metadata +20 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c45cb3080a04382bc2a8fb265af958756eab87a
|
4
|
+
data.tar.gz: 214ca5c37c8b8a8e60bd221c12df1fa98c6a94ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb8060be2c718b39ff1b4d7f379bb3e3e9109c1e1a5e0c97fb7b77849a04fbc2583ff1bbe0c6bfc328b79de9b84d262be4c863c0d6b051473174f10f8b102877
|
7
|
+
data.tar.gz: 6fa533bb624e78feaff4561763d358b6455e2f49f5d557b5007da0abef9975b1547c307d4d7bfacc3e1628b1623d66ac3d3c66348badf29e3d48f532158efc76
|
data/Rakefile
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require 'rspec/core/rake_task'
|
3
|
-
|
3
|
+
|
4
|
+
notifiable_path = Gem::Specification.find_by_name 'notifiable-core'
|
5
|
+
load "#{notifiable_path.gem_dir}/lib/tasks/db.rake"
|
4
6
|
|
5
7
|
namespace :ci do
|
6
8
|
namespace :test do
|
data/config/database.yml
ADDED
@@ -115,7 +115,7 @@ module Notifiable
|
|
115
115
|
device_token = DeviceToken.find_by_token(token)
|
116
116
|
if device_token
|
117
117
|
device_token.destroy if device_token.updated_at < attempt.timestamp
|
118
|
-
|
118
|
+
logger.info("Device #{token} removed at #{attempt.timestamp}")
|
119
119
|
end
|
120
120
|
end
|
121
121
|
end
|
@@ -6,8 +6,8 @@ require 'notifiable/apns/grocer/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "notifiable-apns-grocer"
|
8
8
|
spec.version = Notifiable::Apns::Grocer::VERSION
|
9
|
-
spec.authors = ["
|
10
|
-
spec.email = ["
|
9
|
+
spec.authors = ["Matt Brooke-Smith"]
|
10
|
+
spec.email = ["matt@futureworkshops.com"]
|
11
11
|
spec.homepage = "http://www.futureworkshops.com"
|
12
12
|
spec.description = "Notifiable APNS plugin for Grocer"
|
13
13
|
spec.summary = "Notifiable APNS plugin for Grocer"
|
@@ -18,7 +18,7 @@ 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-
|
21
|
+
spec.add_dependency "notifiable-core", ">= 0.1.2"
|
22
22
|
spec.add_dependency "grocer", '~> 0.7.2'
|
23
23
|
spec.add_dependency "connection_pool", '~> 2.0.0'
|
24
24
|
|
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency "simplecov-rcov"
|
30
30
|
spec.add_development_dependency "sqlite3"
|
31
31
|
spec.add_development_dependency "database_cleaner"
|
32
|
-
spec.add_development_dependency
|
32
|
+
spec.add_development_dependency "byebug"
|
33
|
+
spec.add_development_dependency "pg"
|
33
34
|
|
34
35
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
ENV['RAILS_ENV'] ||= 'test'
|
2
|
-
|
3
1
|
require 'simplecov'
|
4
2
|
require 'simplecov-rcov'
|
5
3
|
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
|
@@ -10,39 +8,24 @@ end
|
|
10
8
|
require 'timeout'
|
11
9
|
require 'database_cleaner'
|
12
10
|
require 'active_record'
|
13
|
-
require 'rails'
|
14
11
|
require 'notifiable'
|
12
|
+
require 'notifiable/apns/grocer'
|
15
13
|
require 'grocer'
|
16
|
-
require
|
17
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
18
|
-
|
19
|
-
db_path = 'spec/test.sqlite3'
|
20
|
-
DatabaseCleaner.strategy = :truncation
|
14
|
+
require 'byebug'
|
21
15
|
|
22
|
-
|
16
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
23
17
|
|
24
|
-
|
18
|
+
# Setup ActiveRecord db connection
|
19
|
+
ActiveRecord::Base.establish_connection(YAML.load_file('config/database.yml')['test'])
|
25
20
|
|
26
21
|
RSpec.configure do |config|
|
27
22
|
config.mock_with :rspec
|
28
23
|
config.order = "random"
|
29
24
|
|
30
25
|
config.before(:all) {
|
26
|
+
DatabaseCleaner.strategy = :truncation
|
31
27
|
Notifiable.notifier_classes[:apns] = Notifiable::Apns::Grocer::Stream
|
32
28
|
Notifiable::App.define_configuration_accessors(Notifiable.notifier_classes)
|
33
|
-
|
34
|
-
# DB setup
|
35
|
-
ActiveRecord::Base.establish_connection(
|
36
|
-
{ :adapter => 'sqlite3',
|
37
|
-
:database => db_path,
|
38
|
-
:pool => 5,
|
39
|
-
:timeout => 5000}
|
40
|
-
)
|
41
|
-
|
42
|
-
ActiveRecord::Migration.verbose = false
|
43
|
-
notifiable_rails_path = Gem.loaded_specs['notifiable-rails'].full_gem_path
|
44
|
-
|
45
|
-
ActiveRecord::MigrationContext.new(File.join(notifiable_rails_path, 'db', 'migrate')).migrate
|
46
29
|
|
47
30
|
@grocer = Grocer.server(port: 2195)
|
48
31
|
@grocer.accept
|
@@ -59,8 +42,5 @@ RSpec.configure do |config|
|
|
59
42
|
|
60
43
|
config.after(:all) {
|
61
44
|
@grocer.close
|
62
|
-
|
63
|
-
# drop the database
|
64
|
-
File.delete(db_path)
|
65
45
|
}
|
66
46
|
end
|
data/spec/stream_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Notifiable::Apns::Grocer::Stream do
|
4
4
|
|
5
|
-
subject { Notifiable::Apns::Grocer::Stream.new(
|
5
|
+
subject { Notifiable::Apns::Grocer::Stream.new(n1) }
|
6
6
|
let(:a1) { Notifiable::App.create! name: "Drum Cussac" }
|
7
7
|
let(:n1) { Notifiable::Notification.create! app: a1 }
|
8
8
|
|
metadata
CHANGED
@@ -1,30 +1,29 @@
|
|
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.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Kamil Kocemba
|
8
7
|
- Matt Brooke-Smith
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-26 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
|
-
name: notifiable-
|
14
|
+
name: notifiable-core
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
16
|
requirements:
|
18
17
|
- - ">="
|
19
18
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
19
|
+
version: 0.1.2
|
21
20
|
type: :runtime
|
22
21
|
prerelease: false
|
23
22
|
version_requirements: !ruby/object:Gem::Requirement
|
24
23
|
requirements:
|
25
24
|
- - ">="
|
26
25
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
26
|
+
version: 0.1.2
|
28
27
|
- !ruby/object:Gem::Dependency
|
29
28
|
name: grocer
|
30
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,9 +164,22 @@ dependencies:
|
|
165
164
|
- - ">="
|
166
165
|
- !ruby/object:Gem::Version
|
167
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: pg
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
168
181
|
description: Notifiable APNS plugin for Grocer
|
169
182
|
email:
|
170
|
-
- kamil@futureworkshops.com
|
171
183
|
- matt@futureworkshops.com
|
172
184
|
executables: []
|
173
185
|
extensions: []
|
@@ -180,6 +192,7 @@ files:
|
|
180
192
|
- LICENSE.txt
|
181
193
|
- README.md
|
182
194
|
- Rakefile
|
195
|
+
- config/database.yml
|
183
196
|
- lib/notifiable/apns/grocer.rb
|
184
197
|
- lib/notifiable/apns/grocer/grocer_ssl_connection.rb
|
185
198
|
- lib/notifiable/apns/grocer/stream.rb
|