carrierwave 1.3.3 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of carrierwave might be problematic. Click here for more details.

Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +117 -43
  3. data/lib/carrierwave/downloader/base.rb +93 -0
  4. data/lib/carrierwave/downloader/remote_file.rb +65 -0
  5. data/lib/carrierwave/locale/en.yml +5 -4
  6. data/lib/carrierwave/mount.rb +25 -19
  7. data/lib/carrierwave/mounter.rb +70 -47
  8. data/lib/carrierwave/orm/activerecord.rb +14 -8
  9. data/lib/carrierwave/processing/mini_magick.rb +100 -117
  10. data/lib/carrierwave/processing/rmagick.rb +2 -2
  11. data/lib/carrierwave/processing/vips.rb +284 -0
  12. data/lib/carrierwave/processing.rb +1 -0
  13. data/lib/carrierwave/sanitized_file.rb +38 -16
  14. data/lib/carrierwave/storage/file.rb +2 -2
  15. data/lib/carrierwave/storage/fog.rb +44 -13
  16. data/lib/carrierwave/storage.rb +1 -0
  17. data/lib/carrierwave/uploader/cache.rb +24 -16
  18. data/lib/carrierwave/uploader/configuration.rb +28 -15
  19. data/lib/carrierwave/uploader/content_type_blacklist.rb +17 -8
  20. data/lib/carrierwave/uploader/content_type_whitelist.rb +20 -8
  21. data/lib/carrierwave/uploader/download.rb +2 -123
  22. data/lib/carrierwave/uploader/extension_blacklist.rb +18 -10
  23. data/lib/carrierwave/uploader/extension_whitelist.rb +19 -10
  24. data/lib/carrierwave/uploader/mountable.rb +6 -0
  25. data/lib/carrierwave/uploader/proxy.rb +2 -2
  26. data/lib/carrierwave/uploader/serialization.rb +1 -1
  27. data/lib/carrierwave/uploader/store.rb +5 -3
  28. data/lib/carrierwave/uploader/url.rb +6 -3
  29. data/lib/carrierwave/uploader/versions.rb +43 -13
  30. data/lib/carrierwave/uploader.rb +0 -9
  31. data/lib/carrierwave/validations/active_model.rb +3 -3
  32. data/lib/carrierwave/version.rb +1 -1
  33. data/lib/carrierwave.rb +4 -0
  34. data/lib/generators/templates/uploader.rb +2 -2
  35. metadata +105 -32
@@ -43,15 +43,6 @@ module CarrierWave
43
43
  class Base
44
44
  attr_reader :file
45
45
 
46
- ##
47
- # Workaround for class_attribute malfunction when used with Module#prepend
48
- #
49
- if RUBY_VERSION < '2.1.0'
50
- def self.singleton_class?
51
- !ancestors.include? self
52
- end
53
- end
54
-
55
46
  include CarrierWave::Uploader::Configuration
56
47
  include CarrierWave::Uploader::Callbacks
57
48
  include CarrierWave::Uploader::Proxy
@@ -11,7 +11,7 @@ module CarrierWave
11
11
  class ProcessingValidator < ::ActiveModel::EachValidator
12
12
 
13
13
  def validate_each(record, attribute, value)
14
- if e = record.__send__("#{attribute}_processing_error")
14
+ record.__send__("#{attribute}_processing_errors").each do |e|
15
15
  message = (e.message == e.class.to_s) ? :carrierwave_processing_error : e.message
16
16
  record.errors.add(attribute, message)
17
17
  end
@@ -21,7 +21,7 @@ module CarrierWave
21
21
  class IntegrityValidator < ::ActiveModel::EachValidator
22
22
 
23
23
  def validate_each(record, attribute, value)
24
- if e = record.__send__("#{attribute}_integrity_error")
24
+ record.__send__("#{attribute}_integrity_errors").each do |e|
25
25
  message = (e.message == e.class.to_s) ? :carrierwave_integrity_error : e.message
26
26
  record.errors.add(attribute, message)
27
27
  end
@@ -31,7 +31,7 @@ module CarrierWave
31
31
  class DownloadValidator < ::ActiveModel::EachValidator
32
32
 
33
33
  def validate_each(record, attribute, value)
