activesupport 5.2.1.1 → 5.2.2.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
  SHA256:
3
- metadata.gz: 012f11c548ca33d5985eb783e46a9d962b5cf3c22f007f74a39e8120da80b2d4
4
- data.tar.gz: 1157743e77c0a3dceff1f24dfe39adf5c06654b522b13c999ff04d37888f85b5
3
+ metadata.gz: a9f5cee3b2049e5bf0b643a26ff0ceb9e194f6ab9a1e90e94ffa9fd3d8147d8d
4
+ data.tar.gz: 6eb3a9ce44a62ea94a536a288aa20581fb1e259fd235c0d06f75548a32f9a194
5
5
  SHA512:
6
- metadata.gz: 3cd090a071824b4ec714de532134d06bb89e9c70d99d3e7acb0c6bf5b32019a5b3f5cf1c51b12855edb4617f484c4610b4398c212ef6d1bb32d16931b1537b9f
7
- data.tar.gz: 014f671c9490e3c856519bc4d87a220a9998a658c09fe1d842cd616ca320ef2ca522fe0a2edbcbee8dc227b593ba12dea6a29b64e1a4ee9aabf7a56a337446e9
6
+ metadata.gz: 53727fc10c1a3951bf19c3ef26d4fbc407193a3108f754c269fa137ccfae20a18302e440ff7811d51416e14b2a548ee28fa8e7504edcf2da427813ef5a6ab05f
7
+ data.tar.gz: 5b4445cbad27bfc7d1d7ca706594a970cd63a9f1aa5cc705869bdaa71630912c748e9b6ac07ebbbf17bb290efd7e53d1cd29111d0fbf1caf6a8a093e5f0af6fe
@@ -1,3 +1,23 @@
1
+ ## Rails 5.2.2.rc1 (November 28, 2018) ##
2
+
3
+ * Fix bug where `#to_options` for `ActiveSupport::HashWithIndifferentAccess`
4
+ would not act as alias for `#symbolize_keys`.
5
+
6
+ *Nick Weiland*
7
+
8
+ * Improve the logic that detects non-autoloaded constants.
9
+
10
+ *Jan Habermann*, *Xavier Noria*
11
+
12
+ * Fix bug where `URI.unescape` would fail with mixed Unicode/escaped character input:
13
+
14
+ URI.unescape("\xe3\x83\x90") # => "バ"
15
+ URI.unescape("%E3%83%90") # => "バ"
16
+ URI.unescape("\xe3\x83\x90%E3%83%90") # => Encoding::CompatibilityError
17
+
18
+ *Ashe Connor*, *Aaron Patterson*
19
+
20
+
1
21
  ## Rails 5.2.1.1 (November 27, 2018) ##
2
22
 
3
23
  * No changes.
@@ -29,7 +29,7 @@ class File
29
29
  old_stat = if exist?(file_name)
30
30
  # Get original file permissions
31
31
  stat(file_name)
32
- elsif temp_dir != dirname(file_name)
32
+ else
33
33
  # If not possible, probe which are the default permissions in the
34
34
  # destination directory.
35
35
  probe_stat_in(dirname(file_name))
@@ -10,7 +10,7 @@ if RUBY_VERSION < "2.6.0"
10
10
  # YK: My initial experiments say yes, but let's be sure please
11
11
  enc = str.encoding
12
12
  enc = Encoding::UTF_8 if enc == Encoding::US_ASCII
13
- str.gsub(escaped) { |match| [match[1, 2].hex].pack("C") }.force_encoding(enc)
13
+ str.dup.force_encoding(Encoding::ASCII_8BIT).gsub(escaped) { |match| [match[1, 2].hex].pack("C") }.force_encoding(enc)
14
14
  end
15
15
  end
16
16
  end
@@ -97,6 +97,8 @@ module ActiveSupport #:nodoc:
97
97
  # parent.rb then requires namespace/child.rb, the stack will look like
98
98
  # [[Object], [Namespace]].
99
99
 
100
+ attr_reader :watching
101
+
100
102
  def initialize
101
103
  @watching = []
102
104
  @stack = Hash.new { |h, k| h[k] = [] }
@@ -248,7 +250,9 @@ module ActiveSupport #:nodoc:
248
250
 
249
251
  def load_dependency(file)
250
252
  if Dependencies.load? && Dependencies.constant_watch_stack.watching?
251
- Dependencies.new_constants_in(Object) { yield }
253
+ descs = Dependencies.constant_watch_stack.watching.flatten.uniq
254
+
255
+ Dependencies.new_constants_in(*descs) { yield }
252
256
  else
253
257
  yield
254
258
  end
@@ -54,23 +54,26 @@ module ActiveSupport
54
54
  deprecator = options.delete(:deprecator) || self
55
55
  method_names += options.keys
56
56
 
