activesupport 4.2.4 → 4.2.5.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activesupport might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d74d6b8bc7d46d0ba2f2889ec9885e59858c1fd
4
- data.tar.gz: c41988a152c3612ae8fd76d39eac0406499705a2
3
+ metadata.gz: c0e3f2939cb5ede0158dd5958f0c3f2238ba14fc
4
+ data.tar.gz: ebad309fb8fce6dc5283a0dba37bb73c3ea09df3
5
5
  SHA512:
6
- metadata.gz: 8b90d98d6df9fb06aec267a3715f6dd5d89e47169e16c71d885814d7589b2919350b7d2561a5013ed913dad09dac870b5f0dd5985aa47634e2428c9d6c2da617
7
- data.tar.gz: 1b1ec9825d84ad6bfd2e67ebfa23296c316a38dbab2884a911d51b57b83ede62fed41e7e72d8a3878d0d2d3e6991678c701ea79c326345ca1c243b485d7bac12
6
+ metadata.gz: 08ad959506ee8e97bb74ce3fe51d3f5d18838af03358de8396b08c79ec98d1ab282a1f7214f88fbc4840102caac7dd50b15b4b7fe69d34b176edb5fb1f453d21
7
+ data.tar.gz: 974cc7e1d8698a2ab72f0eeadd8e063a9a5de593206e2c53e3eed9e8f1bcb255933e8bb51e152b211e42233a343de8785c793ef15d814fd04089b160f0e2426f
@@ -1,3 +1,18 @@
1
+ ## Rails 4.2.5.rc1 (October 30, 2015) ##
2
+
3
+ * Fix `TimeWithZone#eql?` to properly handle `TimeWithZone` created from `DateTime`:
4
+ twz = DateTime.now.in_time_zone
5
+ twz.eql?(twz.dup) => true
6
+
7
+ Fixes #14178.
8
+
9
+ *Roque Pinel*
10
+
11
+ * Handle invalid UTF-8 characters in `MessageVerifier.verify`.
12
+
13
+ *Roque Pinel*, *Grey Baker*
14
+
15
+
1
16
  ## Rails 4.2.4 (August 24, 2015) ##
2
17
 
3
18
  * Fix a `SystemStackError` when encoding an `Enumerable` with `json` gem and
@@ -27,7 +27,7 @@ module ActiveSupport
27
27
  end
28
28
 
29
29
  class << self
30
- # Creates a new CacheStore object according to the given options.
30
+ # Creates a new Store object according to the given options.
31
31
  #
32
32
  # If no arguments are passed to this method, then a new
33
33
  # ActiveSupport::Cache::MemoryStore object will be returned.
@@ -2,7 +2,9 @@ class Module
2
2
  ###
3
3
  # TODO: remove this after 1.9 support is dropped
4
4
  def methods_transplantable? # :nodoc:
5
- x = Module.new { def foo; end }
5
+ x = Module.new {
6
+ def foo; end # :nodoc:
7
+ }
6
8
  Module.new { define_method :bar, x.instance_method(:foo) }
7
9
  true
8
10
  rescue TypeError
@@ -41,7 +41,7 @@ class Numeric
41
41
  # 1000.to_s(:percentage, delimiter: '.', separator: ',') # => 1.000,000%
42
42
  # 302.24398923423.to_s(:percentage, precision: 5) # => 302.24399%
43
43
  # 1000.to_s(:percentage, locale: :fr) # => 1 000,000%
44
- # 100.to_s(:percentage, format: '%n %') # => 100 %
44
+ # 100.to_s(:percentage, format: '%n %') # => 100.000 %
45
45
  #
46
46
  # Delimited:
47
47
  # 12345678.to_s(:delimited) # => 12,345,678
@@ -78,7 +78,7 @@ class Numeric
78
78
  # 1234567.to_s(:human_size, precision: 2) # => 1.2 MB
79
79
  # 483989.to_s(:human_size, precision: 2) # => 470 KB
80
80
  # 1234567.to_s(:human_size, precision: 2, separator: ',') # => 1,2 MB
81
- # 1234567890123.to_s(:human_size, precision: 5) # => "1.1229 TB"
81
+ # 1234567890123.to_s(:human_size, precision: 5) # => "1.1228 TB"
82
82
  # 524288000.to_s(:human_size, precision: 5) # => "500 MB"
83
83
  #
84
84
  # Human-friendly format:
@@ -2,11 +2,11 @@
2
2
 
3
3
  class Object
4
4
  # An object is blank if it's false, empty, or a whitespace string.
5
- # For example, '', ' ', +nil+, [], and {} are all blank.
5
+ # For example, +false+, '', ' ', +nil+, [], and {} are all blank.
6
6
  #
7
7
  # This simplifies
8
8
  #
9
- # address.nil? || address.empty?
9
+ # !address || address.empty?
10
10
  #
11
11
  # to
12
12
  #
@@ -65,10 +65,10 @@ class Object
65
65
 
66
66
  # Same as #try, but will raise a NoMethodError exception if the receiver is not +nil+ and
67
67
  # does not implement the tried method.
68
-
68
+
69
69
  def try!(*a, &b)
70
70
  if a.empty? && block_given?
71
- if b.arity.zero?
71
+ if b.arity == 0
72
72
  instance_eval(&b)
73
73
  else
74
74
  yield self
@@ -3,6 +3,7 @@ require 'active_support/core_ext/time/conversions'
3
3
  require 'active_support/time_with_zone'
4
4
  require 'active_support/core_ext/time/zones'
5
5
  require 'active_support/core_ext/date_and_time/calculations'
6
+ require 'active_support/core_ext/date/calculations'
6
7
 
7
8
  class Time
8
9
  include DateAndTime::Calculations
@@ -7,8 +7,8 @@ module ActiveSupport
7
7
  module VERSION
8
8
  MAJOR = 4
9
9
  MINOR = 2
10
- TINY = 4
11
- PRE = nil
10
+ TINY = 5
11
+ PRE = "rc1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -269,7 +269,7 @@ module ActiveSupport
269
269
  value.nested_under_indifferent_access
270
270
  end
271
271
  elsif value.is_a?(Array)
272
- unless options[:for] == :assignment
272
+ if options[:for] != :assignment || value.frozen?
273
273
  value = value.dup
274
274
  end
275
275
  value.map! { |e| convert_value(e, options) }
@@ -35,7 +35,7 @@ module ActiveSupport
35
35
  end
36
36
 
37
37
  def verify(signed_message)
38
- raise InvalidSignature if signed_message.blank?
38
+ raise InvalidSignature if signed_message.nil? || !signed_message.valid_encoding? || signed_message.blank?
39
39
 
40
40
  data, digest = signed_message.split("--")
41
41
  if data.present? && digest.present? && ActiveSupport::SecurityUtils.secure_compare(digest, generate_digest(data))
@@ -43,9 +43,9 @@ module ActiveSupport
43
43
  protected
44
44
  def method_missing(name, *args, &block) # :nodoc:
45
45
  # Caches the method definition as a singleton method of the receiver.
46
- define_singleton_method(name) do |*a, &b|
47
- instance.public_send(name, *a, &b)
48
- end
46
+ #
47
+ # By letting #delegate handle it, we avoid an enclosure that'll capture args.
48
+ singleton_class.delegate name, to: :instance
49
49
 
50
50
  send(name, *args, &block)
51
51
  end
@@ -236,7 +236,7 @@ module ActiveSupport
236
236
  end
237
237
 
238
238
  def eql?(other)
239
- utc.eql?(other)
239
+ other.eql?(utc)
240
240
  end
241
241
 
242
242
  def hash
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesupport
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.4
4
+ version: 4.2.5.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-24 00:00:00.000000000 Z
11
+ date: 2015-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -334,15 +334,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
334
334
  version: 1.9.3
335
335
  required_rubygems_version: !ruby/object:Gem::Requirement
336
336
  requirements:
337
- - - ">="
337
+ - - ">"
338
338
  - !ruby/object:Gem::Version
339
- version: '0'
339
+ version: 1.3.1
340
340
  requirements: []
341
341
  rubyforge_project:
342
- rubygems_version: 2.4.7
342
+ rubygems_version: 2.4.5.1
343
343
  signing_key:
344
344
  specification_version: 4
345
345
  summary: A toolkit of support libraries and Ruby core extensions extracted from the
346
346
  Rails framework.
347
347
  test_files: []
348
- has_rdoc: