activesupport 5.1.2 → 5.1.3.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: f9b7d6c322e53525b049d25d9f4b9b5cbc847882
4
- data.tar.gz: e6013fda8676a07209d6de9f65a534ab89d0fdcf
3
+ metadata.gz: b83c0e0a0434e5df9706c8db0f77093076840952
4
+ data.tar.gz: 5253844cdd2e1642c329557bf9a525baeca020a7
5
5
  SHA512:
6
- metadata.gz: c484d859bab0543ce853a07c80a46d8e63f25f56376d215e3a556f290a2232970fbaa404abdf647d0c1d0fb1185dd1488f25ce9c2560231a87902ccb33b8e7a8
7
- data.tar.gz: 2400dc3608e97579be55540e85d92cd4cfd5564d5bb94ee1c4856982f4f02ad0bf89c53bbeb4c8708698e27db3be86f2512f55f277d268d750dc54c80f8ed786
6
+ metadata.gz: 42ae693898d05aba4be1e3d2565ee2aadeea484ff0c815ecdd5849e64bd558fe0bb76f1516329260bd295feb5d38edc3169d4a0095b7fea58db9fa9eba90d4ab
7
+ data.tar.gz: c381b37abd1c5ec280b34a234a1ab69e43dd4c9092e5d54a72aec173d4b8fd5df3c48ecec3446610c246fbf05423a8a9d16e185607d97b927725b987bdbde794
@@ -1,3 +1,8 @@
1
+ ## Rails 5.1.3.rc1 (July 19, 2017) ##
2
+
3
+ * No changes.
4
+
5
+
1
6
  ## Rails 5.1.2 (June 26, 2017) ##
2
7
 
3
8
  * Cache: Restore the `options = nil` argument for `LocalStore#clear`
@@ -664,8 +664,10 @@ module ActiveSupport
664
664
 
665
665
  if options[:if].is_a?(String) || options[:unless].is_a?(String)
666
666
  ActiveSupport::Deprecation.warn(<<-MSG.squish)
667
- Passing string to :if and :unless conditional options is deprecated
668
- and will be removed in Rails 5.2 without replacement.
667
+ Passing string to be evaluated in :if and :unless conditional
668
+ options is deprecated and will be removed in Rails 5.2 without
669
+ replacement. Pass a symbol for an instance method, or a lambda,
670
+ proc or block, instead.
669
671
  MSG
670
672
  end
671
673
 
@@ -7,8 +7,8 @@ module ActiveSupport
7
7
  module VERSION
8
8
  MAJOR = 5
9
9
  MINOR = 1
10
- TINY = 2
11
- PRE = nil
10
+ TINY = 3
11
+ PRE = "rc1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -74,16 +74,6 @@ module ActiveSupport
74
74
  end
75
75
  end
76
76
 
77
- def default(*args)
78
- arg_key = args.first
79
-
80
- if include?(key = convert_key(arg_key))
81
- self[key]
82
- else
83
- super
84
- end
85
- end
86
-
87
77
  def self.[](*args)
88
78
  new.merge!(Hash[*args])
89
79
  end
@@ -185,6 +175,36 @@ module ActiveSupport
185
175
  super(convert_key(key), *extras)
186
176
  end
187
177
 
178
+ if Hash.new.respond_to?(:dig)
179
+ # Same as <tt>Hash#dig</tt> where the key passed as argument can be
180
+ # either a string or a symbol:
181
+ #
182
+ # counters = ActiveSupport::HashWithIndifferentAccess.new
183
+ # counters[:foo] = { bar: 1 }
184
+ #
185
+ # counters.dig('foo', 'bar') # => 1
186
+ # counters.dig(:foo, :bar) # => 1
187
+ # counters.dig(:zoo) # => nil
188
+ def dig(*args)
189
+ args[0] = convert_key(args[0]) if args.size > 0
190
+ super(*args)
191
+ end
192
+ end
193
+
194
+ # Same as <tt>Hash#default</tt> where the key passed as argument can be
195
+ # either a string or a symbol:
196
+ #
197
+ # hash = ActiveSupport::HashWithIndifferentAccess.new(1)
198
+ # hash.default # => 1
199
+ #
200
+ # hash = ActiveSupport::HashWithIndifferentAccess.new { |hash, key| key }
201
+ # hash.default # => nil
202
+ # hash.default('foo') # => 'foo'
203
+ # hash.default(:foo) # => 'foo'
204
+ def default(*args)
205
+ super(*args.map { |arg| convert_key(arg) })
206
+ end
207
+
188
208
  # Returns an array of the values at the specified indices:
189
209
  #
190
210
  # hash = ActiveSupport::HashWithIndifferentAccess.new
@@ -2,8 +2,4 @@ gem "minitest"
2
2
 
3
3
  require "minitest"
4
4
 
5
- if Minitest.respond_to?(:run_via) && !Minitest.run_via.set?
6
- Minitest.run_via = :ruby
7
- end
8
-
9
5
  Minitest.autorun
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: 5.1.2
4
+ version: 5.1.3.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: 2017-06-26 00:00:00.000000000 Z
11
+ date: 2017-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -327,9 +327,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
327
327
  version: 2.2.2
328
328
  required_rubygems_version: !ruby/object:Gem::Requirement
329
329
  requirements:
330
- - - ">="
330
+ - - ">"
331
331
  - !ruby/object:Gem::Version
332
- version: '0'
332
+ version: 1.3.1
333
333
  requirements: []
334
334
  rubyforge_project:
335
335
  rubygems_version: 2.6.12