Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Remove whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
sikachu committed Sep 23, 2011
1 parent 4661cef commit 825e1f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions lib/paperclip/storage/s3.rb
Expand Up @@ -95,12 +95,12 @@ def self.extended base
@url = ":s3_path_url"
end
@url = ":asset_host" if @options[:url].to_s == ":asset_host"

@http_proxy = @options[:http_proxy] || nil
if @http_proxy
@s3_options.merge!({:proxy => @http_proxy})
end

AWS::S3::Base.establish_connection!( @s3_options.merge(
:access_key_id => @s3_credentials[:access_key_id],
:secret_access_key => @s3_credentials[:secret_access_key]
Expand All @@ -127,27 +127,26 @@ def expiring_url(time = 3600, style_name = default_style)
def bucket_name
@bucket
end

def using_http_proxy?
!!@http_proxy
end

def http_proxy_host
using_http_proxy? ? @http_proxy[:host] : nil
end

def http_proxy_port
using_http_proxy? ? @http_proxy[:port] : nil
end

def http_proxy_user
using_http_proxy? ? @http_proxy[:user] : nil
end

def http_proxy_password
using_http_proxy? ? @http_proxy[:password] : nil
end


def s3_host_name
@s3_host_name || "s3.amazonaws.com"
Expand Down
4 changes: 2 additions & 2 deletions test/storage_test.rb
Expand Up @@ -70,7 +70,7 @@ def rails_env(env)
rails_env("not really an env")
assert_equal({:test => "12345"}, @avatar.parse_credentials(:test => "12345"))
end

should "support HTTP proxy settings" do
rails_env("development")
assert_equal(true, @avatar.using_http_proxy?)
Expand All @@ -79,7 +79,7 @@ def rails_env(env)
assert_equal(@proxy_settings[:user], @avatar.http_proxy_user)
assert_equal(@proxy_settings[:password], @avatar.http_proxy_password)
end

end

context "" do
Expand Down

0 comments on commit 825e1f1

Please sign in to comment.