57
- mod = Module.new do
58
- method_names.each do |method_name|
59
- define_method(method_name) do |*args, &block|
60
- deprecator.deprecation_warning(method_name, options[method_name])
61
- super(*args, &block)
62
- end
57
+ method_names.each do |method_name|
58
+ aliased_method, punctuation = method_name.to_s.sub(/([?!=])$/, ""), $1
59
+ with_method = "#{aliased_method}_with_deprecation#{punctuation}"
60
+ without_method = "#{aliased_method}_without_deprecation#{punctuation}"
63
61
 
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
62
+ target_module.send(:define_method, with_method) do |*args, &block|
63
+ deprecator.deprecation_warning(method_name, options[method_name])
64
+ send(without_method, *args, &block)
70
65
  end
71
- end
72
66
 
73
- target_module.prepend(mod)
67
+ target_module.send(:alias_method, without_method, method_name)
68
+ target_module.send(:alias_method, method_name, with_method)
69
+
70
+ case
71
+ when target_module.protected_method_defined?(without_method)
72
+ target_module.send(:protected, method_name)
73
+ when target_module.private_method_defined?(without_method)
74
+ target_module.send(:private, method_name)
75
+ end
76
+ end
74
77
  end
75
78
  end
76
79
  end
@@ -43,7 +43,7 @@ module ActiveSupport
43
43
  end
44
44
 
45
45
  def deserialize(config)
46
- config.present? ? YAML.load(config, content_path) : {}
46
+ YAML.load(config).presence || {}
47
47
  end
48
48
  end
49
49
  end
@@ -9,8 +9,8 @@ module ActiveSupport
9
9
  module VERSION
10
10
  MAJOR = 5
11
11
  MINOR = 2
12
- TINY = 1
13
- PRE = "1"
12
+ TINY = 2
13
+ PRE = "rc1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -288,6 +288,7 @@ module ActiveSupport
288
288
  undef :symbolize_keys!
289
289
  undef :deep_symbolize_keys!
290
290
  def symbolize_keys; to_hash.symbolize_keys! end
291
+ alias_method :to_options, :symbolize_keys
291
292
  def deep_symbolize_keys; to_hash.deep_symbolize_keys! end
292
293
  def to_options!; self end
293
294
 
@@ -88,9 +88,13 @@ module I18n
88
88
  when Hash, Array
89
89
  Array.wrap(fallbacks)
90
90
  else # TrueClass
91
- []
91
+ [I18n.default_locale]
92
92
  end
93
93
 
94
+ if args.empty? || args.first.is_a?(Hash)
95
+ args.unshift I18n.default_locale
96
+ end
97
+
94
98
  I18n.fallbacks = I18n::Locale::Fallbacks.new(*args)
95
99
  end
96
100
 
@@ -84,7 +84,7 @@ module ActiveSupport
84
84
  end
85
85
 
86
86
  def start(name, id, payload)
87
- e = ActiveSupport::Notifications::Event.new(name, Time.now, nil, id, payload)
87
+ e = ActiveSupport::Notifications::Event.new(name, now, nil, id, payload)
88
88
  parent = event_stack.last
89
89
  parent << e if parent
90
90
 
@@ -92,7 +92,7 @@ module ActiveSupport
92
92
  end
93
93
 
94
94
  def finish(name, id, payload)
95
- finished = Time.now
95
+ finished = now
96
96
  event = event_stack.pop
97
97
  event.end = finished
98
98
  event.payload.merge!(payload)
@@ -106,6 +106,10 @@ module ActiveSupport
106
106
  def event_stack
107
107
  SubscriberQueueRegistry.instance.get_queue(@queue_key)
108
108
  end
109
+
110
+ def now
111
+ Process.clock_gettime(Process::CLOCK_MONOTONIC)
112
+ end
109
113
  end
110
114
 
111
115
  # This is a registry for all the event stacks kept for subscribers.
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.2.1.1
4
+ version: 5.2.2.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: 2018-11-27 00:00:00.000000000 Z
11
+ date: 2018-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -331,8 +331,8 @@ homepage: http://rubyonrails.org
331
331
  licenses:
332
332
  - MIT
333
333
  metadata:
334
- source_code_uri: https://github.com/rails/rails/tree/v5.2.1.1/activesupport
335
- changelog_uri: https://github.com/rails/rails/blob/v5.2.1.1/activesupport/CHANGELOG.md
334
+ source_code_uri: https://github.com/rails/rails/tree/v5.2.2.rc1/activesupport
335
+ changelog_uri: https://github.com/rails/rails/blob/v5.2.2.rc1/activesupport/CHANGELOG.md
336
336
  post_install_message:
337
337
  rdoc_options:
338
338
  - "--encoding"
@@ -346,9 +346,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
346
346
  version: 2.2.2
347
347
  required_rubygems_version: !ruby/object:Gem::Requirement
348
348
  requirements:
349
- - - ">="
349
+ - - ">"
350
350
  - !ruby/object:Gem::Version
351
- version: '0'
351
+ version: 1.3.1
352
352
  requirements: []
353
353
  rubyforge_project:
354
354
  rubygems_version: 2.7.6