dashamail 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d68d9cc7d8695b77731a6b3e6e89cf4fb1de57e886f7768462a16e47791260a
4
- data.tar.gz: 6f86142fdc56b15a7d77436a6111ab44bea94eb90fe6e4b208320e66fe5d2bdc
3
+ metadata.gz: 0612ef4950e3b43dbabdc4109f6984d6e44f17be85015e821f886fdd58fae5d4
4
+ data.tar.gz: 551e73f0e6546f082ec9f35f21564ac1110018f0e1b60319f058ca8a4f402dba
5
5
  SHA512:
6
- metadata.gz: 5476bc80014e4a5a4c0c88fa30792cc3e9f0b24e3ad0df9be3c1ae44eaac1194ed8f89c704f2b6ae00ba8f4248dde7987780e8d2bbf8e568ac48b3a94347610a
7
- data.tar.gz: 2d5ad7b713b318a37c1a0e322a59cb7cda86f3dabc1ef747b733ded74d67848d5e71e0427b573bd1748ceb4a863b07cc49a0ac114b189af371f7d5fae646f03e
6
+ metadata.gz: 36a36ed54d11007ceba9ecfc075ba7e43fdf2c50819076534bf93196f337a6d82843b1d6c6b17d1bc06ff54c4b09b42eec94f734ffe554aa64aa297e61abbe7d
7
+ data.tar.gz: a47e1c4e79f65c2c2d9c10a01b970a7dc90c92853a6c24bc1a482e94ecc2134fee211c01efdf99fe200e98cb1cb1536ca0f9acb6b30b20a0815cc425d5f2bca0
@@ -94,6 +94,10 @@ module Dashamail
94
94
  @request_builder.proxy
95
95
  end
96
96
 
97
+ def ssl_options
98
+ @request_builder.ssl_options
99
+ end
100
+
97
101
  def adapter
98
102
  @request_builder.faraday_adapter
99
103
  end
@@ -147,7 +151,7 @@ module Dashamail
147
151
  end
148
152
 
149
153
  def rest_client
150
- client = Faraday.new(self.api_url, proxy: self.proxy, ssl: { version: "TLSv1_2" }) do |faraday|
154
+ client = Faraday.new(self.api_url, proxy: self.proxy, ssl: self.ssl_options) do |faraday|
151
155
  faraday.response :raise_error
152
156
  faraday.adapter adapter
153
157
  if @request_builder.debug
@@ -1,11 +1,12 @@
1
1
  module Dashamail
2
2
  class Request
3
- attr_accessor :api_key, :api_endpoint, :timeout, :open_timeout, :proxy, :faraday_adapter, :symbolize_keys, :debug, :logger, :test
3
+ attr_accessor :api_key, :api_endpoint, :timeout, :open_timeout, :proxy, :ssl_options, :faraday_adapter, :symbolize_keys, :debug, :logger, :test
4
4
 
5
5
  DEFAULT_TIMEOUT = 60
6
6
  DEFAULT_OPEN_TIMEOUT = 60
7
7
 
8
- def initialize(api_key: nil, api_endpoint: nil, timeout: nil, open_timeout: nil, proxy: nil, faraday_adapter: nil, symbolize_keys: false, debug: false, logger: nil, test: false)
8
+ def initialize(api_key: nil, api_endpoint: nil, timeout: nil, open_timeout: nil, proxy: nil, ssl_options: nil,
9
+ faraday_adapter: nil, symbolize_keys: false, debug: false, logger: nil, test: false)
9
10
  @path_parts = []
10
11
  @api_key = api_key || self.class.api_key
11
12
  @api_key = @api_key.strip if @api_key
@@ -13,6 +14,7 @@ module Dashamail
13
14
  @timeout = timeout || self.class.timeout || DEFAULT_TIMEOUT
14
15
  @open_timeout = open_timeout || self.class.open_timeout || DEFAULT_OPEN_TIMEOUT
15
16
  @proxy = proxy || self.class.proxy || ENV['DASHAMAIL_PROXY']
17
+ @ssl_options = ssl_options || self.class.ssl_options || { version: "TLSv1_2" }
16
18
  @faraday_adapter = faraday_adapter || self.class.faraday_adapter || Faraday.default_adapter
17
19
  @symbolize_keys = symbolize_keys || self.class.symbolize_keys || false
18
20
  @debug = debug || self.class.debug || false
@@ -80,10 +82,14 @@ module Dashamail
80
82
  end
81
83
 
82
84
  class << self
83
- attr_accessor :api_key, :timeout, :open_timeout, :api_endpoint, :proxy, :faraday_adapter, :symbolize_keys, :debug, :logger, :test
85
+ attr_accessor :api_key, :timeout, :open_timeout, :api_endpoint, :proxy, :ssl_options, :faraday_adapter,
86
+ :symbolize_keys, :debug, :logger, :test
84
87
 
85
88
  def method_missing(sym, *args, &block)
86
- new(api_key: self.api_key, api_endpoint: self.api_endpoint, timeout: self.timeout, open_timeout: self.open_timeout, faraday_adapter: self.faraday_adapter, symbolize_keys: self.symbolize_keys, debug: self.debug, proxy: self.proxy, logger: self.logger, test: self.test).send(sym, *args, &block)
89
+ new(api_key: self.api_key, api_endpoint: self.api_endpoint, timeout: self.timeout,
90
+ open_timeout: self.open_timeout, faraday_adapter: self.faraday_adapter, symbolize_keys: self.symbolize_keys,
91
+ debug: self.debug, proxy: self.proxy, ssl_options: self.ssl_options, logger: self.logger,
92
+ test: self.test).send(sym, *args, &block)
87
93
  end
88
94
 
89
95
  def respond_to_missing?(method_name, include_private = false)
@@ -1,3 +1,3 @@
1
1
  module Dashamail
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dashamail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Osetrov