apnotic 1.4.1 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/apnotic.gemspec +2 -2
- data/lib/apnotic/connection.rb +10 -1
- data/lib/apnotic/version.rb +1 -1
- 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: a3c1c1b34ccaa073b424f8e6fe8db70ddae3c99c
|
4
|
+
data.tar.gz: 12c4efa95b90d630bf2e5b9f325300522f547de0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ed49505ce1af49c071e9f9d34d7c43fe093af662c350aaf8cfe043eb2e98962632f0aeffdbf04ffc1d46ad6a61fd1044a12236961e0c8f12c45a55e3347bf90
|
7
|
+
data.tar.gz: 84386deb43b649f570c0a48ae2aec00c270c2c2f3139d3cd8eb2a0b78cc132ff2c9220130c4cc5b4c32fcad926961354dc60543e9e1903f5a3b9f2d3ba1b373d
|
data/README.md
CHANGED
@@ -207,6 +207,10 @@ Apnotic::Connection.new(options)
|
|
207
207
|
| :cert_pass | Optional. The certificate's password.
|
208
208
|
| :url | Optional. Defaults to https://api.push.apple.com:443.
|
209
209
|
| :connect_timeout | Optional. Expressed in seconds, defaults to 30.
|
210
|
+
| :proxy_addr | Optional. Proxy server. e.g. http://proxy.example.com
|
211
|
+
| :proxy_port | Optional. Proxy port. e.g. 8080
|
212
|
+
| :proxy_user | Optional. User name for proxy authentication. e.g. user_name
|
213
|
+
| :proxy_pass | Optional. Password for proxy authentication. e.g. pass_word
|
210
214
|
|
211
215
|
Note that since `:cert_path` can be any object that responds to `:read`, it is possible to pass in a certificate string directly by wrapping it up in a `StringIO` object:
|
212
216
|
|
data/apnotic.gemspec
CHANGED
@@ -19,9 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency "net-http2", ">= 0.18", "< 2"
|
22
|
-
spec.add_dependency "connection_pool", "~> 2
|
22
|
+
spec.add_dependency "connection_pool", "~> 2"
|
23
23
|
|
24
|
-
spec.add_development_dependency "bundler"
|
24
|
+
spec.add_development_dependency "bundler"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
26
|
spec.add_development_dependency "rspec", "~> 3.0"
|
27
27
|
end
|
data/lib/apnotic/connection.rb
CHANGED
@@ -5,6 +5,7 @@ module Apnotic
|
|
5
5
|
|
6
6
|
APPLE_DEVELOPMENT_SERVER_URL = "https://api.sandbox.push.apple.com:443"
|
7
7
|
APPLE_PRODUCTION_SERVER_URL = "https://api.push.apple.com:443"
|
8
|
+
PROXY_SETTINGS_KEYS = [:proxy_addr, :proxy_port, :proxy_user, :proxy_pass]
|
8
9
|
|
9
10
|
class Connection
|
10
11
|
attr_reader :url, :cert_path
|
@@ -28,7 +29,15 @@ module Apnotic
|
|
28
29
|
|
29
30
|
raise "Cert file not found: #{@cert_path}" unless @cert_path && (@cert_path.respond_to?(:read) || File.exist?(@cert_path))
|
30
31
|
|
31
|
-
|
32
|
+
http2_options = {
|
33
|
+
ssl_context: ssl_context,
|
34
|
+
connect_timeout: @connect_timeout
|
35
|
+
}
|
36
|
+
PROXY_SETTINGS_KEYS.each do |key|
|
37
|
+
http2_options[key] = options[key] if options[key]
|
38
|
+
end
|
39
|
+
|
40
|
+
@client = NetHttp2::Client.new(@url, http2_options)
|
32
41
|
end
|
33
42
|
|
34
43
|
def push(notification, options={})
|
data/lib/apnotic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apnotic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Ostinelli
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-http2
|
@@ -36,28 +36,28 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '2
|
39
|
+
version: '2'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '2
|
46
|
+
version: '2'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '0'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - "
|
58
|
+
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rake
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|