lib/nightcrawler_swift/gateway.rb in nightcrawler_swift-0.5.0 vs lib/nightcrawler_swift/gateway.rb in nightcrawler_swift-0.6.0

- old
+ new

@@ -16,12 +16,11 @@ @retries = NightcrawlerSwift.options.retries @max_retry_time = NightcrawlerSwift.options.max_retry_time @resource = RestClient::Resource.new( @url, - verify_ssl: NightcrawlerSwift.options.verify_ssl, - timeout: NightcrawlerSwift.options.timeout + {timeout: options.timeout}.merge(ssl_options) ) end def request &block begin @@ -47,9 +46,25 @@ end private def log message NightcrawlerSwift.logger.debug message + end + + def options + NightcrawlerSwift.options + end + + def ssl_options + [ + :verify_ssl, + :ssl_client_cert, + :ssl_client_key, + :ssl_ca_file + + ].inject({}) {|hash, key| + hash.tap {hash[key] = options[key]} + }.compact end def recoverable? e @retries and !RETRY_BLACKLIST.include?(e.class) and