Skip to content

Commit

Permalink
Fog upgraded how expiring_urls are made
Browse files Browse the repository at this point in the history
Turns out that between fog 1.22.0 and fog 1.25.0, there was a change to
how fog builds S3 expiring URLs. This changes to test to be the common
point between the two versions. All we need to do here is make sure that
the expiring URL is being constructed.

In the process, this also updates all the appraisal-generated
Gemfiles.

Also, in the process, this meant I had to take away the builder version
restriction. This was put in so that `bundle`ing wouldn't take forever,
but I'm unsire whether this needed to happen with this version or if
builder just needed to be separate from the Gemfile. I'm commimtting
this and asking the people who reported the problem. If you don't see a
revet commit, everything was fine.
  • Loading branch information
Jon Yurek committed Dec 5, 2014
1 parent d02b2fc commit 3398282
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ gem 'pry'
# Prevents bundler from taking a long-time to resolve
group :development, :test do
gem 'mime-types', '~> 1.16'
gem 'builder', '~> 3.1.4'
gem 'builder'
end
20 changes: 13 additions & 7 deletions gemfiles/3.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

source "https://rubygems.org"

gem "sqlite3", "1.3.8", :platforms=>:ruby
gem "jruby-openssl", :platforms=>:jruby
gem "activerecord-jdbcsqlite3-adapter", :platforms=>:jruby
gem "rubysl", :platforms=>:rbx
gem "racc", :platforms=>:rbx
gem "sqlite3", "1.3.8", :platforms => :ruby
gem "jruby-openssl", :platforms => :jruby
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
gem "rubysl", :platforms => :rbx
gem "racc", :platforms => :rbx
gem "pry"
gem "rails", "~> 3.2.15"
gem "paperclip", :path=>"../"
gem "paperclip", :path => "../"

gemspec :path=>"../"
group :development, :test do
gem "mime-types", "~> 1.16"
gem "builder"
end

gemspec :path => "../"
20 changes: 13 additions & 7 deletions gemfiles/4.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

source "https://rubygems.org"

gem "sqlite3", "1.3.8", :platforms=>:ruby
gem "jruby-openssl", :platforms=>:jruby
gem "activerecord-jdbcsqlite3-adapter", :platforms=>:jruby
gem "rubysl", :platforms=>:rbx
gem "racc", :platforms=>:rbx
gem "sqlite3", "1.3.8", :platforms => :ruby
gem "jruby-openssl", :platforms => :jruby
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
gem "rubysl", :platforms => :rbx
gem "racc", :platforms => :rbx
gem "pry"
gem "rails", "~> 4.0.0"
gem "paperclip", :path=>"../"
gem "paperclip", :path => "../"

gemspec :path=>"../"
group :development, :test do
gem "mime-types", "~> 1.16"
gem "builder"
end

gemspec :path => "../"
20 changes: 13 additions & 7 deletions gemfiles/4.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

source "https://rubygems.org"

gem "sqlite3", "1.3.8", :platforms=>:ruby
gem "jruby-openssl", :platforms=>:jruby
gem "activerecord-jdbcsqlite3-adapter", :platforms=>:jruby
gem "rubysl", :platforms=>:rbx
gem "racc", :platforms=>:rbx
gem "sqlite3", "1.3.8", :platforms => :ruby
gem "jruby-openssl", :platforms => :jruby
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
gem "rubysl", :platforms => :rbx
gem "racc", :platforms => :rbx
gem "pry"
gem "rails", "~> 4.1.0.beta"
gem "paperclip", :path=>"../"
gem "paperclip", :path => "../"

gemspec :path=>"../"
group :development, :test do
gem "mime-types", "~> 1.16"
gem "builder"
end

gemspec :path => "../"
4 changes: 2 additions & 2 deletions spec/paperclip/storage/fog_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def custom_method
end

it "provides an url that expires in subdomain style" do
assert_match(/^http:\/\/papercliptests.s3.amazonaws.com\/avatars\/5k.png\?AWSAccessKeyId=.+$/, @dummy.avatar.expiring_url)
assert_match(/^http:\/\/papercliptests.s3.amazonaws.com\/avatars\/5k.png.+Expires=.+$/, @dummy.avatar.expiring_url)
end
end

Expand Down Expand Up @@ -390,7 +390,7 @@ def custom_method
end

it "provides a url that expires in folder style" do
assert_match(/^http:\/\/s3.amazonaws.com\/this_is_invalid\/avatars\/5k.png\?AWSAccessKeyId=.+$/, @dummy.avatar.expiring_url)
assert_match(/^http:\/\/s3.amazonaws.com\/this_is_invalid\/avatars\/5k.png.+Expires=.+$/, @dummy.avatar.expiring_url)
end

end
Expand Down

0 comments on commit 3398282

Please sign in to comment.