carrierwave 3.1.0 → 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:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 558934b4dcea4b5aed9f60fe4cf4f87d3c1963e9f3e2a835117b226d01996462
         | 
| 4 | 
            +
              data.tar.gz: 0d8933eafbc965bfd9f482f7978f5f45ff803115cc470a9e63eb05a41763b969
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 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 | 
            -
                       | 
| 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  | 
| 133 | 
            -
                    if  | 
| 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 | 
            -
                       | 
| 137 | 
            -
                       | 
| 138 | 
            -
                      @ | 
| 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 | 
            -
                     | 
| 144 | 
            -
             | 
| 145 | 
            -
                     | 
| 146 | 
            -
             | 
| 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. | 
| 314 | 
            +
                  name.to_s
         | 
| 305 315 | 
             
                end
         | 
| 306 316 |  | 
| 307 317 | 
             
                def declared_content_type
         | 
    
        data/lib/carrierwave/version.rb
    CHANGED
    
    
| @@ -1,7 +1,8 @@ | |
| 1 1 | 
             
            class <%= class_name %>Uploader < CarrierWave::Uploader::Base
         | 
| 2 | 
            -
              # Include RMagick or  | 
| 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. | 
| 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:  | 
| 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: ' | 
| 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: ' | 
| 124 | 
            +
                    version: '0'
         | 
| 125 125 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 126 126 | 
             
              name: rspec
         | 
| 127 127 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -386,7 +386,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 386 386 | 
             
                - !ruby/object:Gem::Version
         | 
| 387 387 | 
             
                  version: '0'
         | 
| 388 388 | 
             
            requirements: []
         | 
| 389 | 
            -
            rubygems_version: 3. | 
| 389 | 
            +
            rubygems_version: 3.5.22
         | 
| 390 390 | 
             
            signing_key:
         | 
| 391 391 | 
             
            specification_version: 4
         | 
| 392 392 | 
             
            summary: Ruby file upload library
         |