From 3398282e7daff8e0155c142e9e62dd5d27ba3ad8 Mon Sep 17 00:00:00 2001 From: Jon Yurek Date: Fri, 5 Dec 2014 16:27:00 -0500 Subject: [PATCH] Fog upgraded how expiring_urls are made 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. --- Gemfile | 2 +- gemfiles/3.2.gemfile | 20 +++++++++++++------- gemfiles/4.0.gemfile | 20 +++++++++++++------- gemfiles/4.1.gemfile | 20 +++++++++++++------- spec/paperclip/storage/fog_spec.rb | 4 ++-- 5 files changed, 42 insertions(+), 24 deletions(-) diff --git a/Gemfile b/Gemfile index dfbf25f8f..76301193e 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/gemfiles/3.2.gemfile b/gemfiles/3.2.gemfile index 1100f700a..232b86e08 100644 --- a/gemfiles/3.2.gemfile +++ b/gemfiles/3.2.gemfile @@ -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=>"../" \ No newline at end of file +group :development, :test do + gem "mime-types", "~> 1.16" + gem "builder" +end + +gemspec :path => "../" diff --git a/gemfiles/4.0.gemfile b/gemfiles/4.0.gemfile index a52cb30c3..042d06397 100644 --- a/gemfiles/4.0.gemfile +++ b/gemfiles/4.0.gemfile @@ -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=>"../" \ No newline at end of file +group :development, :test do + gem "mime-types", "~> 1.16" + gem "builder" +end + +gemspec :path => "../" diff --git a/gemfiles/4.1.gemfile b/gemfiles/4.1.gemfile index 8c98ce82a..1a223b6ae 100644 --- a/gemfiles/4.1.gemfile +++ b/gemfiles/4.1.gemfile @@ -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 => "../" diff --git a/spec/paperclip/storage/fog_spec.rb b/spec/paperclip/storage/fog_spec.rb index 7c4fc001d..dfa9427f4 100644 --- a/spec/paperclip/storage/fog_spec.rb +++ b/spec/paperclip/storage/fog_spec.rb @@ -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 @@ -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