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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e07860f9233dc0f123731853e0a42d899497109
4
- data.tar.gz: 6f484d9d537511e2d7a5cd0a8ef75e58dfa87514
3
+ metadata.gz: a3c1c1b34ccaa073b424f8e6fe8db70ddae3c99c
4
+ data.tar.gz: 12c4efa95b90d630bf2e5b9f325300522f547de0
5
5
  SHA512:
6
- metadata.gz: 7acc4f79fb3fa12b3ebb98c2cecafb5cb17d12ce70fb649a2a20d0736d5c2cab7068d6ab466f23c03aaa5ba64c2b4a7502090c5f09b73c07c62ec78e5373a697
7
- data.tar.gz: d1930a1051eff9affaf1ad619d55165cf92e92689892a0d2e41453d75bad9f714eeeeb18be612f519433b285368d8272f9f37bb8c9bbbc4921f49ca7444fa6d9
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
 
@@ -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.0"
22
+ spec.add_dependency "connection_pool", "~> 2"
23
23
 
24
- spec.add_development_dependency "bundler", "~> 1.3"
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
@@ -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
- @client = NetHttp2::Client.new(@url, ssl_context: ssl_context, connect_timeout: @connect_timeout)
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={})
@@ -1,3 +1,3 @@
1
1
  module Apnotic
2
- VERSION = '1.4.1'.freeze
2
+ VERSION = '1.5.0'.freeze
3
3
  end
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.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: 2018-07-18 00:00:00.000000000 Z
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.0'
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.0'
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: '1.3'
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: '1.3'
60
+ version: '0'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rake
63
63
  requirement: !ruby/object:Gem::Requirement