activesupport 5.1.4 → 5.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

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
- SHA1:
3
- metadata.gz: a7fdef39489c6a6be4ad2f8195275087df02c0fe
4
- data.tar.gz: 05cb6ded891c095138368fe9f6b8482650d1c911
2
+ SHA256:
3
+ metadata.gz: 0ece0ba787f6df68f2378c0e387d18f2a56a00359a4885e0d155ba9e57811caa
4
+ data.tar.gz: 4fc1a1e4b58d382f0fd49539f28707234d7828c46a79c9bca397c1d327ca25b4
5
5
  SHA512:
6
- metadata.gz: 2930f6aa4e82a216040696362bdb8f2db3ba1d535a0606ffe8f8767291842f035506ddecf3a6ed62c0f1da9a9009bbf6851868e433f361eca79e94468088601d
7
- data.tar.gz: 706c31524e1ce6ceecb3bc5c44f93096f489dc8236d5963165bfb2ee9702a71edc5ae59cc738ced03e1cd91bd8475c800dee4cb5787dc89b767728be28a51026
6
+ metadata.gz: 78703452ca309f7344f0e8d544bbe093147dba9cbd09917ed4aa72f2e1121ff3cf1835cd062a169d680dd2d7457d892a771d2947f7ce9b1729199a48dd745947
7
+ data.tar.gz: ac4bdb64bfd7815044ec53ccd8008f6c62733c525437069d466a33f1af0d0566ded8017daa872269d4921bf777f67662edb0043d68dee271e0defe25b3c42ec7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,42 @@
1
+ ## Rails 5.1.7 (March 27, 2019) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 5.1.6.2 (March 11, 2019) ##
7
+
8
+ * No changes.
9
+
10
+
11
+ ## Rails 5.1.6.1 (November 27, 2018) ##
12
+
13
+ * No changes.
14
+
15
+
16
+ ## Rails 5.1.6 (March 29, 2018) ##
17
+
18
+ * Return all mappings for a timezone identifier in `country_zones`
19
+
20
+ Some timezones like `Europe/London` have multiple mappings in
21
+ `ActiveSupport::TimeZone::MAPPING` so return all of them instead
22
+ of the first one found by using `Hash#value`. e.g:
23
+
24
+ # Before
25
+ ActiveSupport::TimeZone.country_zones("GB") # => ["Edinburgh"]
26
+
27
+ # After
28
+ ActiveSupport::TimeZone.country_zones("GB") # => ["Edinburgh", "London"]
29
+
30
+ Fixes #31668.
31
+
32
+ *Andrew White*
33
+
34
+
35
+ ## Rails 5.1.5 (February 14, 2018) ##
36
+
37
+ * No changes.
38
+
39
+
1
40
  ## Rails 5.1.4 (September 07, 2017) ##
2
41
 
3
42
  * No changes.
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "monitor"
4
+
5
+ module ActiveSupport
6
+ module Concurrency
7
+ # A monitor that will permit dependency loading while blocked waiting for
8
+ # the lock.
9
+ class LoadInterlockAwareMonitor < Monitor
10
+ # Enters an exclusive section, but allows dependency loading while blocked
11
+ def mon_enter
12
+ mon_try_enter ||
13
+ ActiveSupport::Dependencies.interlock.permit_concurrent_loads { super }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -16,7 +16,7 @@ class Hash
16
16
  result[yield(key)] = self[key]
17
17
  end
18
18
  result
19
- end
19
+ end unless method_defined? :transform_keys
20
20
 
21
21
  # Destructively converts all keys using the +block+ operations.
22
22
  # Same as +transform_keys+ but modifies +self+.
@@ -26,7 +26,7 @@ class Hash
26
26
  self[yield(key)] = delete(key)
27
27
  end
28
28
  self
29
- end
29
+ end unless method_defined? :transform_keys!
30
30
 
31
31
  # Returns a new hash with all keys converted to strings.
32
32
  #
@@ -73,11 +73,14 @@ class Hash
73
73
  #
74
74
  # This method is also aliased as +to_param+.
75
75
  def to_query(namespace = nil)
76
- collect do |key, value|
76
+ query = collect do |key, value|
77
77
  unless (value.is_a?(Hash) || value.is_a?(Array)) && value.empty?
78
78
  value.to_query(namespace ? "#{namespace}[#{key}]" : key)
79
79
  end
80
- end.compact.sort! * "&"
80
+ end.compact
81
+
82
+ query.sort! unless namespace.to_s.include?("[]")
83
+ query.join("&")
81
84
  end
82
85
 
83
86
  alias_method :to_param, :to_query
@@ -456,6 +456,7 @@ module ActiveSupport #:nodoc:
456
456
  mod = Module.new
457
457
  into.const_set const_name, mod
458
458
  autoloaded_constants << qualified_name unless autoload_once_paths.include?(base_path)
459
+ autoloaded_constants.uniq!
459
460
  mod
460
461
  end
461
462
 
@@ -60,6 +60,13 @@ module ActiveSupport
60
60
  deprecator.deprecation_warning(method_name, options[method_name])
61
61
  super(*args, &block)
62
62
  end
63
+
64
+ case
65
+ when target_module.protected_method_defined?(method_name)
66
+ protected method_name
67
+ when target_module.private_method_defined?(method_name)
68
+ private method_name
69
+ end
63
70
  end
64
71
  end
65
72
 
@@ -383,6 +383,14 @@ module ActiveSupport
383
383
  @value.respond_to?(method, include_private)
384
384
  end
385
385
 
386
+ def init_with(coder) #:nodoc:
387
+ initialize(coder["value"], coder["parts"])
388
+ end
389
+
390
+ def encode_with(coder) #:nodoc:
391
+ coder.map = { "value" => @value, "parts" => @parts }
392
+ end
393
+
386
394
  # Build ISO 8601 Duration string for this duration.
387
395
  # The +precision+ parameter can be used to limit seconds' precision of duration.
388
396
  def iso8601(precision: nil)
@@ -7,7 +7,7 @@ module ActiveSupport
7
7
  module VERSION
8
8
  MAJOR = 5
9
9
  MINOR = 1
10
- TINY = 4
10
+ TINY = 7
11
11
  PRE = nil
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -90,9 +90,13 @@ module I18n
90
90
  when Hash, Array
91
91
  Array.wrap(fallbacks)
92
92
  else # TrueClass
93
- []
93
+ [I18n.default_locale]
94
94
  end
95
95
 
96
+ if args.empty? || args.first.is_a?(Hash)
97
+ args.unshift I18n.default_locale
98
+ end
99
+
96
100
  I18n.fallbacks = I18n::Locale::Fallbacks.new(*args)
97
101
  end
98
102
 
@@ -43,7 +43,8 @@ module ActiveSupport
43
43
  end
44
44
  }
45
45
  end
46
- result = Marshal.dump(dup)
46
+ test_result = defined?(Minitest::Result) ? Minitest::Result.from(self) : dup
47
+ result = Marshal.dump(test_result)
47
48
  end
48
49
 
49
50
  write.puts [result].pack("m")
@@ -67,8 +68,9 @@ module ActiveSupport
67
68
 
68
69
  if ENV["ISOLATION_TEST"]
69
70
  yield
71
+ test_result = defined?(Minitest::Result) ? Minitest::Result.from(self) : dup
70
72
  File.open(ENV["ISOLATION_OUTPUT"], "w") do |file|
71
- file.puts [Marshal.dump(dup)].pack("m")
73
+ file.puts [Marshal.dump(test_result)].pack("m")
72
74
  end
73
75
  exit!
74
76
  else
@@ -258,11 +258,14 @@ module ActiveSupport
258
258
  country = TZInfo::Country.get(code)
259
259
  country.zone_identifiers.map do |tz_id|
260
260
  if MAPPING.value?(tz_id)
261
- self[MAPPING.key(tz_id)]
261
+ MAPPING.inject([]) do |memo, (key, value)|
262
+ memo << self[key] if value == tz_id
263
+ memo
264
+ end
262
265
  else
263
266
  create(tz_id, nil, TZInfo::Timezone.new(tz_id))
264
267
  end
265
- end.sort!
268
+ end.flatten(1).sort!
266
269
  end
267
270
 
268
271
  def zones_map
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesupport
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.4
4
+ version: 5.1.7
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-09-08 00:00:00.000000000 Z
11
+ date: 2019-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.7'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0.7'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: tzinfo
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -98,6 +104,7 @@ files:
98
104
  - lib/active_support/cache/strategy/local_cache_middleware.rb
99
105
  - lib/active_support/callbacks.rb
100
106
  - lib/active_support/concern.rb
107
+ - lib/active_support/concurrency/load_interlock_aware_monitor.rb
101
108
  - lib/active_support/concurrency/share_lock.rb
102
109
  - lib/active_support/configurable.rb
103
110
  - lib/active_support/core_ext.rb
@@ -313,7 +320,9 @@ files:
313
320
  homepage: http://rubyonrails.org
314
321
  licenses:
315
322
  - MIT
316
- metadata: {}
323
+ metadata:
324
+ source_code_uri: https://github.com/rails/rails/tree/v5.1.7/activesupport
325
+ changelog_uri: https://github.com/rails/rails/blob/v5.1.7/activesupport/CHANGELOG.md
317
326
  post_install_message:
318
327
  rdoc_options:
319
328
  - "--encoding"
@@ -331,8 +340,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
331
340
  - !ruby/object:Gem::Version
332
341
  version: '0'
333
342
  requirements: []
334
- rubyforge_project:
335
- rubygems_version: 2.6.13
343
+ rubygems_version: 3.0.1
336
344
  signing_key:
337
345
  specification_version: 4
338
346
  summary: A toolkit of support libraries and Ruby core extensions extracted from the