From fcc4db6a1d8b424ca72342f514fda1088661877f Mon Sep 17 00:00:00 2001 From: Alexander Kolesen Date: Thu, 21 Jun 2012 14:56:46 +0300 Subject: [PATCH] Fixed handling options[:persistent] in some cases Removed useless @persistent = options[:persistent] || true It prevented @persistent from being set to `false` --- lib/fog/aws/cdn.rb | 2 +- lib/fog/aws/dns.rb | 2 +- lib/fog/aws/storage.rb | 2 +- lib/fog/dnsmadeeasy/dns.rb | 2 +- lib/fog/google/storage.rb | 2 +- lib/fog/ninefold/storage.rb | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/fog/aws/cdn.rb b/lib/fog/aws/cdn.rb index 190b5c6b2..8c71aa822 100644 --- a/lib/fog/aws/cdn.rb +++ b/lib/fog/aws/cdn.rb @@ -88,7 +88,7 @@ module Fog @hmac = Fog::HMAC.new('sha1', @aws_secret_access_key) @host = options[:host] || 'cloudfront.amazonaws.com' @path = options[:path] || '/' - @persistent = options[:persistent] || true + @persistent = options.fetch(:persistent, true) @port = options[:port] || 443 @scheme = options[:scheme] || 'https' @version = options[:version] || '2010-11-01' diff --git a/lib/fog/aws/dns.rb b/lib/fog/aws/dns.rb index 387cee06f..8d8f6a6d0 100644 --- a/lib/fog/aws/dns.rb +++ b/lib/fog/aws/dns.rb @@ -90,7 +90,7 @@ module Fog @hmac = Fog::HMAC.new('sha1', @aws_secret_access_key) @host = options[:host] || 'route53.amazonaws.com' @path = options[:path] || '/' - @persistent = options[:persistent].nil? || options[:persistent] + @persistent = options.fetch(:persistent, true) @port = options[:port] || 443 @scheme = options[:scheme] || 'https' @version = options[:version] || '2012-02-29' diff --git a/lib/fog/aws/storage.rb b/lib/fog/aws/storage.rb index ede36f98c..4516c4f7b 100644 --- a/lib/fog/aws/storage.rb +++ b/lib/fog/aws/storage.rb @@ -271,7 +271,7 @@ module Fog "s3-#{options[:region]}.amazonaws.com" end @path = options[:path] || '/' - @persistent = options[:persistent] || true + @persistent = options.fetch(:persistent, true) @port = options[:port] || 443 @scheme = options[:scheme] || 'https' end diff --git a/lib/fog/dnsmadeeasy/dns.rb b/lib/fog/dnsmadeeasy/dns.rb index 589b0e1d0..00e68800e 100644 --- a/lib/fog/dnsmadeeasy/dns.rb +++ b/lib/fog/dnsmadeeasy/dns.rb @@ -85,7 +85,7 @@ module Fog @dnsmadeeasy_secret_key = options[:dnsmadeeasy_secret_key] @connection_options = options[:connection_options] || {} @host = options[:host] || 'api.dnsmadeeasy.com' - @persistent = options[:persistent] || true + @persistent = options.fetch(:persistent, true) @port = options[:port] || 80 #443 Not yet @scheme = options[:scheme] || 'http' #'https Not yet @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) diff --git a/lib/fog/google/storage.rb b/lib/fog/google/storage.rb index 6a4db85ee..453476329 100644 --- a/lib/fog/google/storage.rb +++ b/lib/fog/google/storage.rb @@ -192,7 +192,7 @@ module Fog @connection_options = options[:connection_options] || {} @hmac = Fog::HMAC.new('sha1', @google_storage_secret_access_key) @host = options[:host] || 'commondatastorage.googleapis.com' - @persistent = options[:persistent] || true + @persistent = options.fetch(:persistent, true) @port = options[:port] || 443 @scheme = options[:scheme] || 'https' @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) diff --git a/lib/fog/ninefold/storage.rb b/lib/fog/ninefold/storage.rb index 3b51e4fd1..5c440f526 100644 --- a/lib/fog/ninefold/storage.rb +++ b/lib/fog/ninefold/storage.rb @@ -54,7 +54,7 @@ module Fog @connection_options = options[:connection_options] || {} @hmac = Fog::HMAC.new('sha1', @ninefold_storage_secret_decoded) - @persistent = options[:persistent] || true + @persistent = options.fetch(:persistent, true) @connection = Fog::Connection.new("#{Fog::Storage::Ninefold::STORAGE_SCHEME}://#{Fog::Storage::Ninefold::STORAGE_HOST}:#{Fog::Storage::Ninefold::STORAGE_PORT}", @persistent, @connection_options) end