Hello community,
here is the log from the commit of package rubygem-sprockets-rails for
openSUSE:Factory checked in at 2016-07-01 09:59:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-sprockets-rails (Old)
and /work/SRC/openSUSE:Factory/.rubygem-sprockets-rails.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-sprockets-rails"
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-sprockets-rails/rubygem-sprockets-rails.changes
2016-04-28 16:53:03.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-sprockets-rails.new/rubygem-sprockets-rails.changes
2016-07-01 09:59:14.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Jun 28 04:38:04 UTC 2016 - [email protected]
+
+- updated to version 3.1.0
+ no changelog found
+
+-------------------------------------------------------------------
Old:
----
sprockets-rails-3.0.4.gem
New:
----
sprockets-rails-3.1.0.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-sprockets-rails.spec ++++++
--- /var/tmp/diff_new_pack.C3slMX/_old 2016-07-01 09:59:15.000000000 +0200
+++ /var/tmp/diff_new_pack.C3slMX/_new 2016-07-01 09:59:15.000000000 +0200
@@ -24,7 +24,7 @@
#
Name: rubygem-sprockets-rails
-Version: 3.0.4
+Version: 3.1.0
Release: 0
%define mod_name sprockets-rails
%define mod_full_name %{mod_name}-%{version}
++++++ sprockets-rails-3.0.4.gem -> sprockets-rails-3.1.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2016-03-02 18:18:46.000000000 +0100
+++ new/README.md 2016-06-28 03:25:48.000000000 +0200
@@ -59,6 +59,9 @@
Add additional load paths to this Array. Rails includes `app/assets`,
`lib/assets` and `vendor/assets` for you already. Plugins might want to add
their custom paths to this.
+**`config.assets.quiet`**
+
+Suppresses logger output for asset requests. Uses the `config.assets.prefix`
path to match asset requests. Defaults to `false`.
**`config.assets.version`**
@@ -121,6 +124,10 @@
```
If the resolver list is empty (e.g. if debug is true and compile is false),
the standard rails public path resolution will be used.
+**`config.assets.check_precompiled_asset`**
+
+When enabled, an exception is raised for missing assets. This option is
enabled by default.
+
## Complementary plugins
The following plugins provide some extras for the Sprockets Asset Pipeline.
@@ -138,7 +145,7 @@
* JS and CSS compressors must be explicitly set. Magic detection has been
removed to avoid loading compressors in environments where you want to avoid
loading any of the asset libraries. Assign `config.assets.js_compressor =
:uglifier` or `config.assets.css_compressor = :sass` for the standard
compressors.
* The manifest file is now in a JSON format. Since it lives in public/ by
default, the initial filename is also randomized to obfuscate public access to
the resource.
* `config.assets.manifest` (if used) must now include the manifest filename,
e.g. `Rails.root.join('config/manifest.json')`. It cannot be a directory.
-* Two cleanup tasks. `rake assets:clean` is now a safe cleanup that only
removes older assets that are no longer used. While `rake assets:clobber` nukes
the entire `public/assets` directory and clears your filesystem cache. The
clean task allows for rolling deploys that may still be linking to an old asset
while the new assets are being built.
+* Two cleanup tasks: `rake assets:clean` is now a safe cleanup that only
removes older assets that are no longer used, while `rake assets:clobber` nukes
the entire `public/assets` directory. The clean task allows for rolling deploys
that may still be linking to an old asset while the new assets are being built.
## Experimental
@@ -151,6 +158,8 @@
# => "<script src="/assets/application.js"
integrity="sha256-TvVUHzSfftWg1rcfL6TIJ0XKEGrgLyEq6lEpcmrG9qs="></script>"
```
+Note that sprockets-rails only adds integrity hashes to assets when served in
a secure context (over an HTTPS connection or localhost).
+
## Contributing to Sprockets Rails
Files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/sprockets/rails/helper.rb
new/lib/sprockets/rails/helper.rb
--- old/lib/sprockets/rails/helper.rb 2016-03-02 18:18:46.000000000 +0100
+++ new/lib/sprockets/rails/helper.rb 2016-06-28 03:25:48.000000000 +0200
@@ -11,14 +11,10 @@
def initialize(source)
msg =
if using_sprockets4?
- "Asset `#{source}` was not declared to be precompiled in
production.\n" +
- "Declare links to your assets in `assets/config/manifest.js`.\n" +
- "Examples:\n" +
- "`//= link ../javascripts/application.js`\n" +
- "`//= link_directory ../javascripts .js`\n" +
- "`//= link_directory ../stylesheets .css`\n" +
- "`//= link_tree ../javascripts .js`\n" +
- "`//= link_tree ../images`\n"
+ "Asset `#{ source }` was not declared to be precompiled in
production.\n" +
+ "Declare links to your assets in
`app/assets/config/manifest.js`.\n\n" +
+ " //= link #{ source }\n" +
+ "and restart your server"
else
"Asset was not declared to be precompiled in production.\n" +
"Add `Rails.application.config.assets.precompile += " +
@@ -37,7 +33,7 @@
:assets_environment, :assets_manifest,
:assets_precompile, :precompiled_asset_checker,
:assets_prefix, :digest_assets, :debug_assets,
- :resolve_assets_with
+ :resolve_assets_with, :check_precompiled_asset
]
def self.included(klass)
@@ -196,7 +192,7 @@
# Only serve integrity metadata for HTTPS requests:
# http://www.w3.org/TR/SRI/#non-secure-contexts-remain-non-secure
def secure_subresource_integrity_context?
- respond_to?(:request) && self.request && self.request.ssl?
+ respond_to?(:request) && self.request && (self.request.local? ||
self.request.ssl?)
end
# Enable split asset debugging. Eventually will be deprecated
@@ -303,6 +299,7 @@
raise ArgumentError, 'config.assets.resolve_with includes
:environment, but app.assets is nil' unless view.assets_environment
@env = view.assets_environment
@precompiled_asset_checker = view.precompiled_asset_checker
+ @check_precompiled_asset = view.check_precompiled_asset
end
def asset_path(path, digest, allow_non_precompiled = false)
@@ -346,7 +343,7 @@
end
def raise_unless_precompiled_asset(path)
- raise Helper::AssetNotPrecompiled.new(path) unless
precompiled?(path)
+ raise Helper::AssetNotPrecompiled.new(path) if
@check_precompiled_asset && !precompiled?(path)
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/sprockets/rails/quiet_assets.rb
new/lib/sprockets/rails/quiet_assets.rb
--- old/lib/sprockets/rails/quiet_assets.rb 1970-01-01 01:00:00.000000000
+0100
+++ new/lib/sprockets/rails/quiet_assets.rb 2016-06-28 03:25:48.000000000
+0200
@@ -0,0 +1,18 @@
+module Sprockets
+ module Rails
+ class QuietAssets
+ def initialize(app)
+ @app = app
+ @assets_regex = %r(\A/{0,2}#{::Rails.application.config.assets.prefix})
+ end
+
+ def call(env)
+ if env['PATH_INFO'] =~ @assets_regex
+ ::Rails.logger.silence { @app.call(env) }
+ else
+ @app.call(env)
+ end
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/sprockets/rails/version.rb
new/lib/sprockets/rails/version.rb
--- old/lib/sprockets/rails/version.rb 2016-03-02 18:18:46.000000000 +0100
+++ new/lib/sprockets/rails/version.rb 2016-06-28 03:25:48.000000000 +0200
@@ -1,5 +1,5 @@
module Sprockets
module Rails
- VERSION = "3.0.4"
+ VERSION = "3.1.0"
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/sprockets/railtie.rb new/lib/sprockets/railtie.rb
--- old/lib/sprockets/railtie.rb 2016-03-02 18:18:46.000000000 +0100
+++ new/lib/sprockets/railtie.rb 2016-06-28 03:25:48.000000000 +0200
@@ -6,6 +6,7 @@
require 'sprockets'
require 'sprockets/rails/context'
require 'sprockets/rails/helper'
+require 'sprockets/rails/quiet_assets'
require 'sprockets/rails/route_wrapper'
require 'sprockets/rails/version'
require 'set'
@@ -66,6 +67,20 @@
class Railtie < ::Rails::Railtie
include Sprockets::Rails::Utils
+ class ManifestNeededError < StandardError
+ def initialize
+ msg = "Expected to find a manifest file in
`app/assets/config/manifest.js`\n" +
+ "But did not, please create this file and use it to link any assets
that need\n" +
+ "to be rendered by your app:\n\n" +
+ "Example:\n" +
+ " //= link_tree ../images\n" +
+ " //= link_directory ../javascripts .js\n" +
+ " //= link_directory ../stylesheets .css\n" +
+ "and restart your server"
+ super msg
+ end
+ end
+
LOOSE_APP_ASSETS = lambda do |logical_path, filename|
filename.start_with?(::Rails.root.join("app/assets").to_s) &&
!['.js', '.css', ''].include?(File.extname(logical_path))
@@ -80,18 +95,33 @@
config.assets = OrderedOptions.new
config.assets._blocks = []
config.assets.paths = []
+ config.assets.precompile = []
config.assets.prefix = "/assets"
config.assets.manifest = nil
- if using_sprockets4?
- config.assets.precompile = %w( manifest.js )
- else
- config.assets.precompile = [LOOSE_APP_ASSETS,
/(?:\/|\\|\A)application\.(css|js)$/]
+ config.assets.quiet = false
+
+ initializer :set_default_precompile do |app|
+ if using_sprockets4?
+ raise ManifestNeededError if
!::Rails.root.join("app/assets/config/manifest.js").exist?
+ app.config.assets.precompile += %w( manifest.js )
+ else
+ app.config.assets.precompile += [LOOSE_APP_ASSETS,
/(?:\/|\\|\A)application\.(css|js)$/]
+ end
+ end
+
+ initializer :quiet_assets do |app|
+ if app.config.assets.quiet
+ app.middleware.insert_before ::Rails::Rack::Logger,
::Sprockets::Rails::QuietAssets
+ end
end
+
config.assets.version = ""
config.assets.debug = false
config.assets.compile = true
config.assets.digest = true
config.assets.cache_limit = 50.megabytes
+ config.assets.gzip = true
+ config.assets.check_precompiled_asset = true
config.assets.configure do |env|
config.assets.paths.each { |path| env.append_path(path) }
@@ -124,6 +154,10 @@
env.version = config.assets.version
end
+ config.assets.configure do |env|
+ env.gzip = config.assets.gzip
+ end
+
rake_tasks do |app|
require 'sprockets/rails/task'
Sprockets::Rails::Task.new(app)
@@ -210,6 +244,8 @@
self.resolve_assets_with = config.assets.resolve_with
+ self.check_precompiled_asset = config.assets.check_precompiled_asset
+
# Expose the app precompiled asset check to the view
self.precompiled_asset_checker = -> logical_path {
app.asset_precompiled? logical_path }
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2016-03-02 18:18:46.000000000 +0100
+++ new/metadata 2016-06-28 03:25:48.000000000 +0200
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: sprockets-rails
version: !ruby/object:Gem::Version
- version: 3.0.4
+ version: 3.1.0
platform: ruby
authors:
- Joshua Peek
autorequire:
bindir: bin
cert_chain: []
-date: 2016-03-02 00:00:00.000000000 Z
+date: 2016-06-28 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: sprockets
@@ -119,6 +119,7 @@
- lib/sprockets/rails.rb
- lib/sprockets/rails/context.rb
- lib/sprockets/rails/helper.rb
+- lib/sprockets/rails/quiet_assets.rb
- lib/sprockets/rails/route_wrapper.rb
- lib/sprockets/rails/task.rb
- lib/sprockets/rails/utils.rb
@@ -144,7 +145,7 @@
version: '0'
requirements: []
rubyforge_project:
-rubygems_version: 2.5.1
+rubygems_version: 2.6.6
signing_key:
specification_version: 4
summary: Sprockets Rails integration