Relax dependency on ruby-carrierwave

This commit is contained in:
Pirate Praveen 2019-02-02 19:07:09 +05:30
parent c2e0d6411c
commit 3aadb5464f
3 changed files with 48 additions and 1 deletions

2
debian/control vendored
View file

@ -104,7 +104,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends},
# HAML # HAML
ruby-hamlit (>= 2.8.8~), ruby-hamlit (>= 2.8.8~),
# Files attachments # Files attachments
ruby-carrierwave (>= 1.2.3~), ruby-carrierwave (>= 1.3~),
ruby-mini-magick, ruby-mini-magick,
# for backups # for backups
ruby-fog-aws (>= 2.0.1~), ruby-fog-aws (>= 2.0.1~),

View file

@ -0,0 +1,46 @@
--- a/Gemfile
+++ b/Gemfile
@@ -99,10 +99,7 @@
# HAML
gem 'hamlit', '~> 2.8', '>= 2.8.8'
-# Files attachments
-# Locked until https://github.com/carrierwaveuploader/carrierwave/pull/2332/files is merged.
-# config/initializers/carrierwave_patch.rb can be removed once that change is released.
-gem 'carrierwave', '= 1.2.3'
+gem 'carrierwave', '~> 1.3'
gem 'mini_magick'
# for backups
--- a/config/initializers/carrierwave_patch.rb
+++ /dev/null
@@ -1,29 +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
- end
- end
- end
-end

View file

@ -12,6 +12,7 @@
0440-remove-puma.patch 0440-remove-puma.patch
0450-remove-bullet.patch 0450-remove-bullet.patch
0460-relax-rspec-rails.patch 0460-relax-rspec-rails.patch
0470-relax-carrierwave.patch
0500-set-webpack-root.patch 0500-set-webpack-root.patch
0510-remove-dev-dependencies.patch 0510-remove-dev-dependencies.patch
0520-add-system-lib-path-for-webpack.patch 0520-add-system-lib-path-for-webpack.patch