summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-12-24 09:14:44 -0800
committerStan Hu <stanhu@gmail.com>2018-12-24 09:24:12 -0800
commite2179093b0e355da70889ee6d7191d33a4d9d687 (patch)
tree0219791b279a00960c4ba3515a5e52cf3365c6ce
parent5dc656fc1f053d397ad1e6c1d85a815f03a5d634 (diff)
downloadgitlab-ce-e2179093b0e355da70889ee6d7191d33a4d9d687.tar.gz
Bump CarrierWave to 1.3.0 and remove monkey patches
Full list of changes: https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md
-rw-r--r--Gemfile5
-rw-r--r--Gemfile.lock4
-rw-r--r--config/initializers/carrierwave_patch.rb42
3 files changed, 3 insertions, 48 deletions
diff --git a/Gemfile b/Gemfile
index 5ddd1f614f1..c316f3b0e5f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -89,10 +89,7 @@ gem 'kaminari', '~> 1.0'
gem 'hamlit', '~> 2.8.8'
# Files attachments
-# Locked until https://github.com/carrierwaveuploader/carrierwave/pull/2332 and
-# https://github.com/carrierwaveuploader/carrierwave/pull/2356 are merged.
-# config/initializers/carrierwave_patch.rb can be removed once both changes are released.
-gem 'carrierwave', '= 1.2.3'
+gem 'carrierwave', '~> 1.3'
gem 'mini_magick'
# for backups
diff --git a/Gemfile.lock b/Gemfile.lock
index f2d265d835c..942dbac27a6 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -108,7 +108,7 @@ GEM
capybara-screenshot (1.0.14)
capybara (>= 1.0, < 3)
launchy
- carrierwave (1.2.3)
+ carrierwave (1.3.0)
activemodel (>= 4.0.0)
activesupport (>= 4.0.0)
mime-types (>= 1.16)
@@ -965,7 +965,7 @@ DEPENDENCIES
bundler-audit (~> 0.5.0)
capybara (~> 2.15)
capybara-screenshot (~> 1.0.0)
- carrierwave (= 1.2.3)
+ carrierwave (~> 1.3)
charlock_holmes (~> 0.7.5)
chronic (~> 0.10.2)
chronic_duration (~> 0.10.6)
diff --git a/config/initializers/carrierwave_patch.rb b/config/initializers/carrierwave_patch.rb
deleted file mode 100644
index c361784491d..00000000000
--- a/config/initializers/carrierwave_patch.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-# This monkey patches CarrierWave 1.2.3 to make Google Cloud Storage work with
-# extra query parameters:
-# https://github.com/carrierwaveuploader/carrierwave/pull/2332/files
-module CarrierWave
- module Storage
- class Fog < Abstract
- class File
- def authenticated_url(options = {})
- if %w(AWS Google Rackspace OpenStack).include?(@uploader.fog_credentials[:provider])
- # avoid a get by using local references
- local_directory = connection.directories.new(key: @uploader.fog_directory)
- local_file = local_directory.files.new(key: path)
- expire_at = ::Fog::Time.now + @uploader.fog_authenticated_url_expiration
- case @uploader.fog_credentials[:provider]
- when 'AWS', 'Google'
- local_file.url(expire_at, options)
- when 'Rackspace'
- connection.get_object_https_url(@uploader.fog_directory, path, expire_at, options)
- when 'OpenStack'
- connection.get_object_https_url(@uploader.fog_directory, path, expire_at)
- else
- local_file.url(expire_at)
- end
- end
- end
-
- # Fix for https://github.com/carrierwaveuploader/carrierwave/pull/2356
- def acl_header
- if fog_provider == 'AWS'
- { 'x-amz-acl' => @uploader.fog_public ? 'public-read' : 'private' }
- else
- {}
- end
- end
-
- def fog_provider
- @uploader.fog_credentials[:provider].to_s
- end
- end
- end
- end
-end