Hello community, here is the log from the commit of package rubygem-sprockets for openSUSE:Factory checked in at 2015-12-01 09:18:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-sprockets (Old) and /work/SRC/openSUSE:Factory/.rubygem-sprockets.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-sprockets" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-sprockets/rubygem-sprockets.changes 2015-10-08 08:25:00.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-sprockets.new/rubygem-sprockets.changes 2015-12-01 09:18:49.000000000 +0100 @@ -1,0 +2,10 @@ +Thu Nov 26 05:36:14 UTC 2015 - coolo@suse.com + +- updated to version 3.4.1 + see installed CHANGELOG.md + + **3.4.1** (November 25, 2015) + + * PathUtils::Entries will no longer error on an empty directory. + +------------------------------------------------------------------- Old: ---- sprockets-3.4.0.gem New: ---- sprockets-3.4.1.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-sprockets.spec ++++++ --- /var/tmp/diff_new_pack.qqsfrr/_old 2015-12-01 09:18:50.000000000 +0100 +++ /var/tmp/diff_new_pack.qqsfrr/_new 2015-12-01 09:18:50.000000000 +0100 @@ -24,7 +24,7 @@ # Name: rubygem-sprockets -Version: 3.4.0 +Version: 3.4.1 Release: 0 %define mod_name sprockets %define mod_full_name %{mod_name}-%{version} ++++++ sprockets-3.4.0.gem -> sprockets-3.4.1.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2015-10-05 19:48:23.000000000 +0200 +++ new/CHANGELOG.md 2015-11-25 18:53:36.000000000 +0100 @@ -1,3 +1,7 @@ +**3.4.1** (November 25, 2015) + +* PathUtils::Entries will no longer error on an empty directory. + **3.4.0** (October 5, 2015) * Expose method to override the sass cache in the SassProcessor. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2015-10-05 19:48:23.000000000 +0200 +++ new/README.md 2015-11-25 18:53:36.000000000 +0100 @@ -20,6 +20,44 @@ gem 'sprockets', '~> 3.0' ``` +## Behavior + +### Index files are proxies for folders + +In sprockets index files such as `index.js` or `index.css` files inside of a folder will generate a file with the folder's name. So if you have a `foo/index.js` file it will compile down to `foo.js`. This is similar to NPM's behavior of using [folders as modules](https://nodejs.org/api/modules.html#modules_folders_as_modules). It is also somewhat similar to the way that a file in `public/my_folder/index.html` can be reached by a request to `/my_folder`. This means that you cannot directly use an index file. For example this would not work: + +``` +<%= asset_path("foo/index.js") %> +``` + +Instead you would need to use: + +``` +<%= asset_path("foo.js") %> +``` + +Why would you want to use this behavior? It is common behavior where you might want to include an entire directory of files in a top level javascript. You can do this in sprockets using `require_tree .` + +``` +//= require_tree . +``` + +This has the problem that files are required alphabetically. If your directory has `jquery-ui.js` and `jquery.min.js` then sprockets will require `jquery-ui.js` before `jquery` is required which won't work (because jquery-ui depends on jquery). Previously the only way to get the correct ordering would be to rename your files, something like `0-jquery-ui.js`. Instead of doing that you can use an index file. + +For example, if you have an `application.js` and want all the files in the `foo/` folder you could do this: + +``` +//= require foo.js +``` + +Then create a file `foo/index.js` that requires all the files in that folder in any order you want: + +``` +//= require foo.min.js +//= require foo-ui.js +``` + +Now in your `application.js` will correctly load the `foo.min.js` before `foo-ui.js`. If you used `require_tree` it would not work correctly. ## Understanding the Sprockets Environment Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/path_utils.rb new/lib/sprockets/path_utils.rb --- old/lib/sprockets/path_utils.rb 2015-10-05 19:48:23.000000000 +0200 +++ new/lib/sprockets/path_utils.rb 2015-11-25 18:53:36.000000000 +0100 @@ -55,9 +55,11 @@ # Returns an empty `Array` if the directory does not exist. def entries(path) if File.directory?(path) - Dir.entries(path, :encoding => Encoding.default_internal).reject! { |entry| + entries = Dir.entries(path, :encoding => Encoding.default_internal) + entries.reject! { |entry| entry =~ /^\.|~$|^\#.*\#$/ - }.sort! + } + entries.sort! else [] 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 2015-10-05 19:48:23.000000000 +0200 +++ new/lib/sprockets/version.rb 2015-11-25 18:53:36.000000000 +0100 @@ -1,3 +1,3 @@ module Sprockets - VERSION = "3.4.0" + VERSION = "3.4.1" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2015-10-05 19:48:23.000000000 +0200 +++ new/metadata 2015-11-25 18:53:36.000000000 +0100 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: sprockets version: !ruby/object:Gem::Version - version: 3.4.0 + version: 3.4.1 platform: ruby authors: - Sam Stephenson @@ -9,7 +9,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2015-10-05 00:00:00.000000000 Z +date: 2015-11-25 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rack @@ -317,7 +317,7 @@ version: '0' requirements: [] rubyforge_project: sprockets -rubygems_version: 2.4.5.1 +rubygems_version: 2.5.0 signing_key: specification_version: 4 summary: Rack-based asset packaging system
participants (1)
-
root@hilbert.suse.de