s33r 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -368,9 +368,9 @@ module S33r
368
368
  # Note that if a :path option is not set, a path is generated from any :bucket and/or :path
369
369
  # parameters supplied.
370
370
  def s3_public_url(options)
371
+ options[:use_ssl] = false if options[:subdomain]
371
372
  scheme = options[:use_ssl] ? 'https' : 'http'
372
- path = options[:path]
373
- path ||= s3_path(options)
373
+ path = options[:path] || s3_path(options)
374
374
  host = HOST
375
375
  host = (options[:bucket] + "." + host ) if options[:subdomain] and options[:bucket]
376
376
  "#{scheme}://" + host + path
@@ -39,7 +39,6 @@ context 'S33r utility' do
39
39
  @correct_public_url = "http://s3.amazonaws.com/quotes/nelson"
40
40
  @correct_public_ssl_url = "https://s3.amazonaws.com/quotes/nelson"
41
41
  @correct_public_url_with_subdomain = "http://quotes.s3.amazonaws.com/nelson"
42
- @correct_public_url_with_ssl_and_subdomain = "https://quotes.s3.amazonaws.com/nelson"
43
42
  @correct_public_url_without_key = "http://s3.amazonaws.com/quotes/"
44
43
  @correct_logging_url = "http://s3.amazonaws.com/quotes/?logging"
45
44
  @correct_acl_url = "http://s3.amazonaws.com/quotes/?acl"
@@ -195,7 +194,7 @@ context 'S33r utility' do
195
194
  s3_public_url(:bucket => 'quotes', :key => 'nelson', :subdomain => true).should == \
196
195
  @correct_public_url_with_subdomain
197
196
  s3_public_url(:bucket => 'quotes', :key => 'nelson', :subdomain => true, :use_ssl => true).should == \
198
- @correct_public_url_with_ssl_and_subdomain
197
+ @correct_public_url_with_subdomain
199
198
  end
200
199
 
201
200
  specify 'should generate URLs for buckets without keys' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s33r
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elliot Smith
@@ -9,7 +9,7 @@ autorequire: s33r
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-06-14 00:00:00 +01:00
12
+ date: 2008-06-16 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency