carrierwave 2.2.6 → 3.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +137 -67
  3. data/lib/carrierwave/compatibility/paperclip.rb +4 -2
  4. data/lib/carrierwave/downloader/base.rb +19 -11
  5. data/lib/carrierwave/downloader/remote_file.rb +13 -10
  6. data/lib/carrierwave/locale/en.yml +5 -3
  7. data/lib/carrierwave/mount.rb +36 -50
  8. data/lib/carrierwave/mounter.rb +117 -50
  9. data/lib/carrierwave/orm/activerecord.rb +21 -62
  10. data/lib/carrierwave/processing/mini_magick.rb +15 -13
  11. data/lib/carrierwave/processing/rmagick.rb +11 -15
  12. data/lib/carrierwave/processing/vips.rb +12 -12
  13. data/lib/carrierwave/sanitized_file.rb +49 -77
  14. data/lib/carrierwave/storage/abstract.rb +5 -5
  15. data/lib/carrierwave/storage/file.rb +6 -5
  16. data/lib/carrierwave/storage/fog.rb +74 -66
  17. data/lib/carrierwave/test/matchers.rb +11 -7
  18. data/lib/carrierwave/uploader/cache.rb +18 -10
  19. data/lib/carrierwave/uploader/callbacks.rb +1 -1
  20. data/lib/carrierwave/uploader/configuration.rb +10 -4
  21. data/lib/carrierwave/uploader/{content_type_whitelist.rb → content_type_allowlist.rb} +17 -15
  22. data/lib/carrierwave/uploader/{content_type_blacklist.rb → content_type_denylist.rb} +19 -14
  23. data/lib/carrierwave/uploader/dimension.rb +66 -0
  24. data/lib/carrierwave/uploader/{extension_whitelist.rb → extension_allowlist.rb} +17 -15
  25. data/lib/carrierwave/uploader/{extension_blacklist.rb → extension_denylist.rb} +18 -13
  26. data/lib/carrierwave/uploader/file_size.rb +2 -2
  27. data/lib/carrierwave/uploader/processing.rb +31 -6
  28. data/lib/carrierwave/uploader/proxy.rb +16 -3
  29. data/lib/carrierwave/uploader/store.rb +44 -6
  30. data/lib/carrierwave/uploader/url.rb +1 -1
  31. data/lib/carrierwave/uploader/versions.rb +154 -136
  32. data/lib/carrierwave/uploader.rb +10 -8
  33. data/lib/carrierwave/utilities/file_name.rb +47 -0
  34. data/lib/carrierwave/utilities/uri.rb +14 -11
  35. data/lib/carrierwave/utilities.rb +1 -0
  36. data/lib/carrierwave/validations/active_model.rb +4 -6
  37. data/lib/carrierwave/version.rb +1 -1
  38. data/lib/carrierwave.rb +9 -17
  39. data/lib/generators/templates/{uploader.rb → uploader.rb.erb} +1 -1
  40. data/lib/generators/uploader_generator.rb +3 -3
  41. metadata +32 -44
data/lib/carrierwave.rb CHANGED
@@ -25,16 +25,7 @@ module CarrierWave
25
25
 
26
26
  end
27
27
 
28
- if defined?(Merb)
29
-
30
- CarrierWave.root = Merb.dir_for(:public)
31
- Merb::BootLoader.before_app_loads do
32
- # Setup path for uploaders and load all of them before classes are loaded
33
- Merb.push_path(:uploaders, Merb.root / 'app' / 'uploaders', '*.rb')
34
- Dir.glob(File.join(Merb.load_paths[:uploaders])).each {|f| require f }
35
- end
36
-
37
- elsif defined?(Jets)
28
+ if defined?(Jets)
38
29
 
39
30
  module CarrierWave
40
31
  class Turbine < Jets::Turbine
@@ -84,13 +75,14 @@ elsif defined?(Sinatra)
84
75
  CarrierWave.root = File.join(PADRINO_ROOT, "public")
85
76
  else
86
77
 
87
- CarrierWave.root = if Sinatra::Application.respond_to?(:public_folder)
88
- # Sinatra >= 1.3
89
- Sinatra::Application.public_folder
90
- else
91
- # Sinatra < 1.3
92
- Sinatra::Application.public
93
- end
78
+ CarrierWave.root =
79
+ if Sinatra::Application.respond_to?(:public_folder)
80
+ # Sinatra >= 1.3
81
+ Sinatra::Application.public_folder
82
+ else
83
+ # Sinatra < 1.3
84
+ Sinatra::Application.public
85
+ end
94
86
  end
95
87
  end
96
88
 
@@ -42,6 +42,6 @@ class <%= class_name %>Uploader < CarrierWave::Uploader::Base
42
42
  # Override the filename of the uploaded files:
43
43
  # Avoid using model.id or version_name here, see uploader/store.rb for details.
44
44
  # def filename
45
- # "something.jpg" if original_filename
45
+ # "something.jpg"
46
46
  # end
47
47
  end
@@ -1,7 +1,7 @@
1
1
  class UploaderGenerator < Rails::Generators::NamedBase
2
- source_root File.expand_path("../templates", __FILE__)
2
+ source_root File.expand_path('templates', __dir__)
3
3
 
4
4
  def create_uploader_file
5
- template "uploader.rb", File.join('app/uploaders', class_path, "#{file_name}_uploader.rb")
5
+ template "uploader.rb.erb", File.join('app/uploaders', class_path, "#{file_name}_uploader.rb")
6
6
  end
7
- end
7
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.6
4
+ version: 3.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Nicklas
@@ -16,42 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.0
19
+ version: 6.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: 5.0.0
26
+ version: 6.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: 5.0.0
33
+ version: 6.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: 5.0.0
41
- - !ruby/object:Gem::Dependency
42
- name: mini_mime
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: 0.1.3
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: 0.1.3
40
+ version: 6.0.0
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: image_processing
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -109,33 +95,19 @@ dependencies:
109
95
  - !ruby/object:Gem::Version
110
96
  version: '1.0'
111
97
  - !ruby/object:Gem::Dependency
112
- name: pg
98
+ name: csv
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  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'
125
- - !ruby/object:Gem::Dependency
126
- name: rails
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
101
+ - - "~>"
130
102
  - !ruby/object:Gem::Version
131
- version: 5.0.0
103
+ version: '3.0'
132
104
  type: :development
133
105
  prerelease: false
134
106
  version_requirements: !ruby/object:Gem::Requirement
135
107
  requirements:
136
- - - ">="
108
+ - - "~>"
137
109
  - !ruby/object:Gem::Version
138
- version: 5.0.0
110
+ version: '3.0'
139
111
  - !ruby/object:Gem::Dependency
140
112
  name: cucumber
141
113
  requirement: !ruby/object:Gem::Requirement
@@ -178,6 +150,20 @@ dependencies:
178
150
  - - ">="
179
151
  - !ruby/object:Gem::Version
180
152
  version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '1.28'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.28'
181
167
  - !ruby/object:Gem::Dependency
182
168
  name: webmock
183
169
  requirement: !ruby/object:Gem::Requirement
@@ -371,12 +357,13 @@ files:
371
357
  - lib/carrierwave/uploader/cache.rb
372
358
  - lib/carrierwave/uploader/callbacks.rb
373
359
  - lib/carrierwave/uploader/configuration.rb
374
- - lib/carrierwave/uploader/content_type_blacklist.rb
375
- - lib/carrierwave/uploader/content_type_whitelist.rb
360
+ - lib/carrierwave/uploader/content_type_allowlist.rb
361
+ - lib/carrierwave/uploader/content_type_denylist.rb
376
362
  - lib/carrierwave/uploader/default_url.rb
363
+ - lib/carrierwave/uploader/dimension.rb
377
364
  - lib/carrierwave/uploader/download.rb
378
- - lib/carrierwave/uploader/extension_blacklist.rb
379
- - lib/carrierwave/uploader/extension_whitelist.rb
365
+ - lib/carrierwave/uploader/extension_allowlist.rb
366
+ - lib/carrierwave/uploader/extension_denylist.rb
380
367
  - lib/carrierwave/uploader/file_size.rb
381
368
  - lib/carrierwave/uploader/mountable.rb
382
369
  - lib/carrierwave/uploader/processing.rb
@@ -387,10 +374,11 @@ files:
387
374
  - lib/carrierwave/uploader/url.rb
388
375
  - lib/carrierwave/uploader/versions.rb
389
376
  - lib/carrierwave/utilities.rb
377
+ - lib/carrierwave/utilities/file_name.rb
390
378
  - lib/carrierwave/utilities/uri.rb
391
379
  - lib/carrierwave/validations/active_model.rb
392
380
  - lib/carrierwave/version.rb
393
- - lib/generators/templates/uploader.rb
381
+ - lib/generators/templates/uploader.rb.erb
394
382
  - lib/generators/uploader_generator.rb
395
383
  homepage: https://github.com/carrierwaveuploader/carrierwave
396
384
  licenses:
@@ -405,7 +393,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
405
393
  requirements:
406
394
  - - ">="
407
395
  - !ruby/object:Gem::Version
408
- version: 2.2.2
396
+ version: 2.5.0
409
397
  required_rubygems_version: !ruby/object:Gem::Requirement
410
398
  requirements:
411
399
  - - ">="