Hello community,
here is the log from the commit of package rubygem-activesupport-5.2 for
openSUSE:Factory checked in at 2018-08-12 20:53:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-activesupport-5.2 (Old)
and /work/SRC/openSUSE:Factory/.rubygem-activesupport-5.2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-activesupport-5.2"
Sun Aug 12 20:53:38 2018 rev:2 rq:628586 version:5.2.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-activesupport-5.2/rubygem-activesupport-5.2.changes
2018-07-18 22:47:31.596236752 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-activesupport-5.2.new/rubygem-activesupport-5.2.changes
2018-08-12 20:53:42.213263929 +0200
@@ -1,0 +2,23 @@
+Wed Aug 8 14:55:31 UTC 2018 - [email protected]
+
+- updated to version 5.2.1 (boo#1104209)
+
+* Redis cache store: `delete_matched` no longer blocks the Redis server.
+ (Switches from evaled Lua to a batched SCAN + DEL loop.)
+ (Gleb Mazovetskiy)
+
+* Fix bug where `ActiveSupport::Timezone.all` would fail when tzinfo data for
+ any timezone defined in `ActiveSupport::TimeZone::MAPPING` is missing.
+ (Dominik Sander)
+
+* Fix bug where `ActiveSupport::Cache` will massively inflate the storage
+ size when compression is enabled (which is true by default). This patch
+ does not attempt to repair existing data: please manually flush the cache
+ to clear out the problematic entries.
+ (Godfrey Chan)
+
+* Fix `ActiveSupport::Cache#read_multi` bug with local cache enabled that was
+ returning instances of `ActiveSupport::Cache::Entry` instead of the raw
values.
+ (Jason Lee)
+
+-------------------------------------------------------------------
Old:
----
activesupport-5.2.0.gem
New:
----
activesupport-5.2.1.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-activesupport-5.2.spec ++++++
--- /var/tmp/diff_new_pack.XnBjjv/_old 2018-08-12 20:53:42.617264749 +0200
+++ /var/tmp/diff_new_pack.XnBjjv/_new 2018-08-12 20:53:42.617264749 +0200
@@ -24,7 +24,7 @@
#
Name: rubygem-activesupport-5.2
-Version: 5.2.0
+Version: 5.2.1
Release: 0
%define mod_name activesupport
%define mod_full_name %{mod_name}-%{version}
++++++ activesupport-5.2.0.gem -> activesupport-5.2.1.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2018-04-09 22:04:24.000000000 +0200
+++ new/CHANGELOG.md 2018-08-07 23:41:48.000000000 +0200
@@ -1,3 +1,28 @@
+## Rails 5.2.1 (August 07, 2018) ##
+
+* Redis cache store: `delete_matched` no longer blocks the Redis server.
+ (Switches from evaled Lua to a batched SCAN + DEL loop.)
+
+ *Gleb Mazovetskiy*
+
+* Fix bug where `ActiveSupport::Timezone.all` would fail when tzinfo data for
+ any timezone defined in `ActiveSupport::TimeZone::MAPPING` is missing.
+
+ *Dominik Sander*
+
+* Fix bug where `ActiveSupport::Cache` will massively inflate the storage
+ size when compression is enabled (which is true by default). This patch
+ does not attempt to repair existing data: please manually flush the cache
+ to clear out the problematic entries.
+
+ *Godfrey Chan*
+
+* Fix `ActiveSupport::Cache#read_multi` bug with local cache enabled that was
+ returning instances of `ActiveSupport::Cache::Entry` instead of the raw
values.
+
+ *Jason Lee*
+
+
## Rails 5.2.0 (April 09, 2018) ##
* Caching: MemCache and Redis `read_multi` and `fetch_multi` speedup.
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_support/cache/redis_cache_store.rb
new/lib/active_support/cache/redis_cache_store.rb
--- old/lib/active_support/cache/redis_cache_store.rb 2018-04-09
22:04:24.000000000 +0200
+++ new/lib/active_support/cache/redis_cache_store.rb 2018-08-07
23:41:48.000000000 +0200
@@ -63,8 +63,9 @@
end
end
- DELETE_GLOB_LUA = "for i, name in ipairs(redis.call('KEYS', ARGV[1])) do
redis.call('DEL', name); end"
- private_constant :DELETE_GLOB_LUA
+ # The maximum number of entries to receive per SCAN call.
+ SCAN_BATCH_SIZE = 1000
+ private_constant :SCAN_BATCH_SIZE
# Support raw values in the local cache strategy.
module LocalCacheWithRaw # :nodoc:
@@ -232,12 +233,18 @@
# Failsafe: Raises errors.
def delete_matched(matcher, options = nil)
instrument :delete_matched, matcher do
- case matcher
- when String
- redis.with { |c| c.eval DELETE_GLOB_LUA, [],
[namespace_key(matcher, options)] }
- else
+ unless String === matcher
raise ArgumentError, "Only Redis glob strings are supported:
#{matcher.inspect}"
end
+ redis.with do |c|
+ pattern = namespace_key(matcher, options)
+ cursor = "0"
+ # Fetch keys in batches using SCAN to avoid blocking the Redis
server.
+ begin
+ cursor, keys = c.scan(cursor, match: pattern, count:
SCAN_BATCH_SIZE)
+ c.del(*keys) unless keys.empty?
+ end until cursor == "0"
+ end
end
end
@@ -287,7 +294,7 @@
# Failsafe: Raises errors.
def clear(options = nil)
failsafe :clear do
- if namespace = merged_options(options)[namespace]
+ if namespace = merged_options(options)[:namespace]
delete_matched "*", namespace: namespace
else
redis.with { |c| c.flushdb }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_support/cache.rb
new/lib/active_support/cache.rb
--- old/lib/active_support/cache.rb 2018-04-09 22:04:24.000000000 +0200
+++ new/lib/active_support/cache.rb 2018-08-07 23:41:48.000000000 +0200
@@ -712,17 +712,14 @@
DEFAULT_COMPRESS_LIMIT = 1.kilobyte
# Creates a new cache entry for the specified value. Options supported
are
- # +:compress+, +:compress_threshold+, and +:expires_in+.
- def initialize(value, options = {})
- @value = value
- if should_compress?(options)
- compress!
- end
-
- @version = options[:version]
+ # +:compress+, +:compress_threshold+, +:version+ and +:expires_in+.
+ def initialize(value, compress: true, compress_threshold:
DEFAULT_COMPRESS_LIMIT, version: nil, expires_in: nil, **)
+ @value = value
+ @version = version
@created_at = Time.now.to_f
- @expires_in = options[:expires_in]
- @expires_in = @expires_in.to_f if @expires_in
+ @expires_in = expires_in && expires_in.to_f
+
+ compress!(compress_threshold) if compress
end
def value
@@ -754,17 +751,13 @@
# Returns the size of the cached value. This could be less than
# <tt>value.size</tt> if the data is compressed.
def size
- if defined?(@s)
- @s
+ case value
+ when NilClass
+ 0
+ when String
+ @value.bytesize
else
- case value
- when NilClass
- 0
- when String
- @value.bytesize
- else
- @s = Marshal.dump(@value).bytesize
- end
+ @s ||= Marshal.dump(@value).bytesize
end
end
@@ -781,31 +774,35 @@
end
private
- def should_compress?(options)
- if @value && options.fetch(:compress, true)
- compress_threshold = options.fetch(:compress_threshold,
DEFAULT_COMPRESS_LIMIT)
- serialized_value_size = (@value.is_a?(String) ? @value :
marshaled_value).bytesize
+ def compress!(compress_threshold)
+ case @value
+ when nil, true, false, Numeric
+ uncompressed_size = 0
+ when String
+ uncompressed_size = @value.bytesize
+ else
+ serialized = Marshal.dump(@value)
+ uncompressed_size = serialized.bytesize
+ end
- serialized_value_size >= compress_threshold
+ if uncompressed_size >= compress_threshold
+ serialized ||= Marshal.dump(@value)
+ compressed = Zlib::Deflate.deflate(serialized)
+
+ if compressed.bytesize < uncompressed_size
+ @value = compressed
+ @compressed = true
+ end
end
end
def compressed?
- defined?(@compressed) ? @compressed : false
- end
-
- def compress!
- @value = Zlib::Deflate.deflate(marshaled_value)
- @compressed = true
+ defined?(@compressed)
end
def uncompress(value)
Marshal.load(Zlib::Inflate.inflate(value))
end
-
- def marshaled_value
- @marshaled_value ||= Marshal.dump(@value)
- end
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_support/core_ext/enumerable.rb
new/lib/active_support/core_ext/enumerable.rb
--- old/lib/active_support/core_ext/enumerable.rb 2018-04-09
22:04:24.000000000 +0200
+++ new/lib/active_support/core_ext/enumerable.rb 2018-08-07
23:41:48.000000000 +0200
@@ -8,10 +8,15 @@
# and fall back to the compatible implementation, but that's much slower than
# just calling the compat method in the first place.
if Enumerable.instance_methods(false).include?(:sum) && !((?a..?b).sum
rescue false)
+ # :stopdoc:
+
# We can't use Refinements here because Refinements with Module which will
be prepended
# doesn't work well https://bugs.ruby-lang.org/issues/13446
alias :_original_sum_with_required_identity :sum
private :_original_sum_with_required_identity
+
+ # :startdoc:
+
# Calculates a sum from the elements.
#
# payments.sum { |p| p.price * p.tax_rate }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_support/core_ext/object/to_query.rb
new/lib/active_support/core_ext/object/to_query.rb
--- old/lib/active_support/core_ext/object/to_query.rb 2018-04-09
22:04:24.000000000 +0200
+++ new/lib/active_support/core_ext/object/to_query.rb 2018-08-07
23:41:49.000000000 +0200
@@ -75,11 +75,14 @@
#
# This method is also aliased as +to_param+.
def to_query(namespace = nil)
- collect do |key, value|
+ query = collect do |key, value|
unless (value.is_a?(Hash) || value.is_a?(Array)) && value.empty?
value.to_query(namespace ? "#{namespace}[#{key}]" : key)
end
- end.compact.sort! * "&"
+ end.compact
+
+ query.sort! unless namespace.to_s.include?("[]")
+ query.join("&")
end
alias_method :to_param, :to_query
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_support/core_ext/uri.rb
new/lib/active_support/core_ext/uri.rb
--- old/lib/active_support/core_ext/uri.rb 2018-04-09 22:04:24.000000000
+0200
+++ new/lib/active_support/core_ext/uri.rb 2018-08-07 23:41:49.000000000
+0200
@@ -1,10 +1,7 @@
# frozen_string_literal: true
require "uri"
-str = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E" # Ni-ho-nn-go in UTF-8, means
Japanese.
-parser = URI::Parser.new
-
-unless str == parser.unescape(parser.escape(str))
+if RUBY_VERSION < "2.6.0"
require "active_support/core_ext/module/redefine_method"
URI::Parser.class_eval do
silence_redefinition_of_method :unescape
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_support/dependencies.rb
new/lib/active_support/dependencies.rb
--- old/lib/active_support/dependencies.rb 2018-04-09 22:04:24.000000000
+0200
+++ new/lib/active_support/dependencies.rb 2018-08-07 23:41:49.000000000
+0200
@@ -224,6 +224,8 @@
Dependencies.require_or_load(file_name)
end
+ # :doc:
+
# Interprets a file using <tt>mechanism</tt> and marks its defined
# constants as autoloaded. <tt>file_name</tt> can be either a string or
# respond to <tt>to_path</tt>.
@@ -242,6 +244,8 @@
Dependencies.depend_on(file_name, message)
end
+ # :nodoc:
+
def load_dependency(file)
if Dependencies.load? && Dependencies.constant_watch_stack.watching?
Dependencies.new_constants_in(Object) { yield }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_support/deprecation/behaviors.rb
new/lib/active_support/deprecation/behaviors.rb
--- old/lib/active_support/deprecation/behaviors.rb 2018-04-09
22:04:24.000000000 +0200
+++ new/lib/active_support/deprecation/behaviors.rb 2018-08-07
23:41:49.000000000 +0200
@@ -94,6 +94,10 @@
private
def arity_coerce(behavior)
+ unless behavior.respond_to?(:call)
+ raise ArgumentError, "#{behavior.inspect} is not a valid
deprecation behavior."
+ end
+
if behavior.arity == 4 || behavior.arity == -1
behavior
else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_support/deprecation/reporting.rb
new/lib/active_support/deprecation/reporting.rb
--- old/lib/active_support/deprecation/reporting.rb 2018-04-09
22:04:24.000000000 +0200
+++ new/lib/active_support/deprecation/reporting.rb 2018-08-07
23:41:49.000000000 +0200
@@ -104,7 +104,7 @@
end
end
- RAILS_GEM_ROOT = File.expand_path("../../../..", __dir__)
+ RAILS_GEM_ROOT = File.expand_path("../../../..", __dir__) + "/"
def ignored_callstack(path)
path.start_with?(RAILS_GEM_ROOT) ||
path.start_with?(RbConfig::CONFIG["rubylibdir"])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_support/encrypted_file.rb
new/lib/active_support/encrypted_file.rb
--- old/lib/active_support/encrypted_file.rb 2018-04-09 22:04:24.000000000
+0200
+++ new/lib/active_support/encrypted_file.rb 2018-08-07 23:41:49.000000000
+0200
@@ -57,7 +57,7 @@
private
def writing(contents)
- tmp_file = "#{content_path.basename}.#{Process.pid}"
+ tmp_file = "#{Process.pid}.#{content_path.basename.to_s.chomp('.enc')}"
tmp_path = Pathname.new File.join(Dir.tmpdir, tmp_file)
tmp_path.binwrite contents
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_support/gem_version.rb
new/lib/active_support/gem_version.rb
--- old/lib/active_support/gem_version.rb 2018-04-09 22:04:24.000000000
+0200
+++ new/lib/active_support/gem_version.rb 2018-08-07 23:41:49.000000000
+0200
@@ -9,7 +9,7 @@
module VERSION
MAJOR = 5
MINOR = 2
- TINY = 0
+ TINY = 1
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_support/test_case.rb
new/lib/active_support/test_case.rb
--- old/lib/active_support/test_case.rb 2018-04-09 22:04:24.000000000 +0200
+++ new/lib/active_support/test_case.rb 2018-08-07 23:41:49.000000000 +0200
@@ -44,7 +44,7 @@
alias_method :method_name, :name
include ActiveSupport::Testing::TaggedLogging
- include ActiveSupport::Testing::SetupAndTeardown
+ prepend ActiveSupport::Testing::SetupAndTeardown
include ActiveSupport::Testing::Assertions
include ActiveSupport::Testing::Deprecation
include ActiveSupport::Testing::TimeHelpers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_support/testing/setup_and_teardown.rb
new/lib/active_support/testing/setup_and_teardown.rb
--- old/lib/active_support/testing/setup_and_teardown.rb 2018-04-09
22:04:24.000000000 +0200
+++ new/lib/active_support/testing/setup_and_teardown.rb 2018-08-07
23:41:49.000000000 +0200
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require "active_support/concern"
require "active_support/callbacks"
module ActiveSupport
@@ -19,11 +18,10 @@
# end
# end
module SetupAndTeardown
- extend ActiveSupport::Concern
-
- included do
- include ActiveSupport::Callbacks
- define_callbacks :setup, :teardown
+ def self.prepended(klass)
+ klass.include ActiveSupport::Callbacks
+ klass.define_callbacks :setup, :teardown
+ klass.extend ClassMethods
end
module ClassMethods
@@ -47,12 +45,10 @@
begin
run_callbacks :teardown
rescue => e
- error = e
+ self.failures << Minitest::UnexpectedError.new(e)
end
super
- ensure
- raise error if error
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/active_support/values/time_zone.rb
new/lib/active_support/values/time_zone.rb
--- old/lib/active_support/values/time_zone.rb 2018-04-09 22:04:24.000000000
+0200
+++ new/lib/active_support/values/time_zone.rb 2018-08-07 23:41:49.000000000
+0200
@@ -280,7 +280,8 @@
def zones_map
@zones_map ||= MAPPING.each_with_object({}) do |(name, _), zones|
- zones[name] = self[name]
+ timezone = self[name]
+ zones[name] = timezone if timezone
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2018-04-09 22:04:24.000000000 +0200
+++ new/metadata 2018-08-07 23:41:48.000000000 +0200
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: activesupport
version: !ruby/object:Gem::Version
- version: 5.2.0
+ version: 5.2.1
platform: ruby
authors:
- David Heinemeier Hansson
autorequire:
bindir: bin
cert_chain: []
-date: 2018-04-09 00:00:00.000000000 Z
+date: 2018-08-07 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: i18n
@@ -331,8 +331,8 @@
licenses:
- MIT
metadata:
- source_code_uri: https://github.com/rails/rails/tree/v5.2.0/activesupport
- changelog_uri:
https://github.com/rails/rails/blob/v5.2.0/activesupport/CHANGELOG.md
+ source_code_uri: https://github.com/rails/rails/tree/v5.2.1/activesupport
+ changelog_uri:
https://github.com/rails/rails/blob/v5.2.1/activesupport/CHANGELOG.md
post_install_message:
rdoc_options:
- "--encoding"