Hello community, here is the log from the commit of package rubygem-activesupport-5_0 for openSUSE:Factory checked in at 2017-03-21 22:49:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-activesupport-5_0 (Old) and /work/SRC/openSUSE:Factory/.rubygem-activesupport-5_0.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-activesupport-5_0" Tue Mar 21 22:49:25 2017 rev:4 rq:479654 version:5.0.2 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-activesupport-5_0/rubygem-activesupport-5_0.changes 2016-12-29 22:47:16.755539404 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-activesupport-5_0.new/rubygem-activesupport-5_0.changes 2017-03-21 22:49:29.479272902 +0100 @@ -1,0 +2,22 @@ +Thu Mar 2 05:33:58 UTC 2017 - co...@suse.com + +- updated to version 5.0.2 + see installed CHANGELOG.md + + ## Rails 5.0.2 (March 01, 2017) ## + + * In Core Extensions, make `MarshalWithAutoloading#load` pass through the second, optional + argument for `Marshal#load( source [, proc] )`. This way we don't have to do + `Marshal.method(:load).super_method.call(sourse, proc)` just to be able to pass a proc. + + *Jeff Latz* + + * `ActiveSupport::Gzip.decompress` now checks checksum and length in footer. + + *Dylan Thacker-Smith* + + * Cache `ActiveSupport::TimeWithZone#to_datetime` before freezing. + + *Adam Rice* + +------------------------------------------------------------------- Old: ---- activesupport-5.0.1.gem New: ---- activesupport-5.0.2.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-activesupport-5_0.spec ++++++ --- /var/tmp/diff_new_pack.Jhsvzh/_old 2017-03-21 22:49:30.251163778 +0100 +++ /var/tmp/diff_new_pack.Jhsvzh/_new 2017-03-21 22:49:30.255163212 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-activesupport-5_0 # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # 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-activesupport-5_0 -Version: 5.0.1 +Version: 5.0.2 Release: 0 %define mod_name activesupport %define mod_full_name %{mod_name}-%{version} ++++++ activesupport-5.0.1.gem -> activesupport-5.0.2.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2016-12-21 01:06:08.000000000 +0100 +++ new/CHANGELOG.md 2017-03-02 00:11:56.000000000 +0100 @@ -1,3 +1,20 @@ +## Rails 5.0.2 (March 01, 2017) ## + +* In Core Extensions, make `MarshalWithAutoloading#load` pass through the second, optional + argument for `Marshal#load( source [, proc] )`. This way we don't have to do + `Marshal.method(:load).super_method.call(sourse, proc)` just to be able to pass a proc. + + *Jeff Latz* + +* `ActiveSupport::Gzip.decompress` now checks checksum and length in footer. + + *Dylan Thacker-Smith* + +* Cache `ActiveSupport::TimeWithZone#to_datetime` before freezing. + + *Adam Rice* + + ## Rails 5.0.1 (December 21, 2016) ## * No changes. 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/core_ext/hash/compact.rb new/lib/active_support/core_ext/hash/compact.rb --- old/lib/active_support/core_ext/hash/compact.rb 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/core_ext/hash/compact.rb 2017-03-02 00:11:56.000000000 +0100 @@ -1,20 +1,24 @@ class Hash - # Returns a hash with non +nil+ values. - # - # hash = { a: true, b: false, c: nil} - # hash.compact # => { a: true, b: false} - # hash # => { a: true, b: false, c: nil} - # { c: nil }.compact # => {} - def compact - self.select { |_, value| !value.nil? } + unless Hash.instance_methods(false).include?(:compact) + # Returns a hash with non +nil+ values. + # + # hash = { a: true, b: false, c: nil} + # hash.compact # => { a: true, b: false} + # hash # => { a: true, b: false, c: nil} + # { c: nil }.compact # => {} + def compact + self.select { |_, value| !value.nil? } + end end - # Replaces current hash with non +nil+ values. - # - # hash = { a: true, b: false, c: nil} - # hash.compact! # => { a: true, b: false} - # hash # => { a: true, b: false} - def compact! - self.reject! { |_, value| value.nil? } + unless Hash.instance_methods(false).include?(:compact!) + # Replaces current hash with non +nil+ values. + # + # hash = { a: true, b: false, c: nil} + # hash.compact! # => { a: true, b: false} + # hash # => { a: true, b: false} + def compact! + self.reject! { |_, value| value.nil? } + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/core_ext/hash/transform_values.rb new/lib/active_support/core_ext/hash/transform_values.rb --- old/lib/active_support/core_ext/hash/transform_values.rb 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/core_ext/hash/transform_values.rb 2017-03-02 00:11:56.000000000 +0100 @@ -16,7 +16,7 @@ result[key] = yield(value) end result - end + end unless method_defined? :transform_values # Destructively converts all values using the +block+ operations. # Same as +transform_values+ but modifies +self+. @@ -25,5 +25,5 @@ each do |key, value| self[key] = yield(value) end - end + end unless method_defined? :transform_values! end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/core_ext/marshal.rb new/lib/active_support/core_ext/marshal.rb --- old/lib/active_support/core_ext/marshal.rb 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/core_ext/marshal.rb 2017-03-02 00:11:56.000000000 +0100 @@ -1,7 +1,7 @@ module ActiveSupport module MarshalWithAutoloading # :nodoc: - def load(source) - super(source) + def load(source, proc = nil) + super(source, proc) rescue ArgumentError, NameError => exc if exc.message.match(%r|undefined class/module (.+?)(?:::)?\z|) # try loading the class/module diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/core_ext/module/introspection.rb new/lib/active_support/core_ext/module/introspection.rb --- old/lib/active_support/core_ext/module/introspection.rb 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/core_ext/module/introspection.rb 2017-03-02 00:11:56.000000000 +0100 @@ -5,10 +5,12 @@ # # M::N.parent_name # => "M" def parent_name - if defined? @parent_name + if defined?(@parent_name) @parent_name else - @parent_name = name =~ /::[^:]+\Z/ ? $`.freeze : nil + parent_name = name =~ /::[^:]+\Z/ ? $`.freeze : nil + @parent_name = parent_name unless frozen? + parent_name end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/core_ext/numeric/conversions.rb new/lib/active_support/core_ext/numeric/conversions.rb --- old/lib/active_support/core_ext/numeric/conversions.rb 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/core_ext/numeric/conversions.rb 2017-03-02 00:11:56.000000000 +0100 @@ -100,31 +100,30 @@ # 1234567.to_s(:human, precision: 1, # separator: ',', # significant: false) # => "1,2 Million" - def to_s(*args) - format, options = args - options ||= {} - + def to_s(format = nil, options = nil) case format + when nil + super() + when Integer, String + super(format) when :phone - return ActiveSupport::NumberHelper.number_to_phone(self, options) + return ActiveSupport::NumberHelper.number_to_phone(self, options || {}) when :currency - return ActiveSupport::NumberHelper.number_to_currency(self, options) + return ActiveSupport::NumberHelper.number_to_currency(self, options || {}) when :percentage - return ActiveSupport::NumberHelper.number_to_percentage(self, options) + return ActiveSupport::NumberHelper.number_to_percentage(self, options || {}) when :delimited - return ActiveSupport::NumberHelper.number_to_delimited(self, options) + return ActiveSupport::NumberHelper.number_to_delimited(self, options || {}) when :rounded - return ActiveSupport::NumberHelper.number_to_rounded(self, options) + return ActiveSupport::NumberHelper.number_to_rounded(self, options || {}) when :human - return ActiveSupport::NumberHelper.number_to_human(self, options) + return ActiveSupport::NumberHelper.number_to_human(self, options || {}) when :human_size - return ActiveSupport::NumberHelper.number_to_human_size(self, options) + return ActiveSupport::NumberHelper.number_to_human_size(self, options || {}) + when Symbol + super() else - if is_a?(Float) || format.is_a?(Symbol) - super() - else - super - end + super(format) end end @@ -135,7 +134,7 @@ end # Ruby 2.4+ unifies Fixnum & Bignum into Integer. -if Integer == Fixnum +if 0.class == Integer Integer.prepend ActiveSupport::NumericWithFormat else Fixnum.prepend ActiveSupport::NumericWithFormat diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/core_ext/object/duplicable.rb new/lib/active_support/core_ext/object/duplicable.rb --- old/lib/active_support/core_ext/object/duplicable.rb 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/core_ext/object/duplicable.rb 2017-03-02 00:11:56.000000000 +0100 @@ -1,7 +1,7 @@ #-- -# Most objects are cloneable, but not all. For example you can't dup +nil+: +# Most objects are cloneable, but not all. For example you can't dup methods: # -# nil.dup # => TypeError: can't dup NilClass +# method(:puts).dup # => TypeError: allocator undefined for Method # # Classes may signal their instances are not duplicable removing +dup+/+clone+ # or raising exceptions from them. So, to dup an arbitrary object you normally @@ -19,7 +19,7 @@ class Object # Can you safely dup this object? # - # False for +nil+, +false+, +true+, symbol, number, method objects; + # False for method objects; # true otherwise. def duplicable? true @@ -27,52 +27,78 @@ end class NilClass - # +nil+ is not duplicable: - # - # nil.duplicable? # => false - # nil.dup # => TypeError: can't dup NilClass - def duplicable? - false + begin + nil.dup + rescue TypeError + + # +nil+ is not duplicable: + # + # nil.duplicable? # => false + # nil.dup # => TypeError: can't dup NilClass + def duplicable? + false + end end end class FalseClass - # +false+ is not duplicable: - # - # false.duplicable? # => false - # false.dup # => TypeError: can't dup FalseClass - def duplicable? - false + begin + false.dup + rescue TypeError + + # +false+ is not duplicable: + # + # false.duplicable? # => false + # false.dup # => TypeError: can't dup FalseClass + def duplicable? + false + end end end class TrueClass - # +true+ is not duplicable: - # - # true.duplicable? # => false - # true.dup # => TypeError: can't dup TrueClass - def duplicable? - false + begin + true.dup + rescue TypeError + + # +true+ is not duplicable: + # + # true.duplicable? # => false + # true.dup # => TypeError: can't dup TrueClass + def duplicable? + false + end end end class Symbol - # Symbols are not duplicable: - # - # :my_symbol.duplicable? # => false - # :my_symbol.dup # => TypeError: can't dup Symbol - def duplicable? - false + begin + :symbol.dup # Ruby 2.4.x. + 'symbol_from_string'.to_sym.dup # Some symbols can't `dup` in Ruby 2.4.0. + rescue TypeError + + # Symbols are not duplicable: + # + # :my_symbol.duplicable? # => false + # :my_symbol.dup # => TypeError: can't dup Symbol + def duplicable? + false + end end end class Numeric - # Numbers are not duplicable: - # - # 3.duplicable? # => false - # 3.dup # => TypeError: can't dup Integer - def duplicable? - false + begin + 1.dup + rescue TypeError + + # Numbers are not duplicable: + # + # 3.duplicable? # => false + # 3.dup # => TypeError: can't dup Integer + def duplicable? + false + end end end 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 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/gem_version.rb 2017-03-02 00:11:56.000000000 +0100 @@ -7,7 +7,7 @@ module VERSION MAJOR = 5 MINOR = 0 - TINY = 1 + TINY = 2 PRE = nil STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/gzip.rb new/lib/active_support/gzip.rb --- old/lib/active_support/gzip.rb 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/gzip.rb 2017-03-02 00:11:56.000000000 +0100 @@ -21,7 +21,7 @@ # Decompresses a gzipped string. def self.decompress(source) - Zlib::GzipReader.new(StringIO.new(source)).read + Zlib::GzipReader.wrap(StringIO.new(source), &:read) end # Compresses a string using gzip. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/hash_with_indifferent_access.rb new/lib/active_support/hash_with_indifferent_access.rb --- old/lib/active_support/hash_with_indifferent_access.rb 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/hash_with_indifferent_access.rb 2017-03-02 00:11:56.000000000 +0100 @@ -274,6 +274,15 @@ dup.tap { |hash| hash.reject!(*args, &block) } end + def transform_values(*args, &block) + return to_enum(:transform_values) unless block_given? + dup.tap { |hash| hash.transform_values!(*args, &block) } + end + + def compact + dup.tap(&:compact!) + end + # Convert to a regular hash with string keys. def to_hash _new_hash = Hash.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/inflector/methods.rb new/lib/active_support/inflector/methods.rb --- old/lib/active_support/inflector/methods.rb 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/inflector/methods.rb 2017-03-02 00:11:56.000000000 +0100 @@ -273,7 +273,7 @@ # Go down the ancestors to check if it is owned directly. The check # stops when we reach Object or the end of ancestors tree. - constant = constant.ancestors.inject do |const, ancestor| + constant = constant.ancestors.inject(constant) do |const, ancestor| break const if ancestor == Object break ancestor if ancestor.const_defined?(name, false) const diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/json/encoding.rb new/lib/active_support/json/encoding.rb --- old/lib/active_support/json/encoding.rb 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/json/encoding.rb 2017-03-02 00:11:56.000000000 +0100 @@ -84,7 +84,7 @@ when String EscapedString.new(value) when Numeric, NilClass, TrueClass, FalseClass - value + value.as_json when Hash Hash[value.map { |k, v| [jsonify(k), jsonify(v)] }] when Array diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/message_encryptor.rb new/lib/active_support/message_encryptor.rb --- old/lib/active_support/message_encryptor.rb 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/message_encryptor.rb 2017-03-02 00:11:56.000000000 +0100 @@ -13,10 +13,10 @@ # where you don't want users to be able to determine the value of the payload. # # salt = SecureRandom.random_bytes(64) - # key = ActiveSupport::KeyGenerator.new('password').generate_key(salt) # => "\x89\xE0\x156\xAC..." - # crypt = ActiveSupport::MessageEncryptor.new(key) # => #<ActiveSupport::MessageEncryptor ...> - # encrypted_data = crypt.encrypt_and_sign('my secret data') # => "NlFBTTMwOUV5UlA1QlNEN2xkY2d6eThYWWh..." - # crypt.decrypt_and_verify(encrypted_data) # => "my secret data" + # key = ActiveSupport::KeyGenerator.new('password').generate_key(salt, 32) # => "\x89\xE0\x156\xAC..." + # crypt = ActiveSupport::MessageEncryptor.new(key) # => #<ActiveSupport::MessageEncryptor ...> + # encrypted_data = crypt.encrypt_and_sign('my secret data') # => "NlFBTTMwOUV5UlA1QlNEN2xkY2d6eThYWWh..." + # crypt.decrypt_and_verify(encrypted_data) # => "my secret data" class MessageEncryptor DEFAULT_CIPHER = "aes-256-cbc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/testing/autorun.rb new/lib/active_support/testing/autorun.rb --- old/lib/active_support/testing/autorun.rb 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/testing/autorun.rb 2017-03-02 00:11:56.000000000 +0100 @@ -2,8 +2,8 @@ require 'minitest' -if Minitest.respond_to?(:run_via) && !Minitest.run_via[:rails] - Minitest.run_via[:ruby] = true +if Minitest.respond_to?(:run_via) && !Minitest.run_via.set? + Minitest.run_via = :ruby end Minitest.autorun diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/testing/time_helpers.rb new/lib/active_support/testing/time_helpers.rb --- old/lib/active_support/testing/time_helpers.rb 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/testing/time_helpers.rb 2017-03-02 00:11:56.000000000 +0100 @@ -7,7 +7,7 @@ @stubs = {} end - def stub_object(object, method_name, return_value) + def stub_object(object, method_name, &block) key = [object.object_id, method_name] if stub = @stubs[key] @@ -19,7 +19,7 @@ @stubs[key] = Stub.new(object, method_name, new_name) object.singleton_class.send :alias_method, new_name, method_name - object.define_singleton_method(method_name) { return_value } + object.define_singleton_method(method_name, &block) end def unstub_all! @@ -99,9 +99,9 @@ now = date_or_time.to_time.change(usec: 0) end - simple_stubs.stub_object(Time, :now, now) - simple_stubs.stub_object(Date, :today, now.to_date) - simple_stubs.stub_object(DateTime, :now, now.to_datetime) + simple_stubs.stub_object(Time, :now) { at(now.to_i) } + simple_stubs.stub_object(Date, :today) { jd(now.to_date.jd) } + simple_stubs.stub_object(DateTime, :now) { jd(now.to_date.jd, now.hour, now.min, now.sec, Rational(now.utc_offset, 86400)) } if block_given? begin diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/time_with_zone.rb new/lib/active_support/time_with_zone.rb --- old/lib/active_support/time_with_zone.rb 2016-12-21 01:06:08.000000000 +0100 +++ new/lib/active_support/time_with_zone.rb 2017-03-02 00:11:56.000000000 +0100 @@ -428,7 +428,8 @@ end def freeze - period; utc; time # preload instance variables before freezing + # preload instance variables before freezing + period; utc; time; to_datetime super end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/active_support/xml_mini.rb new/lib/active_support/xml_mini.rb --- old/lib/active_support/xml_mini.rb 2016-12-21 01:06:09.000000000 +0100 +++ new/lib/active_support/xml_mini.rb 2017-03-02 00:11:56.000000000 +0100 @@ -48,8 +48,8 @@ } # No need to map these on Ruby 2.4+ - TYPE_NAMES["Fixnum"] = "integer" unless Fixnum == Integer - TYPE_NAMES["Bignum"] = "integer" unless Bignum == Integer + TYPE_NAMES["Fixnum"] = "integer" unless 0.class == Integer + TYPE_NAMES["Bignum"] = "integer" unless 0.class == Integer end FORMATTING = { @@ -68,7 +68,17 @@ "datetime" => Proc.new { |time| Time.xmlschema(time).utc rescue ::DateTime.parse(time).utc }, "integer" => Proc.new { |integer| integer.to_i }, "float" => Proc.new { |float| float.to_f }, - "decimal" => Proc.new { |number| BigDecimal(number) }, + "decimal" => Proc.new do |number| + if String === number + begin + BigDecimal(number) + rescue ArgumentError + BigDecimal('0') + end + else + BigDecimal(number) + end + end, "boolean" => Proc.new { |boolean| %w(1 true).include?(boolean.to_s.strip) }, "string" => Proc.new { |string| string.to_s }, "yaml" => Proc.new { |yaml| YAML::load(yaml) rescue yaml }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2016-12-21 01:06:08.000000000 +0100 +++ new/metadata 2017-03-02 00:11:56.000000000 +0100 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: activesupport version: !ruby/object:Gem::Version - version: 5.0.1 + version: 5.0.2 platform: ruby authors: - David Heinemeier Hansson autorequire: bindir: bin cert_chain: [] -date: 2016-12-21 00:00:00.000000000 Z +date: 2017-03-01 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: i18n @@ -336,10 +336,9 @@ version: '0' requirements: [] rubyforge_project: -rubygems_version: 2.5.2 +rubygems_version: 2.6.10 signing_key: specification_version: 4 summary: A toolkit of support libraries and Ruby core extensions extracted from the Rails framework. test_files: [] -has_rdoc: