Hello community, here is the log from the commit of package rubygem-sprockets for openSUSE:Factory checked in at 2016-07-01 09:59:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2016-04-28 16:56:49.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-sprockets.new/rubygem-sprockets.changes 2016-07-01 09:59:16.000000000 +0200 @@ -1,0 +2,10 @@ +Sat Jun 18 04:36:58 UTC 2016 - co...@suse.com + +- updated to version 3.6.1 + see installed CHANGELOG.md + + **3.6.1** (June 17, 2016) + + * Some performance improvements. + +------------------------------------------------------------------- Old: ---- sprockets-3.6.0.gem New: ---- sprockets-3.6.1.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-sprockets.spec ++++++ --- /var/tmp/diff_new_pack.g70nM1/_old 2016-07-01 09:59:17.000000000 +0200 +++ /var/tmp/diff_new_pack.g70nM1/_new 2016-07-01 09:59:17.000000000 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-sprockets -Version: 3.6.0 +Version: 3.6.1 Release: 0 %define mod_name sprockets %define mod_full_name %{mod_name}-%{version} ++++++ sprockets-3.6.0.gem -> sprockets-3.6.1.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2016-04-06 20:20:58.000000000 +0200 +++ new/CHANGELOG.md 2016-06-17 17:43:43.000000000 +0200 @@ -1,3 +1,7 @@ +**3.6.1** (June 17, 2016) + +* Some performance improvements. + **3.6.0** (April 6, 2016) * Add `Manifest#find_sources` to return the source of the compiled assets. Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/cache/file_store.rb new/lib/sprockets/cache/file_store.rb --- old/lib/sprockets/cache/file_store.rb 2016-04-06 20:20:58.000000000 +0200 +++ new/lib/sprockets/cache/file_store.rb 2016-06-17 17:43:43.000000000 +0200 @@ -36,7 +36,6 @@ # (default: 1000). def initialize(root, max_size = DEFAULT_MAX_SIZE, logger = self.class.default_logger) @root = root - @size = find_caches.inject(0) { |n, (_, stat)| n + stat.size } @max_size = max_size @gc_size = max_size * 0.75 @logger = logger @@ -107,11 +106,11 @@ # Write data PathUtils.atomic_write(path) do |f| f.write(raw) - @size += f.size unless exists + @size = size + f.size unless exists end # GC if necessary - gc! if @size > @max_size + gc! if size > @max_size value end @@ -120,7 +119,7 @@ # # Returns String. def inspect - "#<#{self.class} size=#{@size}/#{@max_size}>" + "#<#{self.class} size=#{size}/#{@max_size}>" end private @@ -138,6 +137,10 @@ }.sort_by { |_, stat| stat.mtime.to_i } end + def size + @size ||= compute_size(find_caches) + end + def compute_size(caches) caches.inject(0) { |sum, (_, stat)| sum + stat.size } end 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 2016-04-06 20:20:58.000000000 +0200 +++ new/lib/sprockets/path_utils.rb 2016-06-17 17:43:43.000000000 +0200 @@ -55,7 +55,9 @@ if File.directory?(path) entries = Dir.entries(path, :encoding => Encoding.default_internal) entries.reject! { |entry| - entry =~ /^\.|~$|^\#.*\#$/ + entry.start_with?(".".freeze) || + (entry.start_with?("#".freeze) && entry.end_with?("#".freeze)) || + entry.end_with?("~".freeze) } entries.sort! else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/sprockets/uri_tar.rb new/lib/sprockets/uri_tar.rb --- old/lib/sprockets/uri_tar.rb 2016-04-06 20:20:58.000000000 +0200 +++ new/lib/sprockets/uri_tar.rb 2016-06-17 17:43:43.000000000 +0200 @@ -14,10 +14,8 @@ @env = env uri = uri.to_s if uri.include?("://".freeze) - uri_array = uri.split("://".freeze) - @scheme = uri_array.shift - @scheme << "://".freeze - @path = uri_array.join("".freeze) + @scheme, _, @path = uri.partition("://".freeze) + @scheme << "://".freeze else @scheme = "".freeze @path = uri 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 2016-04-06 20:20:58.000000000 +0200 +++ new/lib/sprockets/utils.rb 2016-06-17 17:43:43.000000000 +0200 @@ -74,16 +74,19 @@ def string_end_with_semicolon?(str) i = str.size - 1 while i >= 0 - c = str[i] + c = str[i].ord i -= 1 - if c == "\n" || c == " " || c == "\t" - next - elsif c != ";" - return false - else - return true + + # Need to compare against the ordinals because the string can be UTF_8 or UTF_32LE encoded + # 0x0A == "\n" + # 0x20 == " " + # 0x09 == "\t" + # 0x3B == ";" + unless c == 0x0A || c == 0x20 || c == 0x09 + return c === 0x3B end end + true end @@ -95,11 +98,21 @@ # # Returns buf String. def concat_javascript_sources(buf, source) - if buf.bytesize > 0 - buf << ";" unless string_end_with_semicolon?(buf) - buf << "\n" unless buf.end_with?("\n") + if source.bytesize > 0 + buf << source + + # If the source contains non-ASCII characters, indexing on it becomes O(N). + # This will lead to O(N^2) performance in string_end_with_semicolon?, so we should use 32 bit encoding to make sure indexing stays O(1) + source = source.encode(Encoding::UTF_32LE) unless source.ascii_only? + + if !string_end_with_semicolon?(source) + buf << ";\n" + elsif source[source.size - 1].ord != 0x0A + buf << "\n" + end end - buf << source + + buf end # Internal: Prepends a leading "." to an extension if its missing. 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 2016-04-06 20:20:58.000000000 +0200 +++ new/lib/sprockets/version.rb 2016-06-17 17:43:43.000000000 +0200 @@ -1,3 +1,3 @@ module Sprockets - VERSION = "3.6.0" + VERSION = "3.6.1" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2016-04-06 20:20:58.000000000 +0200 +++ new/metadata 2016-06-17 17:43:43.000000000 +0200 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: sprockets version: !ruby/object:Gem::Version - version: 3.6.0 + version: 3.6.1 platform: ruby authors: - Sam Stephenson @@ -9,7 +9,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2016-04-06 00:00:00.000000000 Z +date: 2016-06-17 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rack