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 +4 -4
 - data/lib/dashamail/api_request.rb +5 -1
 - data/lib/dashamail/request.rb +10 -4
 - data/lib/dashamail/version.rb +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 0612ef4950e3b43dbabdc4109f6984d6e44f17be85015e821f886fdd58fae5d4
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 551e73f0e6546f082ec9f35f21564ac1110018f0e1b60319f058ca8a4f402dba
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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:  
     | 
| 
      
 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
         
     | 
    
        data/lib/dashamail/request.rb
    CHANGED
    
    | 
         @@ -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,  
     | 
| 
      
 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, : 
     | 
| 
      
 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, 
     | 
| 
      
 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)
         
     | 
    
        data/lib/dashamail/version.rb
    CHANGED