carrierwave 3.1.0.beta → 3.1.0
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 +4 -4
- data/README.md +1 -1
- data/lib/carrierwave/mounter.rb +1 -0
- data/lib/carrierwave/processing/mini_magick.rb +1 -1
- data/lib/carrierwave/storage/fog.rb +19 -6
- data/lib/carrierwave/uploader/configuration.rb +2 -0
- data/lib/carrierwave/uploader/processing.rb +3 -0
- data/lib/carrierwave/uploader/versions.rb +5 -3
- data/lib/carrierwave/utilities/uri.rb +1 -1
- data/lib/carrierwave/version.rb +1 -1
- metadata +4 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 418e6b0903adc403510724ba7a5764e8edaa5b4bc96d5313e8f01572bf26ceac
         | 
| 4 | 
            +
              data.tar.gz: 0bbac560a7928ce059afccb2280a1f77d17c9bca418a3f471097a3e3375fc6d0
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 253d7d3f2e78fd169e347042c6eae2d5ab70f1383dc159988387215cb669ca905232817484f168816c21bcfb6733221a69c6ae02d7a463df920446ee53ae8efd
         | 
| 7 | 
            +
              data.tar.gz: 7640c8c67f2bb11025a42c9b05752a167a3da4d3452dc3359ffc51e5cb5ea8460fd23be401446734daa573e77f9a0639b7f2cf053288d8c5360e63907a80f08c
         | 
    
        data/README.md
    CHANGED
    
    | @@ -1027,7 +1027,7 @@ end | |
| 1027 1027 | 
             
            ### List of available processing methods:
         | 
| 1028 1028 |  | 
| 1029 1029 | 
             
            > [!NOTE]
         | 
| 1030 | 
            -
            > While the intention is to provide uniform interfaces to  | 
| 1030 | 
            +
            > While the intention is to provide uniform interfaces to all three processing libraries the availability and implementation of processing methods can <a href="supported-processing-methods">vary slightly between them</a>.
         | 
| 1031 1031 |  | 
| 1032 1032 | 
             
            - `convert` - Changes the image encoding format to the given format (eg. jpg). This operation is treated specially to trigger the change of the file extension, so it matches with the format of the resulting file.
         | 
| 1033 1033 | 
             
            - `resize_to_limit` - Resize the image to fit within the specified dimensions while retaining the original aspect ratio. Will only resize the image if it is larger than the specified dimensions. The resulting image may be shorter or narrower than specified in the smaller dimension but will not be larger than the specified values.
         | 
    
        data/lib/carrierwave/mounter.rb
    CHANGED
    
    
| @@ -291,7 +291,7 @@ module CarrierWave | |
| 291 291 | 
             
                  image = yield(image)
         | 
| 292 292 | 
             
                  FileUtils.mv image.path, current_path
         | 
| 293 293 |  | 
| 294 | 
            -
                   | 
| 294 | 
            +
                  ::MiniMagick::Image.new(current_path).identify
         | 
| 295 295 | 
             
                rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
         | 
| 296 296 | 
             
                  raise e if e.message =~ /(You must have .+ installed|is not installed|executable not found)/
         | 
| 297 297 | 
             
                  message = I18n.translate(:"errors.messages.processing_error")
         | 
| @@ -18,6 +18,8 @@ module CarrierWave | |
| 18 18 | 
             
                # [:fog_use_ssl_for_aws]              (optional) #public_url will use https for the AWS generated URL]
         | 
| 19 19 | 
             
                # [:fog_aws_accelerate]               (optional) #public_url will use s3-accelerate subdomain
         | 
| 20 20 | 
             
                #   instead of s3, defaults to false
         | 
| 21 | 
            +
                # [:fog_aws_fips]                     (optional) #public_url will use s3-fips subdomain
         | 
| 22 | 
            +
                #   instead of s3, defaults to false
         | 
| 21 23 | 
             
                #
         | 
| 22 24 | 
             
                #
         | 
| 23 25 | 
             
                # AWS credentials contain the following keys:
         | 
| @@ -309,6 +311,15 @@ module CarrierWave | |
| 309 311 | 
             
                      file.nil? ? 0 : file.content_length
         | 
| 310 312 | 
             
                    end
         | 
| 311 313 |  | 
| 314 | 
            +
                    ##
         | 
| 315 | 
            +
                    # === Returns
         | 
| 316 | 
            +
                    #
         | 
| 317 | 
            +
                    # [Boolean] whether the file is non-existent or empty
         | 
| 318 | 
            +
                    #
         | 
| 319 | 
            +
                    def empty?
         | 
| 320 | 
            +
                      !exists? || size.zero?
         | 
| 321 | 
            +
                    end
         | 
| 322 | 
            +
             | 
| 312 323 | 
             
                    ##
         | 
| 313 324 | 
             
                    # Check if the file exists on the remote service
         | 
| 314 325 | 
             
                    #
         | 
| @@ -365,6 +376,7 @@ module CarrierWave | |
| 365 376 | 
             
                        when 'AWS'
         | 
| 366 377 | 
             
                          # check if some endpoint is set in fog_credentials
         | 
| 367 378 | 
             
                          if @uploader.fog_credentials.has_key?(:endpoint)
         | 
| 379 | 
            +
                            raise 'fog_aws_fips = true is incompatible with :endpoint, as FIPS endpoints do not support path-style URLs.' if @uploader.fog_aws_fips
         | 
| 368 380 | 
             
                            "#{@uploader.fog_credentials[:endpoint]}/#{@uploader.fog_directory}/#{encoded_path}"
         | 
| 369 381 | 
             
                          else
         | 
| 370 382 | 
             
                            protocol = @uploader.fog_use_ssl_for_aws ? "https" : "http"
         | 
| @@ -374,17 +386,18 @@ module CarrierWave | |
| 374 386 | 
             
                            use_virtual_hosted_style = @uploader.fog_directory.to_s =~ subdomain_regex && !(protocol == 'https' && @uploader.fog_directory =~ /\./)
         | 
| 375 387 |  | 
| 376 388 | 
             
                            region = @uploader.fog_credentials[:region].to_s
         | 
| 377 | 
            -
                            regional_host =  | 
| 378 | 
            -
             | 
| 379 | 
            -
             | 
| 380 | 
            -
             | 
| 381 | 
            -
             | 
| 382 | 
            -
             | 
| 389 | 
            +
                            regional_host = 's3.amazonaws.com' # used for DEFAULT_S3_REGION or no region set
         | 
| 390 | 
            +
                            if @uploader.fog_aws_fips
         | 
| 391 | 
            +
                              regional_host = "s3-fips.#{region}.amazonaws.com" # https://aws.amazon.com/compliance/fips/
         | 
| 392 | 
            +
                            elsif ![DEFAULT_S3_REGION, ''].include?(region)
         | 
| 393 | 
            +
                              regional_host = "s3.#{region}.amazonaws.com"
         | 
| 394 | 
            +
                            end
         | 
| 383 395 |  | 
| 384 396 | 
             
                            if use_virtual_hosted_style
         | 
| 385 397 | 
             
                              regional_host = 's3-accelerate.amazonaws.com' if @uploader.fog_aws_accelerate
         | 
| 386 398 | 
             
                              "#{protocol}://#{@uploader.fog_directory}.#{regional_host}/#{encoded_path}"
         | 
| 387 399 | 
             
                            else # directory is not a valid subdomain, so use path style for access
         | 
| 400 | 
            +
                              raise 'FIPS Endpoints can only be used with Virtual Hosted-Style addressing.' if @uploader.fog_aws_fips
         | 
| 388 401 | 
             
                              "#{protocol}://#{regional_host}/#{@uploader.fog_directory}/#{encoded_path}"
         | 
| 389 402 | 
             
                            end
         | 
| 390 403 | 
             
                          end
         | 
| @@ -35,6 +35,7 @@ module CarrierWave | |
| 35 35 | 
             
                    add_config :fog_authenticated_url_expiration
         | 
| 36 36 | 
             
                    add_config :fog_use_ssl_for_aws
         | 
| 37 37 | 
             
                    add_config :fog_aws_accelerate
         | 
| 38 | 
            +
                    add_config :fog_aws_fips
         | 
| 38 39 |  | 
| 39 40 | 
             
                    # Mounting
         | 
| 40 41 | 
             
                    add_config :ignore_integrity_errors
         | 
| @@ -197,6 +198,7 @@ module CarrierWave | |
| 197 198 | 
             
                        config.fog_authenticated_url_expiration = 600
         | 
| 198 199 | 
             
                        config.fog_use_ssl_for_aws = true
         | 
| 199 200 | 
             
                        config.fog_aws_accelerate = false
         | 
| 201 | 
            +
                        config.fog_aws_fips = false
         | 
| 200 202 | 
             
                        config.store_dir = 'uploads'
         | 
| 201 203 | 
             
                        config.cache_dir = 'uploads/tmp'
         | 
| 202 204 | 
             
                        config.delete_tmp_file_after_storage = true
         | 
| @@ -70,6 +70,9 @@ module CarrierWave | |
| 70 70 | 
             
                        if processor == :convert
         | 
| 71 71 | 
             
                          # Treat :convert specially, since it should trigger the file extension change
         | 
| 72 72 | 
             
                          force_extension processor_args
         | 
| 73 | 
            +
                          if condition
         | 
| 74 | 
            +
                            warn "Use of 'process convert: format' with conditionals has an issue and doesn't work correctly. See https://github.com/carrierwaveuploader/carrierwave/issues/2723 for details. "
         | 
| 75 | 
            +
                          end
         | 
| 73 76 | 
             
                        end
         | 
| 74 77 | 
             
                      end
         | 
| 75 78 | 
             
                    end
         | 
| @@ -196,9 +196,9 @@ module CarrierWave | |
| 196 196 | 
             
                  #
         | 
| 197 197 | 
             
                  # === Returns
         | 
| 198 198 | 
             
                  #
         | 
| 199 | 
            -
                  # [Boolean] True when the version  | 
| 199 | 
            +
                  # [Boolean] True when the version satisfy its :if or :unless condition
         | 
| 200 200 | 
             
                  #
         | 
| 201 | 
            -
                  def  | 
| 201 | 
            +
                  def version_active?(name)
         | 
| 202 202 | 
             
                    name = name.to_sym
         | 
| 203 203 |  | 
| 204 204 | 
             
                    return false unless versions.has_key?(name)
         | 
| @@ -222,6 +222,8 @@ module CarrierWave | |
| 222 222 | 
             
                      true
         | 
| 223 223 | 
             
                    end
         | 
| 224 224 | 
             
                  end
         | 
| 225 | 
            +
                  alias_method :version_exists?, :version_active?
         | 
| 226 | 
            +
                  CarrierWave.deprecator.deprecate_methods(self, version_exists?: :version_active?)
         | 
| 225 227 |  | 
| 226 228 | 
             
                  ##
         | 
| 227 229 | 
             
                  # Copies the parent's cache_id when caching a version file.
         | 
| @@ -299,7 +301,7 @@ module CarrierWave | |
| 299 301 |  | 
| 300 302 | 
             
                  def active_versions
         | 
| 301 303 | 
             
                    versions.select do |name, uploader|
         | 
| 302 | 
            -
                       | 
| 304 | 
            +
                      version_active?(name)
         | 
| 303 305 | 
             
                    end
         | 
| 304 306 | 
             
                  end
         | 
| 305 307 |  | 
| @@ -4,7 +4,7 @@ module CarrierWave | |
| 4 4 | 
             
              module Utilities
         | 
| 5 5 | 
             
                module Uri
         | 
| 6 6 | 
             
                  # based on Ruby < 2.0's URI.encode
         | 
| 7 | 
            -
                  PATH_SAFE = URI:: | 
| 7 | 
            +
                  PATH_SAFE = URI::RFC2396_REGEXP::PATTERN::UNRESERVED + '\/'
         | 
| 8 8 | 
             
                  PATH_UNSAFE = Regexp.new("[^#{PATH_SAFE}]", false)
         | 
| 9 9 | 
             
                  NON_ASCII = /[^[:ascii:]]/.freeze
         | 
| 10 10 |  | 
    
        data/lib/carrierwave/version.rb
    CHANGED
    
    
    
        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 | 
| 4 | 
            +
              version: 3.1.0
         | 
| 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- | 
| 11 | 
            +
            date: 2024-12-14 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activesupport
         | 
| @@ -382,9 +382,9 @@ 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:  | 
| 387 | 
            +
                  version: '0'
         | 
| 388 388 | 
             
            requirements: []
         | 
| 389 389 | 
             
            rubygems_version: 3.4.10
         | 
| 390 390 | 
             
            signing_key:
         |