34
- if e = record.__send__("#{attribute}_download_error")
34
+ record.__send__("#{attribute}_download_errors").each do |e|
35
35
  message = (e.message == e.class.to_s) ? :carrierwave_download_error : e.message
36
36
  record.errors.add(attribute, message)
37
37
  end
@@ -1,3 +1,3 @@
1
1
  module CarrierWave
2
- VERSION = "1.3.3"
2
+ VERSION = "2.2.3"
3
3
  end
data/lib/carrierwave.rb CHANGED
@@ -72,6 +72,10 @@ elsif defined?(Rails)
72
72
  require 'carrierwave/orm/activerecord'
73
73
  end
74
74
  end
75
+
76
+ config.before_eager_load do
77
+ CarrierWave::Storage::Fog.eager_load
78
+ end
75
79
  end
76
80
  end
77
81
 
@@ -33,9 +33,9 @@ class <%= class_name %>Uploader < CarrierWave::Uploader::Base
33
33
  # process resize_to_fit: [50, 50]
34
34
  # end
35
35
 
36
- # Add a white list of extensions which are allowed to be uploaded.
36
+ # Add an allowlist of extensions which are allowed to be uploaded.
37
37
  # For images you might use something like this:
38
- # def extension_whitelist
38
+ # def extension_allowlist
39
39
  # %w(jpg jpeg gif png)
40
40
  # end
41
41
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Nicklas
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-02 00:00:00.000000000 Z
11
+ date: 2022-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,62 +16,112 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.0
19
+ version: 5.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.0
26
+ version: 5.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activemodel
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 4.0.0
33
+ version: 5.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 4.0.0
40
+ version: 5.0.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: mime-types
42
+ name: mini_mime
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.16'
47
+ version: 0.1.3
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.16'
54
+ version: 0.1.3
55
55
  - !ruby/object:Gem::Dependency
56
- name: ssrf_filter
56
+ name: image_processing
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "<"
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.1.0
61
+ version: '1.1'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
62
66
  - - "~>"
63
67
  - !ruby/object:Gem::Version
64
- version: '1.0'
68
+ version: '1.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: marcel
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 1.0.0
65
76
  type: :runtime
66
77
  prerelease: false
67
78
  version_requirements: !ruby/object:Gem::Requirement
68
79
  requirements:
69
- - - "<"
80
+ - - "~>"
70
81
  - !ruby/object:Gem::Version
71
- version: 1.1.0
82
+ version: 1.0.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: addressable
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.6'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '2.6'
97
+ - !ruby/object:Gem::Dependency
98
+ name: ssrf_filter
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
72
108
  - - "~>"
73
109
  - !ruby/object:Gem::Version
74
110
  version: '1.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pg
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
75
125
  - !ruby/object:Gem::Dependency
76
126
  name: rails
77
127
  requirement: !ruby/object:Gem::Requirement
@@ -115,7 +165,7 @@ dependencies:
115
165
  - !ruby/object:Gem::Version
116
166
  version: '3.4'
117
167
  - !ruby/object:Gem::Dependency
118
- name: webmock
168
+ name: rspec-retry
119
169
  requirement: !ruby/object:Gem::Requirement
120
170
  requirements:
121
171
  - - ">="
@@ -129,19 +179,19 @@ dependencies:
129
179
  - !ruby/object:Gem::Version
130
180
  version: '0'
131
181
  - !ruby/object:Gem::Dependency
132
- name: fog-core
182
+ name: webmock
133
183
  requirement: !ruby/object:Gem::Requirement
134
184
  requirements:
135
- - - "~>"
185
+ - - ">="
136
186
  - !ruby/object:Gem::Version
137
- version: 2.1.0
187
+ version: '0'
138
188
  type: :development
139
189
  prerelease: false
140
190
  version_requirements: !ruby/object:Gem::Requirement
141
191
  requirements:
142
- - - "~>"
192
+ - - ">="
143
193
  - !ruby/object:Gem::Version
144
- version: 2.1.0
194
+ version: '0'
145
195
  - !ruby/object:Gem::Dependency
146
196
  name: fog-aws
147
197
  requirement: !ruby/object:Gem::Requirement
@@ -160,16 +210,22 @@ dependencies:
160
210
  name: fog-google
161
211
  requirement: !ruby/object:Gem::Requirement
