Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-sprockets for openSUSE:Factory checked in at 2022-03-11 21:41:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-sprockets (Old) and /work/SRC/openSUSE:Factory/.rubygem-sprockets.new.25692 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-sprockets" Fri Mar 11 21:41:42 2022 rev:40 rq:961080 version:4.0.3 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-sprockets/rubygem-sprockets.changes 2020-06-25 15:11:28.146126092 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-sprockets.new.25692/rubygem-sprockets.changes 2022-03-11 21:42:03.894107384 +0100 @@ -1,0 +2,11 @@ +Fri Mar 11 09:59:25 UTC 2022 - Manuel Schnitzer <mschnit...@suse.com> + +- updated to version 4.0.3 + + * Fix `Manifest#find` yielding from a Promise causing issue on Ruby 3.1.0-dev. [#720](https://github.com/rails/sprockets/pull/720) + * Better detect the ERB version to avoid deprecation warnings. [#719](https://github.com/rails/sprockets/pull/719) + * Allow assets already fingerprinted to be served through `Sprockets::Server` + * Do not fingerprint files that already contain a valid digest in their name + * Remove remaining support for Ruby < 2.4.[#672](https://github.com/rails/sprockets/pull/672) + +------------------------------------------------------------------- Old: ---- sprockets-4.0.2.gem New: ---- sprockets-4.0.3.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-sprockets.spec ++++++ --- /var/tmp/diff_new_pack.Dn64CA/_old 2022-03-11 21:42:04.358107740 +0100 +++ /var/tmp/diff_new_pack.Dn64CA/_new 2022-03-11 21:42:04.366107746 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-sprockets # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ # Name: rubygem-sprockets -Version: 4.0.2 +Version: 4.0.3 Release: 0 %define mod_name sprockets %define mod_full_name %{mod_name}-%{version} @@ -52,7 +52,7 @@ %install %gem_install \ --symlink-binaries \ - --doc-files="CHANGELOG.md README.md" \ + --doc-files="CHANGELOG.md MIT-LICENSE README.md" \ -f %gem_packages ++++++ sprockets-4.0.2.gem -> sprockets-4.0.3.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2020-06-05 21:05:32.000000000 +0200 +++ new/CHANGELOG.md 2022-03-02 21:47:19.000000000 +0100 @@ -2,6 +2,14 @@ Get upgrade notes from Sprockets 3.x to 4.x at https://github.com/rails/sprockets/blob/master/UPGRADING.md +## 4.0.3 + +- Fix `Manifest#find` yielding from a Promise causing issue on Ruby 3.1.0-dev. [#720](https://github.com/rails/sprockets/pull/720) +- Better detect the ERB version to avoid deprecation warnings. [#719](https://github.com/rails/sprockets/pull/719) +- Allow assets already fingerprinted to be served through `Sprockets::Server` +- Do not fingerprint files that already contain a valid digest in their name +- Remove remaining support for Ruby < 2.4.[#672](https://github.com/rails/sprockets/pull/672) + ## 4.0.2 - Fix `etag` and digest path compilation that were generating string with invalid digest since 4.0.1. @@ -23,7 +31,7 @@ ## 4.0.0.beta9 -- Minimum Ruby version for Sprockets 4 is now 2.5+ which matches minimum ruby verision of Rails [#604] +- Minimum Ruby version for Sprockets 4 is now 2.5+ which matches minimum ruby version of Rails [#604] - Fix threading bug introduced in Sprockets 4 [#603] - Warn when two potential manifest files exist. [#560] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MIT-LICENSE new/MIT-LICENSE --- old/MIT-LICENSE 1970-01-01 01:00:00.000000000 +0100 +++ new/MIT-LICENSE 2022-03-02 21:47:19.000000000 +0100 @@ -0,0 +1,21 @@ +Copyright (c) 2014-2019 Sam Stephenson +Copyright (c) 2014-2019 Joshua Peek + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2020-06-05 21:05:32.000000000 +0200 +++ new/README.md 2022-03-02 21:47:19.000000000 +0100 @@ -376,7 +376,7 @@ ``` The argument to `link` is a _logical path_, that is it will be resolved according to the -configured asset load paths. See [Accesing Assets](#accessing-assets) above. A path relative to +configured asset load paths. See [Accessing Assets](#accessing-assets) above. A path relative to the current file won't work, it must be a logical path. **Caution**: the "link" directive should always have an explicit extension on the end. @@ -606,19 +606,19 @@ In Rails you will specify them with: ```ruby -config.assets.js_compressor = :uglify +config.assets.js_compressor = :terser config.assets.css_compressor = :scss ``` If you're not using Rails, configure this directly on the "environment". ``` ruby -environment.js_compressor = :uglify +environment.js_compressor = :terser environment.css_compressor = :scss ``` If you are using Sprockets directly with a Rack app, don't forget to add -the `uglifier` and `sass` gems to your Gemfile when using above options. +the `terser` and `sass` gems to your Gemfile when using above options. ### Gzip Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/add_source_map_comment_to_asset_processor.rb new/lib/sprockets/add_source_map_comment_to_asset_processor.rb --- old/lib/sprockets/add_source_map_comment_to_asset_processor.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/add_source_map_comment_to_asset_processor.rb 2022-03-02 21:47:19.000000000 +0100 @@ -14,7 +14,7 @@ # information that is needed to build a source map file. # # To add this comment we must have an asset we can link to. - # To do this we ensure that the original aset is loaded, then + # To do this we ensure that the original asset is loaded, then # we use a use a special mime type. For example `application/js-sourcemap+json` # for a JS source map. # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/asset.rb new/lib/sprockets/asset.rb --- old/lib/sprockets/asset.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/asset.rb 2022-03-02 21:47:19.000000000 +0100 @@ -6,7 +6,7 @@ class Asset attr_reader :logical_path - # Private: Intialize Asset wrapper from attributes Hash. + # Private: Initialize Asset wrapper from attributes Hash. # # Asset wrappers should not be initialized directly, only # Environment#find_asset should vend them. @@ -38,7 +38,7 @@ # # The API status of the keys is dependent on the pipeline processors # itself. So some values maybe considered public and others internal. - # See the pipeline proccessor documentation itself. + # See the pipeline processor documentation itself. # # Returns Hash. attr_reader :metadata @@ -53,7 +53,7 @@ # Public: Internal URI to lookup asset by. # - # NOT a publically accessible URL. + # NOT a publicly accessible URL. # # Returns URI. attr_reader :uri @@ -64,7 +64,11 @@ # # Returns String. def digest_path - logical_path.sub(/\.(\w+)$/) { |ext| "-#{etag}#{ext}" } + if DigestUtils.already_digested?(@name) + logical_path + else + logical_path.sub(/\.(\w+)$/) { |ext| "-#{etag}#{ext}" } + end end # Public: Return load path + logical path with digest spliced in. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/bower.rb new/lib/sprockets/bower.rb --- old/lib/sprockets/bower.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/bower.rb 2022-03-02 21:47:19.000000000 +0100 @@ -13,7 +13,7 @@ # load_path - String environment path # logical_path - String path relative to base # - # Returns candiate filenames. + # Returns candidate filenames. def resolve_alternates(load_path, logical_path) candidates, deps = super diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/bundle.rb new/lib/sprockets/bundle.rb --- old/lib/sprockets/bundle.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/bundle.rb 2022-03-02 21:47:19.000000000 +0100 @@ -10,7 +10,7 @@ # Uses pipeline metadata: # # :required - Ordered Set of asset URIs to prepend - # :stubbed - Set of asset URIs to substract from the required set. + # :stubbed - Set of asset URIs to subtract from the required set. # # Also see DirectiveProcessor. class Bundle diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/cache.rb new/lib/sprockets/cache.rb --- old/lib/sprockets/cache.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/cache.rb 2022-03-02 21:47:19.000000000 +0100 @@ -62,7 +62,7 @@ # Internal: Wrap a backend cache store. # # Always assign a backend cache store instance to Environment#cache= and - # use Environment#cache to retreive a wrapped interface. + # use Environment#cache to retrieve a wrapped interface. # # cache - A compatible backend cache store instance. def initialize(cache = nil, logger = self.class.default_logger) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/cached_environment.rb new/lib/sprockets/cached_environment.rb --- old/lib/sprockets/cached_environment.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/cached_environment.rb 2022-03-02 21:47:19.000000000 +0100 @@ -4,7 +4,7 @@ module Sprockets # `CachedEnvironment` is a special cached version of `Environment`. # - # The expection is that all of its file system methods are cached + # The exception is that all of its file system methods are cached # for the instances lifetime. This makes `CachedEnvironment` much faster. This # behavior is ideal in production environments where the file system # is immutable. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/coffee_script_processor.rb new/lib/sprockets/coffee_script_processor.rb --- old/lib/sprockets/coffee_script_processor.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/coffee_script_processor.rb 2022-03-02 21:47:19.000000000 +0100 @@ -6,7 +6,7 @@ # Processor engine class for the CoffeeScript compiler. # Depends on the `coffee-script` and `coffee-script-source` gems. # - # For more infomation see: + # For more information see: # # https://github.com/rails/ruby-coffee-script # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/configuration.rb new/lib/sprockets/configuration.rb --- old/lib/sprockets/configuration.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/configuration.rb 2022-03-02 21:47:19.000000000 +0100 @@ -59,9 +59,9 @@ # Deprecated: Assign a `Digest` implementation class. This maybe any Ruby # `Digest::` implementation such as `Digest::SHA256` or - # `Digest::MD5`. + # `Digest::SHA512`. # - # environment.digest_class = Digest::MD5 + # environment.digest_class = Digest::SHA512 # def digest_class=(klass) self.config = config.merge(digest_class: klass).freeze diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/context.rb new/lib/sprockets/context.rb --- old/lib/sprockets/context.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/context.rb 2022-03-02 21:47:19.000000000 +0100 @@ -2,6 +2,7 @@ require 'rack/utils' require 'set' require 'sprockets/errors' +require 'delegate' module Sprockets # They are typically accessed by ERB templates. You can mix in custom helpers @@ -210,7 +211,7 @@ # # NOTE: This helper is currently not implemented and should be # customized by the application. Though, in the future, some - # basics implemention may be provided with different methods that + # basic implementation may be provided with different methods that # are required to be overridden. def asset_path(path, options = {}) message = <<-EOS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/dependencies.rb new/lib/sprockets/dependencies.rb --- old/lib/sprockets/dependencies.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/dependencies.rb 2022-03-02 21:47:19.000000000 +0100 @@ -40,7 +40,7 @@ end end - # Public: Add environmental dependency inheirted by all assets. + # Public: Add environmental dependency inherited by all assets. # # uri - String dependency URI # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/digest_utils.rb new/lib/sprockets/digest_utils.rb --- old/lib/sprockets/digest_utils.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/digest_utils.rb 2022-03-02 21:47:19.000000000 +0100 @@ -1,5 +1,4 @@ # frozen_string_literal: true -require 'digest/md5' require 'digest/sha1' require 'digest/sha2' require 'set' @@ -19,7 +18,6 @@ # Internal: Maps digest bytesize to the digest class. DIGEST_SIZES = { - 16 => Digest::MD5, 20 => Digest::SHA1, 32 => Digest::SHA256, 48 => Digest::SHA384, @@ -68,18 +66,8 @@ Encoding => ->(val, digest) { digest << 'Encoding'.freeze digest << val.name - }, - } - if 0.class != Integer # Ruby < 2.4 - ADD_VALUE_TO_DIGEST[Fixnum] = ->(val, digest) { - digest << 'Integer'.freeze - digest << val.to_s - } - ADD_VALUE_TO_DIGEST[Bignum] = ->(val, digest) { - digest << 'Integer'.freeze - digest << val.to_s } - end + } ADD_VALUE_TO_DIGEST.compare_by_identity.rehash @@ -189,6 +177,15 @@ integrity_uri(unpack_hexdigest(hexdigest)) end + # Internal: Checks an asset name for a valid digest + # + # name - The name of the asset + # + # Returns true if the name contains a digest like string and .digested before the extension + def already_digested?(name) + return name =~ /-([0-9a-f]{7,128})\.digested/ + end + private def build_digest(obj) digest = digest_class.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/eco_processor.rb new/lib/sprockets/eco_processor.rb --- old/lib/sprockets/eco_processor.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/eco_processor.rb 2022-03-02 21:47:19.000000000 +0100 @@ -4,7 +4,7 @@ module Sprockets # Processor engine class for the Eco compiler. Depends on the `eco` gem. # - # For more infomation see: + # For more information see: # # https://github.com/sstephenson/ruby-eco # https://github.com/sstephenson/eco diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/ejs_processor.rb new/lib/sprockets/ejs_processor.rb --- old/lib/sprockets/ejs_processor.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/ejs_processor.rb 2022-03-02 21:47:19.000000000 +0100 @@ -4,7 +4,7 @@ module Sprockets # Processor engine class for the EJS compiler. Depends on the `ejs` gem. # - # For more infomation see: + # For more information see: # # https://github.com/sstephenson/ruby-ejs # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/erb_processor.rb new/lib/sprockets/erb_processor.rb --- old/lib/sprockets/erb_processor.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/erb_processor.rb 2022-03-02 21:47:19.000000000 +0100 @@ -18,8 +18,7 @@ end def call(input) - match = ERB.version.match(/\Aerb\.rb \[(?<version>[^ ]+) /) - if match && match[:version] >= "2.2.0" # Ruby 2.6+ + if keyword_constructor? # Ruby 2.6+ engine = ::ERB.new(input[:data], trim_mode: '<>') else engine = ::ERB.new(input[:data], nil, '<>') @@ -34,4 +33,11 @@ data = engine.result(context.instance_eval('binding')) context.metadata.merge(data: data) end + + private + + def keyword_constructor? + return @keyword_constructor if defined? @keyword_constructor + @keyword_constructor = ::ERB.instance_method(:initialize).parameters.include?([:key, :trim_mode]) + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/exporters/base.rb new/lib/sprockets/exporters/base.rb --- old/lib/sprockets/exporters/base.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/exporters/base.rb 2022-03-02 21:47:19.000000000 +0100 @@ -1,6 +1,6 @@ module Sprockets module Exporters - # Convienence class for all exporters to inherit from + # Convenience class for all exporters to inherit from # # An exporter is responsible for exporting a Sprockets::Asset # to a file system. For example the Exporters::File class @@ -29,7 +29,7 @@ setup end - # Public: Callback that is executed after intialization + # Public: Callback that is executed after initialization # # Any setup that needs to be done can be performed in the +setup+ # method. It will be called immediately after initialization. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/loader.rb new/lib/sprockets/loader.rb --- old/lib/sprockets/loader.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/loader.rb 2022-03-02 21:47:19.000000000 +0100 @@ -291,7 +291,7 @@ # Internal: Retrieves an asset based on its digest # # unloaded - An UnloadedAsset - # limit - A Fixnum which sets the maximum number of versions of "histories" + # limit - An Integer which sets the maximum number of versions of "histories" # stored in the cache # # This method attempts to retrieve the last `limit` number of histories of an asset diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/manifest.rb new/lib/sprockets/manifest.rb --- old/lib/sprockets/manifest.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/manifest.rb 2022-03-02 21:47:19.000000000 +0100 @@ -15,7 +15,7 @@ # The JSON is part of the public API and should be considered stable. This # should make it easy to read from other programming languages and processes # that don't have sprockets loaded. See `#assets` and `#files` for more - # infomation about the structure. + # information about the structure. class Manifest include ManifestUtils @@ -112,7 +112,7 @@ # Public: Find all assets matching pattern set in environment. # # Returns Enumerator of Assets. - def find(*args) + def find(*args, &block) unless environment raise Error, "manifest requires environment for compilation" end @@ -122,12 +122,13 @@ environment = self.environment.cached promises = args.flatten.map do |path| Concurrent::Promise.execute(executor: executor) do - environment.find_all_linked_assets(path) do |asset| - yield asset - end + environment.find_all_linked_assets(path).to_a end end - promises.each(&:wait!) + + promises.each do |promise| + promise.value!.each(&block) + end nil end @@ -273,7 +274,7 @@ nil end - # Persist manfiest back to FS + # Persist manifest back to FS def save data = json_encode(@data) FileUtils.mkdir_p File.dirname(@filename) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/npm.rb new/lib/sprockets/npm.rb --- old/lib/sprockets/npm.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/npm.rb 2022-03-02 21:47:19.000000000 +0100 @@ -8,7 +8,7 @@ # load_path - String environment path # logical_path - String path relative to base # - # Returns candiate filenames. + # Returns candidate filenames. def resolve_alternates(load_path, logical_path) candidates, deps = super diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/processing.rb new/lib/sprockets/processing.rb --- old/lib/sprockets/processing.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/processing.rb 2022-03-02 21:47:19.000000000 +0100 @@ -130,7 +130,7 @@ # # mime_type - String MIME Type. Use '*/*' applies to all types. # key - Symbol metadata key - # initial - Initial memo to pass to the reduce funciton (default: nil) + # initial - Initial memo to pass to the reduce function (default: nil) # block - Proc accepting the memo accumulator and current value # # Returns nothing. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/processor_utils.rb new/lib/sprockets/processor_utils.rb --- old/lib/sprockets/processor_utils.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/processor_utils.rb 2022-03-02 21:47:19.000000000 +0100 @@ -6,7 +6,7 @@ # # A Processor is a general function that may modify or transform an asset as # part of the pipeline. CoffeeScript to JavaScript conversion, Minification - # or Concatenation are all implemented as seperate Processor steps. + # or Concatenation are all implemented as separate Processor steps. # # Processors maybe any object that responds to call. So procs or a class that # defines a self.call method. @@ -118,8 +118,9 @@ Symbol, TrueClass, FalseClass, - NilClass - ] + (0.class == Integer ? [Integer] : [Bignum, Fixnum])).freeze + NilClass, + Integer + ]).freeze # Internal: Set of all nested compound metadata types that can nest values. VALID_METADATA_COMPOUND_TYPES = Set.new([ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/sass_processor.rb new/lib/sprockets/sass_processor.rb --- old/lib/sprockets/sass_processor.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/sass_processor.rb 2022-03-02 21:47:19.000000000 +0100 @@ -7,7 +7,7 @@ module Sprockets # Processor engine class for the SASS/SCSS compiler. Depends on the `sass` gem. # - # For more infomation see: + # For more information see: # # https://github.com/sass/sass # https://github.com/rails/sass-rails diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/sassc_processor.rb new/lib/sprockets/sassc_processor.rb --- old/lib/sprockets/sassc_processor.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/sassc_processor.rb 2022-03-02 21:47:19.000000000 +0100 @@ -7,7 +7,7 @@ module Sprockets # Processor engine class for the SASS/SCSS compiler. Depends on the `sassc` gem. # - # For more infomation see: + # For more information see: # # https://github.com/sass/sassc-ruby # https://github.com/sass/sassc-rails diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/server.rb new/lib/sprockets/server.rb --- old/lib/sprockets/server.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/server.rb 2022-03-02 21:47:19.000000000 +0100 @@ -35,7 +35,8 @@ msg = "Served asset #{env['PATH_INFO']} -" # Extract the path from everything after the leading slash - path = Rack::Utils.unescape(env['PATH_INFO'].to_s.sub(/^\//, '')) + full_path = Rack::Utils.unescape(env['PATH_INFO'].to_s.sub(/^\//, '')) + path = full_path unless path.valid_encoding? return bad_request_response(env) @@ -64,6 +65,15 @@ # Look up the asset. asset = find_asset(path) + # Fallback to looking up the asset with the full path. + # This will make assets that are hashed with webpack or + # other js bundlers work consistently between production + # and development pipelines. + if asset.nil? && (asset = find_asset(full_path)) + if_match = asset.etag if fingerprint + fingerprint = asset.etag + end + if asset.nil? status = :not_found elsif fingerprint && asset.etag != fingerprint diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/source_map_processor.rb new/lib/sprockets/source_map_processor.rb --- old/lib/sprockets/source_map_processor.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/source_map_processor.rb 2022-03-02 21:47:19.000000000 +0100 @@ -9,7 +9,7 @@ # When a file is passed in it will have a `application/js-sourcemap+json` # or `application/css-sourcemap+json` mime type. The filename will be # match the original asset. The original asset is loaded. As it - # gets processed by Sprockets it will aquire all information + # gets processed by Sprockets it will acquire all information # needed to build a source map file in the `asset.to_hash[:metadata][:map]` # key. # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/source_map_utils.rb new/lib/sprockets/source_map_utils.rb --- old/lib/sprockets/source_map_utils.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/source_map_utils.rb 2022-03-02 21:47:19.000000000 +0100 @@ -140,7 +140,7 @@ } end - # Public: Combine two seperate source map transformations into a single + # Public: Combine two separate source map transformations into a single # mapping. # # Source transformations may happen in discrete steps producing separate @@ -453,7 +453,7 @@ # # ary - Two dimensional Array of Integers. # - # Returns a VLQ encoded String seperated by , and ;. + # Returns a VLQ encoded String separated by , and ;. def vlq_encode_mappings(ary) ary.map { |group| group.map { |segment| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/utils.rb new/lib/sprockets/utils.rb --- old/lib/sprockets/utils.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/utils.rb 2022-03-02 21:47:19.000000000 +0100 @@ -25,7 +25,7 @@ # Internal: Duplicate and store key/value on new frozen hash. # - # Seperated for recursive calls, always use hash_reassoc(hash, *keys). + # Separated for recursive calls, always use hash_reassoc(hash, *keys). # # hash - Hash # key - Object key @@ -132,6 +132,9 @@ mod.instance_methods.each do |sym| method = mod.instance_method(sym) + if base.method_defined?(sym) + base.send(:alias_method, sym, sym) + end base.send(:define_method, sym, method) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/version.rb new/lib/sprockets/version.rb --- old/lib/sprockets/version.rb 2020-06-05 21:05:32.000000000 +0200 +++ new/lib/sprockets/version.rb 2022-03-02 21:47:19.000000000 +0100 @@ -1,4 +1,4 @@ # frozen_string_literal: true module Sprockets - VERSION = "4.0.2" + VERSION = "4.0.3" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2020-06-05 21:05:32.000000000 +0200 +++ new/metadata 2022-03-02 21:47:19.000000000 +0100 @@ -1,15 +1,15 @@ --- !ruby/object:Gem::Specification name: sprockets version: !ruby/object:Gem::Version - version: 4.0.2 + version: 4.0.3 platform: ruby authors: - Sam Stephenson - Joshua Peek -autorequire: +autorequire: bindir: bin cert_chain: [] -date: 2020-06-05 00:00:00.000000000 Z +date: 2022-03-02 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rack @@ -336,6 +336,7 @@ extra_rdoc_files: [] files: - CHANGELOG.md +- MIT-LICENSE - README.md - bin/sprockets - lib/rake/sprocketstask.rb @@ -422,7 +423,7 @@ licenses: - MIT metadata: {} -post_install_message: +post_install_message: rdoc_options: [] require_paths: - lib @@ -437,8 +438,8 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubygems_version: 3.1.2 -signing_key: +rubygems_version: 3.2.32 +signing_key: specification_version: 4 summary: Rack-based asset packaging system test_files: []