From 3a6c9f1979edccd93aedf5a134eb08c1edc50240 Mon Sep 17 00:00:00 2001 From: geemus Date: Thu, 4 Aug 2011 09:41:02 -0500 Subject: [PATCH] [storage|aws] simplify region accessor --- lib/fog/storage/aws.rb | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/fog/storage/aws.rb b/lib/fog/storage/aws.rb index ba860365a..15abc4e49 100644 --- a/lib/fog/storage/aws.rb +++ b/lib/fog/storage/aws.rb @@ -55,6 +55,8 @@ module Fog module Utils + attr_accessor :region + def cdn @cdn ||= Fog::AWS::CDN.new( :aws_access_key_id => @aws_access_key_id, @@ -92,16 +94,7 @@ module Fog query << "Expires=#{params[:headers]['Date']}" "#{@host}/#{params[:path]}?#{query.join('&')}" end - - def host - @host - end - - def region - region = @region || host.split('.').first.gsub(/s3-?/, '') - region.empty? ? 'us-east-1' : region - end - + end class Mock