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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b83c0e0a0434e5df9706c8db0f77093076840952
|
4
|
+
data.tar.gz: 5253844cdd2e1642c329557bf9a525baeca020a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42ae693898d05aba4be1e3d2565ee2aadeea484ff0c815ecdd5849e64bd558fe0bb76f1516329260bd295feb5d38edc3169d4a0095b7fea58db9fa9eba90d4ab
|
7
|
+
data.tar.gz: c381b37abd1c5ec280b34a234a1ab69e43dd4c9092e5d54a72aec173d4b8fd5df3c48ecec3446610c246fbf05423a8a9d16e185607d97b927725b987bdbde794
|
data/CHANGELOG.md
CHANGED
@@ -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
|
668
|
-
and will be removed in Rails 5.2 without
|
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
|
|
@@ -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
|
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.
|
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-
|
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:
|
332
|
+
version: 1.3.1
|
333
333
|
requirements: []
|
334
334
|
rubyforge_project:
|
335
335
|
rubygems_version: 2.6.12
|