push_kit-apns 1.0.0.pre.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +46 -0
- data/.rspec +2 -0
- data/.rubocop.yml +21 -0
- data/Gemfile +5 -0
- data/Guardfile +17 -0
- data/README.md +118 -0
- data/Rakefile +8 -0
- data/bin/console +7 -0
- data/bin/setup +6 -0
- data/lib/push_kit/apns.rb +65 -0
- data/lib/push_kit/apns/constants.rb +9 -0
- data/lib/push_kit/apns/http_client.rb +277 -0
- data/lib/push_kit/apns/notification.rb +257 -0
- data/lib/push_kit/apns/notification/localization.rb +61 -0
- data/lib/push_kit/apns/push_client.rb +207 -0
- data/lib/push_kit/apns/token_generator.rb +97 -0
- data/push_kit.gemspec +33 -0
- data/spec/push_kit/apns/constants_spec.rb +9 -0
- data/spec/push_kit/apns/notification/localization_spec.rb +89 -0
- data/spec/push_kit/apns/notification_spec.rb +264 -0
- data/spec/spec_helper.rb +85 -0
- data/spec/support/have_accessor.rb +19 -0
- metadata +189 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# NOTE: Do we need this?
|
4
|
+
# $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
|
5
|
+
|
6
|
+
# Conventionally, all specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
7
|
+
# The `.rspec` file contains `--require spec_helper` which will cause this file to always be loaded,
|
8
|
+
# without a need to explicitly require it in any files.
|
9
|
+
#
|
10
|
+
# Given that it is always loaded, you are encouraged to keep this file as light-weight as possible.
|
11
|
+
# Requiring heavyweight dependencies from this file will add to the boot time of your test suite on EVERY test run,
|
12
|
+
# even for an individual file that may not need all of that loaded. Instead, consider making a separate helper file
|
13
|
+
# that requires the additional dependencies and performs the additional setup, and require it from the spec files
|
14
|
+
# that actually need it.
|
15
|
+
#
|
16
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
17
|
+
|
18
|
+
RSpec.configure do |config|
|
19
|
+
# rspec-expectations config goes here. You can use an alternate assertion/expectation library such as wrong or the
|
20
|
+
# stdlib/minitest assertions if you prefer.
|
21
|
+
config.expect_with :rspec do |expectations|
|
22
|
+
# This option will default to `true` in RSpec 4.
|
23
|
+
# It makes the `description` and `failure_message` of custom matchers include text for helper methods defined using
|
24
|
+
# `chain`, e.g.:
|
25
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
26
|
+
# # => "be bigger than 2 and smaller than 4"
|
27
|
+
# ...rather than:
|
28
|
+
# # => "be bigger than 2"
|
29
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
30
|
+
end
|
31
|
+
|
32
|
+
# rspec-mocks config goes here. You can use an alternate test double library (such as bogus or mocha) by changing the
|
33
|
+
# `mock_with` option here.
|
34
|
+
config.mock_with :rspec do |mocks|
|
35
|
+
# Prevents you from mocking or stubbing a method that does not exist on a real object.
|
36
|
+
# This is generally recommended, and will default to `true` in RSpec 4.
|
37
|
+
mocks.verify_partial_doubles = true
|
38
|
+
end
|
39
|
+
|
40
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will have no way to turn it off -- the option
|
41
|
+
# exists only for backwards compatibility in RSpec 3).
|
42
|
+
# It causes shared context metadata to be inherited by the metadata hash of host groups and examples, rather than
|
43
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
44
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
45
|
+
|
46
|
+
# This allows you to limit a spec run to individual examples or groups you care about by tagging them with `:focus`
|
47
|
+
# metadata. When nothing is tagged with `:focus`, all examples get run.
|
48
|
+
# RSpec also provides aliases for `it`, `describe`, and `context` that include `:focus` metadata: `fit`, `fdescribe`
|
49
|
+
# and `fcontext`, respectively.
|
50
|
+
config.filter_run_when_matching :focus
|
51
|
+
|
52
|
+
# Allows RSpec to persist some state between runs in order to support the `--only-failures` and `--next-failure` CLI
|
53
|
+
# options. We recommend you configure your source control system to ignore this file.
|
54
|
+
config.example_status_persistence_file_path = 'spec/examples.txt'
|
55
|
+
|
56
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended. For more details, see:
|
57
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
58
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
59
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
60
|
+
config.disable_monkey_patching!
|
61
|
+
|
62
|
+
# Many RSpec users commonly either run the entire suite or an individual file, and it's useful to allow more verbose
|
63
|
+
# output when running an individual spec file.
|
64
|
+
if config.files_to_run.one?
|
65
|
+
# Use the documentation formatter for detailed output, unless a formatter has already been configured (e.g. via a
|
66
|
+
# command-line flag).
|
67
|
+
config.default_formatter = 'doc'
|
68
|
+
end
|
69
|
+
|
70
|
+
# Print the 10 slowest examples and example groups at the end of the spec run, to help surface which specs are running
|
71
|
+
# particularly slow.
|
72
|
+
# config.profile_examples = 10
|
73
|
+
|
74
|
+
# Run specs in random order to surface order dependencies. If you find an order dependency and want to debug it, you
|
75
|
+
# can fix the order by providing the seed, which is printed after each run.
|
76
|
+
# --seed 1234
|
77
|
+
config.order = :random
|
78
|
+
|
79
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
80
|
+
# Setting this allows you to use `--seed` to deterministically reproduce test failures related to randomization by
|
81
|
+
# passing the same `--seed` value as the one that triggered the failure.
|
82
|
+
Kernel.srand config.seed
|
83
|
+
end
|
84
|
+
|
85
|
+
Dir[File.expand_path('support/**/*.rb', __dir__)].each { |path| require(path) }
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec::Matchers.define(:have_accessor) do |field|
|
4
|
+
match do |object|
|
5
|
+
object.respond_to?(field) && object.respond_to?("#{field}=")
|
6
|
+
end
|
7
|
+
|
8
|
+
description do
|
9
|
+
"have a reader and writer for ##{field}"
|
10
|
+
end
|
11
|
+
|
12
|
+
failure_message do |object|
|
13
|
+
"expected #{object.inspect} to respond to `:#{field}` and `:#{field}=`"
|
14
|
+
end
|
15
|
+
|
16
|
+
failure_message_when_negated do |object|
|
17
|
+
"expected #{object.inspect} not to respond to `:#{field}` or `:#{field}=`"
|
18
|
+
end
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,189 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: push_kit-apns
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0.pre.beta1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nialto Services
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-08-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: concurrent-ruby
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.1'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.1.5
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.1'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.1.5
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: http-2
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 0.10.1
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.10.1
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: jwt
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '2.2'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '2.2'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: bundler
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '2.0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '2.0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: guard-rspec
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '4.7'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '4.7'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rake
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '12.3'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '12.3'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: rspec
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '3.8'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '3.8'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: yard
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 0.9.20
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: 0.9.20
|
131
|
+
description:
|
132
|
+
email:
|
133
|
+
- support@nialtoservices.co.uk
|
134
|
+
executables: []
|
135
|
+
extensions: []
|
136
|
+
extra_rdoc_files: []
|
137
|
+
files:
|
138
|
+
- ".gitignore"
|
139
|
+
- ".rspec"
|
140
|
+
- ".rubocop.yml"
|
141
|
+
- Gemfile
|
142
|
+
- Guardfile
|
143
|
+
- README.md
|
144
|
+
- Rakefile
|
145
|
+
- bin/console
|
146
|
+
- bin/setup
|
147
|
+
- lib/push_kit/apns.rb
|
148
|
+
- lib/push_kit/apns/constants.rb
|
149
|
+
- lib/push_kit/apns/http_client.rb
|
150
|
+
- lib/push_kit/apns/notification.rb
|
151
|
+
- lib/push_kit/apns/notification/localization.rb
|
152
|
+
- lib/push_kit/apns/push_client.rb
|
153
|
+
- lib/push_kit/apns/token_generator.rb
|
154
|
+
- push_kit.gemspec
|
155
|
+
- spec/push_kit/apns/constants_spec.rb
|
156
|
+
- spec/push_kit/apns/notification/localization_spec.rb
|
157
|
+
- spec/push_kit/apns/notification_spec.rb
|
158
|
+
- spec/spec_helper.rb
|
159
|
+
- spec/support/have_accessor.rb
|
160
|
+
homepage: https://github.com/nialtoservices/push_kit-apns
|
161
|
+
licenses:
|
162
|
+
- MIT
|
163
|
+
metadata:
|
164
|
+
yard.run: yri
|
165
|
+
post_install_message:
|
166
|
+
rdoc_options: []
|
167
|
+
require_paths:
|
168
|
+
- lib
|
169
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
|
+
requirements:
|
176
|
+
- - ">"
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: 1.3.1
|
179
|
+
requirements: []
|
180
|
+
rubygems_version: 3.0.3
|
181
|
+
signing_key:
|
182
|
+
specification_version: 4
|
183
|
+
summary: Send APNS push notifications with ease
|
184
|
+
test_files:
|
185
|
+
- spec/push_kit/apns/constants_spec.rb
|
186
|
+
- spec/push_kit/apns/notification/localization_spec.rb
|
187
|
+
- spec/push_kit/apns/notification_spec.rb
|
188
|
+
- spec/spec_helper.rb
|
189
|
+
- spec/support/have_accessor.rb
|