162
212
  requirements:
163
- - - ">="
213
+ - - "~>"
164
214
  - !ruby/object:Gem::Version
165
- version: '0'
215
+ version: '1.7'
216
+ - - "!="
217
+ - !ruby/object:Gem::Version
218
+ version: 1.12.1
166
219
  type: :development
167
220
  prerelease: false
168
221
  version_requirements: !ruby/object:Gem::Requirement
169
222
  requirements:
170
- - - ">="
223
+ - - "~>"
171
224
  - !ruby/object:Gem::Version
172
- version: '0'
225
+ version: '1.7'
226
+ - - "!="
227
+ - !ruby/object:Gem::Version
228
+ version: 1.12.1
173
229
  - !ruby/object:Gem::Dependency
174
230
  name: fog-local
175
231
  requirement: !ruby/object:Gem::Requirement
@@ -216,14 +272,14 @@ dependencies:
216
272
  name: rmagick
217
273
  requirement: !ruby/object:Gem::Requirement
218
274
  requirements:
219
- - - "~>"
275
+ - - ">="
220
276
  - !ruby/object:Gem::Version
221
277
  version: '2.16'
222
278
  type: :development
223
279
  prerelease: false
224
280
  version_requirements: !ruby/object:Gem::Requirement
225
281
  requirements:
226
- - - "~>"
282
+ - - ">="
227
283
  - !ruby/object:Gem::Version
228
284
  version: '2.16'
229
285
  - !ruby/object:Gem::Dependency
@@ -268,6 +324,20 @@ dependencies:
268
324
  - - ">="
269
325
  - !ruby/object:Gem::Version
270
326
  version: '0'
327
+ - !ruby/object:Gem::Dependency
328
+ name: pry-byebug
329
+ requirement: !ruby/object:Gem::Requirement
330
+ requirements:
331
+ - - ">="
332
+ - !ruby/object:Gem::Version
333
+ version: '0'
334
+ type: :development
335
+ prerelease: false
336
+ version_requirements: !ruby/object:Gem::Requirement
337
+ requirements:
338
+ - - ">="
339
+ - !ruby/object:Gem::Version
340
+ version: '0'
271
341
  description: Upload files in your Ruby applications, map them to a range of ORMs,
272
342
  store them on different backends.
273
343
  email:
@@ -280,6 +350,8 @@ files:
280
350
  - README.md
281
351
  - lib/carrierwave.rb
282
352
  - lib/carrierwave/compatibility/paperclip.rb
353
+ - lib/carrierwave/downloader/base.rb
354
+ - lib/carrierwave/downloader/remote_file.rb
283
355
  - lib/carrierwave/error.rb
284
356
  - lib/carrierwave/locale/en.yml
285
357
  - lib/carrierwave/mount.rb
@@ -288,6 +360,7 @@ files:
288
360
  - lib/carrierwave/processing.rb
289
361
  - lib/carrierwave/processing/mini_magick.rb
290
362
  - lib/carrierwave/processing/rmagick.rb
363
+ - lib/carrierwave/processing/vips.rb
291
364
  - lib/carrierwave/sanitized_file.rb
292
365
  - lib/carrierwave/storage.rb
293
366
  - lib/carrierwave/storage/abstract.rb
@@ -323,7 +396,7 @@ homepage: https://github.com/carrierwaveuploader/carrierwave
323
396
  licenses:
324
397
  - MIT
325
398
  metadata: {}
326
- post_install_message:
399
+ post_install_message:
327
400
  rdoc_options:
328
401
  - "--main"
329
402
  require_paths:
@@ -332,15 +405,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
332
405
  requirements:
333
406
  - - ">="
334
407
  - !ruby/object:Gem::Version
335
- version: 2.0.0
408
+ version: 2.2.2
336
409
  required_rubygems_version: !ruby/object:Gem::Requirement
337
410
  requirements:
338
411
  - - ">="
339
412
  - !ruby/object:Gem::Version
340
413
  version: '0'
341
414
  requirements: []
342
- rubygems_version: 3.1.6
343
- signing_key:
415
+ rubygems_version: 3.3.7
416
+ signing_key:
344
417
  specification_version: 4
345
418
  summary: Ruby file upload library
346
419
  test_files: []