carrierwave 3.1.0.rc → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5daf18958a06d91a53e10270049c75a1f93dcb8224e2dfb4511fc70d7bae5c2a
4
- data.tar.gz: c60177f496f73f8fe949d89bc3cb39bb62aa81b384091eaf566c492a0d53f4dd
3
+ metadata.gz: 558934b4dcea4b5aed9f60fe4cf4f87d3c1963e9f3e2a835117b226d01996462
4
+ data.tar.gz: 0d8933eafbc965bfd9f482f7978f5f45ff803115cc470a9e63eb05a41763b969
5
5
  SHA512:
6
- metadata.gz: 4c333ce7499ab4145df649e839ad40226d8338999b4ff624a884ffc07f253592000704b7f7cd090696602c29dcd1109e8a2aa1482c83dced511479d78cb0b650
7
- data.tar.gz: dab32ccd98121831f2a1f4eee30e2540b3f15f73b8fc8680189df3e673457cea8f1e2f5bbe1555abf3a7fd25d8f1acdb16d13fa4c3a29b82d78aca76a838a0bd
6
+ metadata.gz: 4852bd015f5bae013c9da67d48d121998e6a77d08dc52674b24ca96b276b5ce272bbdf480cc062f30159e1ef0b6a47e4ddbfc5659c575cd358e7000aca86029b
7
+ data.tar.gz: 75eaf047f5ec552fc0ede4acad3947671f1429a8e982044aceba6c6452a6c213eef7db14ef41c254762e3d74e7ed8e0c2d733026586c0d583b4e535185161cd2
@@ -51,7 +51,7 @@ module CarrierWave
51
51
  super
52
52
  @_mounters[:"#{column}"] = nil
53
53
  # The attribute needs to be cleared to prevent it from picked up as identifier
54
- write_attribute(_mounter(:#{column}).serialization_column, nil)
54
+ write_uploader(_mounter(:#{column}).serialization_column, nil)
55
55
  _mounter(:"#{column}").cache(old_uploaders)
56
56
  end
57
57
 
@@ -293,7 +293,7 @@ module CarrierWave
293
293
 
294
294
  ::MiniMagick::Image.new(current_path).identify
295
295
  rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
296
- raise e if e.message =~ /(You must have .+ installed|is not installed|executable not found)/
296
+ raise e if e.message =~ /(You must have .+ installed|is not installed|executable not found|delegate failed)/
297
297
  message = I18n.translate(:"errors.messages.processing_error")
298
298
  raise CarrierWave::ProcessingError, message
299
299
  ensure
@@ -1,5 +1,4 @@
1
1
  require 'pathname'
2
- require 'active_support/core_ext/string/multibyte'
3
2
  require 'marcel'
4
3
 
5
4
  module CarrierWave
@@ -129,24 +128,35 @@ module CarrierWave
129
128
  # [String] contents of the file
130
129
  #
131
130
  def read(*args)
132
- if @content
133
- if args.empty?
131
+ if args.empty?
132
+ if @content
134
133
  @content
134
+ elsif is_path?
135
+ File.open(@file, "rb") {|file| file.read }
135
136
  else
136
- length, outbuf = args
137
- raise ArgumentError, "outbuf argument not supported since the content is already loaded" if outbuf
138
- @content[0, length]
137
+ @file.try(:rewind)
138
+ @content = @file.read
139
+ @file.try(:close) unless @file.class.ancestors.include?(::StringIO) || @file.try(:closed?)
140
+ @content
139
141
  end
140
- elsif is_path?
141
- File.open(@file, "rb") {|file| file.read(*args)}
142
142
  else
143
- @file.try(:rewind)
144
- @content = @file.read(*args)
145
- @file.try(:close) unless @file.class.ancestors.include?(::StringIO) || @file.try(:closed?)
146
- @content
143
+ if is_path?
144
+ @file = File.open(path, "rb")
145
+ elsif @file.is_a?(CarrierWave::Uploader::Base)
146
+ @file = StringIO.new(@file.read)
147
+ end
148
+
149
+ @file.read(*args)
147
150
  end
148
151
  end
149
152
 
153
+ ##
154
+ # Rewinds the underlying file.
155
+ #
156
+ def rewind
157
+ @file.rewind if @file.respond_to?(:rewind)
158
+ end
159
+
150
160
  ##
151
161
  # Moves the file to the given path
152
162
  #
@@ -301,7 +311,7 @@ module CarrierWave
301
311
  name = name.gsub(sanitize_regexp, "_")
302
312
  name = "_#{name}" if name =~ /\A\.+\z/
303
313
  name = "unnamed" if name.size.zero?
304
- name.mb_chars.to_s
314
+ name.to_s
305
315
  end
306
316
 
307
317
  def declared_content_type
@@ -1,3 +1,3 @@
1
1
  module CarrierWave
2
- VERSION = "3.1.0.rc".freeze
2
+ VERSION = "3.1.1".freeze
3
3
  end
@@ -1,7 +1,8 @@
1
1
  class <%= class_name %>Uploader < CarrierWave::Uploader::Base
2
- # Include RMagick or MiniMagick support:
2
+ # Include RMagick, MiniMagick, or Vips support:
3
3
  # include CarrierWave::RMagick
4
4
  # include CarrierWave::MiniMagick
5
+ # include CarrierWave::Vips
5
6
 
6
7
  # Choose what kind of storage to use for this uploader:
7
8
  storage :file
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: 3.1.0.rc
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Nicklas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-07 00:00:00.000000000 Z
11
+ date: 2025-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -112,16 +112,16 @@ dependencies:
112
112
  name: cucumber
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: '2.3'
117
+ version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: '2.3'
124
+ version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rspec
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -382,11 +382,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
382
382
  version: 2.5.0
383
383
  required_rubygems_version: !ruby/object:Gem::Requirement
384
384
  requirements:
385
- - - ">"
385
+ - - ">="
386
386
  - !ruby/object:Gem::Version
387
- version: 1.3.1
387
+ version: '0'
388
388
  requirements: []
389
- rubygems_version: 3.4.10
389
+ rubygems_version: 3.5.22
390
390
  signing_key:
391
391
  specification_version: 4
392
392
  summary: Ruby file upload library