Hello community,
here is the log from the commit of package rubygem-sprockets for
openSUSE:Factory checked in at 2020-06-25 15:11:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-sprockets (Old)
and /work/SRC/openSUSE:Factory/.rubygem-sprockets.new.3060 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-sprockets"
Thu Jun 25 15:11:05 2020 rev:39 rq:817014 version:4.0.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-sprockets/rubygem-sprockets.changes
2019-11-13 13:25:47.551539247 +0100
+++
/work/SRC/openSUSE:Factory/.rubygem-sprockets.new.3060/rubygem-sprockets.changes
2020-06-25 15:11:28.146126092 +0200
@@ -1,0 +2,7 @@
+Thu Jun 25 09:46:47 UTC 2020 - Manuel Schnitzer <[email protected]>
+
+- updated to version 4.0.2
+
+ * Fix `etag` and digest path compilation that were generating string with
invalid digest since 4.0.1.
+
+-------------------------------------------------------------------
Old:
----
sprockets-4.0.0.gem
New:
----
sprockets-4.0.2.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-sprockets.spec ++++++
--- /var/tmp/diff_new_pack.LCx0Ah/_old 2020-06-25 15:11:30.130132317 +0200
+++ /var/tmp/diff_new_pack.LCx0Ah/_new 2020-06-25 15:11:30.134132331 +0200
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-sprockets
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 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.0
+Version: 4.0.2
Release: 0
%define mod_name sprockets
%define mod_full_name %{mod_name}-%{version}
@@ -33,7 +33,7 @@
BuildRequires: %{rubygem gem2rpm}
BuildRequires: ruby-macros >= 5
BuildRequires: update-alternatives
-Url: https://github.com/rails/sprockets
+URL: https://github.com/rails/sprockets
Source: https://rubygems.org/gems/%{mod_full_name}.gem
Source1: gem2rpm.yml
Summary: Rack-based asset packaging system
++++++ sprockets-4.0.0.gem -> sprockets-4.0.2.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2019-10-08 19:04:54.000000000 +0200
+++ new/CHANGELOG.md 2020-06-05 21:05:32.000000000 +0200
@@ -2,7 +2,15 @@
Get upgrade notes from Sprockets 3.x to 4.x at
https://github.com/rails/sprockets/blob/master/UPGRADING.md
-## Master
+## 4.0.2
+
+- Fix `etag` and digest path compilation that were generating string with
invalid digest since 4.0.1.
+
+## 4.0.1
+
+- Fix for Ruby 2.7 keyword arguments warning in `base.rb`.
[#660](https://github.com/rails/sprockets/pull/660)
+- Fix for when `x_sprockets_linecount` is missing from a source map.
+- Fix subresource integrity to match the digest of the asset.
## 4.0.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2019-10-08 19:04:54.000000000 +0200
+++ new/README.md 2020-06-05 21:05:32.000000000 +0200
@@ -115,9 +115,9 @@
- [`require_self`](#require_self) - Change order of where current contents are
concatenated to current
- [`require_directory`](#require_directory) - Add contents of each file in a
folder to current
- [`require_tree`](#require_tree) - Add contents of all files in all
directories in a path to current
-- [`link`](#link) - Make target file compile and be publically available
without adding contents to current
-- [`link_directory`](#link_directory) - Make target directory compile and be
publically available without adding contents to current
-- [`link_tree`](#link_tree) - Make target tree compile and be publically
available without adding contents to current
+- [`link`](#link) - Make target file compile and be publicly available without
adding contents to current
+- [`link_directory`](#link_directory) - Make target directory compile and be
publicly available without adding contents to current
+- [`link_tree`](#link_tree) - Make target tree compile and be publicly
available without adding contents to current
- [`depend_on`](#depend_on) - Recompile current file if target has changed
- [`stub`](#stub) - Ignore target file
@@ -363,37 +363,70 @@
### link
`link` *path* declares a dependency on the target *path* and adds it to a list
-of subdependencies to automatically be compiled when the asset is written out
to
+of subdependencies to be compiled when the asset is written out to
disk.
Example:
-If you've got a `manifest.js` file and you want to explicitly make sure an
`admin.js` file is
-generated and made available to the public you can link it like this:
+If you've got a `manifest.js` file and you want to specify that a `admin.js`
source file should be
+generated and made available to the public you can link it by including this
in the `manifest.js` file:
```
//= link admin.js
```
+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
+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.
+
### link_directory
-`link_directory` *path* links all the files inside the directory specified by
the *path*
+`link_directory` *path* links all the files inside the directory specified by
the *path*. By "link", we mean they are specified as compilation targets to be
written out to disk, and made available to be served to user-agents.
+
+Files in subdirectories will not be linked (Compare to
[link_tree](#link_tree)).
+
+The *path* argument to `link_directory` is _not_ a logical path (it does not
use the asset load paths), but is a path relative to the file the
`link_directory` directive is found in, and can use `..` to . For instance,
you might want:
+
+```js
+//= link_directory ../stylesheets
+```
+
+`link_directory` can take an optional second argument with an extension or
content-type, with the
+two arguments separated by a space:
+
+```js
+//= link_directory ../stylesheets text/css
+//= link_directory ../more_stylesheets .css
+```
+
+This will limit the matching files to link to only files recognized as that
type. An extension is
+just a shortcut for the type referenced, it does not need to match the source
file exactly, but
+instead identifies the content-type the source file must be recognized as.
### link_tree
-`link_tree` *path* works like `link_directory`, but operates
+`link_tree` *path* works like [link_directory](#link_directory), but operates
recursively to link all files in all subdirectories of the
directory specified by *path*.
Example:
-You can specify a file extension so any extra files will be ignored:
+```js
+//= link_tree ./path/to/folder
+```
+
+Like `link_directory`, the argument is path relative to the current file, it
is *not* a 'logical path' tresolved against load paths.
+
+
+As with `link_directory`, you can also specify a second argument -- separated
by a space -- so any extra files not matching the content-type specified will
be ignored:
```js
-//= link_tree ./path/to/folder .js
+//= link_tree ./path/to/folder text/javascript
+//= link_tree ./path/to/other_folder .js
```
-> Note: There is an intentional space between the path and the extension
### depend_on
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/asset.rb new/lib/sprockets/asset.rb
--- old/lib/sprockets/asset.rb 2019-10-08 19:04:54.000000000 +0200
+++ new/lib/sprockets/asset.rb 2020-06-05 21:05:32.000000000 +0200
@@ -123,13 +123,26 @@
metadata[:digest]
end
+ # Private: Return the version of the environment where the asset was
generated.
+ def environment_version
+ metadata[:environment_version]
+ end
+
# Public: Returns String hexdigest of source.
def hexdigest
DigestUtils.pack_hexdigest(digest)
end
# Pubic: ETag String of Asset.
- alias_method :etag, :hexdigest
+ def etag
+ version = environment_version
+
+ if version && version != ""
+ DigestUtils.hexdigest(version + digest)
+ else
+ DigestUtils.pack_hexdigest(digest)
+ end
+ end
# Public: Returns String base64 digest of source.
def base64digest
@@ -138,7 +151,7 @@
# Public: A "named information" URL for subresource integrity.
def integrity
- DigestUtils.integrity_uri(metadata[:digest])
+ DigestUtils.integrity_uri(digest)
end
# Public: Add enumerator to allow `Asset` instances to be used as Rack
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/sprockets/base.rb new/lib/sprockets/base.rb
--- old/lib/sprockets/base.rb 2019-10-08 19:04:54.000000000 +0200
+++ new/lib/sprockets/base.rb 2020-06-05 21:05:32.000000000 +0200
@@ -115,8 +115,8 @@
#
# environment['application.js']
#
- def [](*args)
- find_asset(*args)
+ def [](*args, **options)
+ find_asset(*args, **options)
end
# Find asset by logical path or expanded path.
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 2019-10-08 19:04:54.000000000 +0200
+++ new/lib/sprockets/exporters/base.rb 2020-06-05 21:05:32.000000000 +0200
@@ -69,4 +69,3 @@
end
end
end
-
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 2019-10-08 19:04:54.000000000 +0200
+++ new/lib/sprockets/loader.rb 2020-06-05 21:05:32.000000000 +0200
@@ -195,14 +195,16 @@
source = result.delete(:data)
metadata = result
metadata[:charset] = source.encoding.name.downcase unless
metadata.key?(:charset)
- metadata[:digest] = digest(self.version + source)
+ metadata[:digest] = digest(source)
metadata[:length] = source.bytesize
+ metadata[:environment_version] = version
else
dependencies << build_file_digest_uri(unloaded.filename)
metadata = {
digest: file_digest(unloaded.filename),
length: self.stat(unloaded.filename).size,
- dependencies: dependencies
+ dependencies: dependencies,
+ environment_version: version,
}
end
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 2019-10-08 19:04:54.000000000
+0200
+++ new/lib/sprockets/source_map_utils.rb 2020-06-05 21:05:32.000000000
+0200
@@ -78,7 +78,7 @@
offset = 0
if a["sections"].count != 0 &&
!a["sections"].last["map"]["mappings"].empty?
last_line_count =
a["sections"].last["map"].delete("x_sprockets_linecount")
- offset += last_line_count
+ offset += last_line_count || 1
last_offset = a["sections"].last["offset"]["line"]
offset += last_offset
@@ -436,7 +436,7 @@
digit = BASE64_VALUES[str[i]]
raise ArgumentError unless digit
continuation = (digit & VLQ_CONTINUATION_BIT) != 0
- digit &= VLQ_CONTINUATION_BIT - 1
+ digit &= VLQ_BASE_MASK
value += digit << shift
if continuation
shift += VLQ_BASE_SHIFT
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 2019-10-08 19:04:54.000000000 +0200
+++ new/lib/sprockets/version.rb 2020-06-05 21:05:32.000000000 +0200
@@ -1,4 +1,4 @@
# frozen_string_literal: true
module Sprockets
- VERSION = "4.0.0"
+ VERSION = "4.0.2"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2019-10-08 19:04:54.000000000 +0200
+++ new/metadata 2020-06-05 21:05:32.000000000 +0200
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: sprockets
version: !ruby/object:Gem::Version
- version: 4.0.0
+ version: 4.0.2
platform: ruby
authors:
- Sam Stephenson
@@ -9,7 +9,7 @@
autorequire:
bindir: bin
cert_chain: []
-date: 2019-10-08 00:00:00.000000000 Z
+date: 2020-06-05 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: rack
@@ -437,7 +437,7 @@
- !ruby/object:Gem::Version
version: '0'
requirements: []
-rubygems_version: 3.0.3
+rubygems_version: 3.1.2
signing_key:
specification_version: 4
summary: Rack-based asset packaging system