activesupport 6.0.0 → 6.0.1.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: 20a0c971abcca4b9dabec6e28ef72c919a6ffaed5e35b29e4c3e2f359e99341b
4
- data.tar.gz: e42089cf6ad412ef2fcf772afd6a8e010944b57fde1833c9d495dfb9c5eb3da5
3
+ metadata.gz: d3c9f64a0fa571b426006ded74ceecc254256afa6bbea8d9e649cf34d664cb57
4
+ data.tar.gz: 64ade9a0efc8f6dc95247de518d84cbf1402a44532e189d982baf323190b7810
5
5
  SHA512:
6
- metadata.gz: 8ff0c3e5feb9bb0dfcf5e0c95b4fb5bb8c6a30d2e276101c8ec949db9ad0895c397dc33cc1a99ec2636b45b3169a495eb8c852440956d8500d95399548b70948
7
- data.tar.gz: fdf6945ee23e487a9b0403fcac9a7b51551900a6338a4caeb34970656033fd1e62c00eda5d463fb6fc3d0ad880470c7544f2a2108bcc5809520a8436d1bdf360
6
+ metadata.gz: 62adb7ae6be4bf4ceac08aa3d518568b77b642fe4ac16c5c69369402f8b274c1903a4b750b2c4b78b3873ad1a10388099c9435250e1fa25eaa3fadee3ba2743a
7
+ data.tar.gz: 94305170cdb8f4532cf1c7b2c986680c860f7519f7ff40706ae8137d06bb067bea1e5065c3bb05251b8c657b3065bcc27982a57430b8c47020ea60ee88c498ae
@@ -1,3 +1,47 @@
1
+ ## Rails 6.0.1.rc1 (October 31, 2019) ##
2
+
3
+ * `ActiveSupport::SafeBuffer` supports `Enumerator` methods.
4
+
5
+ *Shugo Maeda*
6
+
7
+ * The Redis cache store fails gracefully when the server returns a "max number
8
+ of clients reached" error.
9
+
10
+ *Brandon Medenwald*
11
+
12
+ * Fixed that mutating a value returned by a memory cache store would
13
+ unexpectedly change the cached value.
14
+
15
+ *Jonathan Hyman*
16
+
17
+ * The default inflectors in `zeitwerk` mode support overrides:
18
+
19
+ ```ruby
20
+ # config/initializers/zeitwerk.rb
21
+ Rails.autoloaders.each do |autoloader|
22
+ autoloader.inflector.inflect(
23
+ "html_parser" => "HTMLParser",
24
+ "ssl_error" => "SSLError"
25
+ )
26
+ end
27
+ ```
28
+
29
+ That way, you can tweak how individual basenames are inflected without touching Active Support inflection rules, which are global. These inflectors fallback to `String#camelize`, so existing inflection rules are still taken into account for non-overridden basenames.
30
+
31
+ Please, check the [autoloading guide for `zeitwerk` mode](https://guides.rubyonrails.org/v6.0/autoloading_and_reloading_constants.html#customizing-inflections) if you prefer not to depend on `String#camelize` at all.
32
+
33
+ *Xavier Noria*
34
+
35
+ * Improve `Range#===`, `Range#include?`, and `Range#cover?` to work with beginless (startless)
36
+ and endless range targets.
37
+
38
+ *Allen Hsu*, *Andrew Hodgkinson*
39
+
40
+ * Don't use `Process#clock_gettime(CLOCK_PROCESS_CPUTIME_ID)` on Solaris
41
+
42
+ *Iain Beeston*
43
+
44
+
1
45
  ## Rails 6.0.0 (August 16, 2019) ##
2
46
 
3
47
  * Let `require_dependency` in `zeitwerk` mode look the autoload paths up for
@@ -49,6 +93,7 @@
49
93
 
50
94
  *Aaron Lipman*
51
95
 
96
+
52
97
  ## Rails 6.0.0.rc2 (July 22, 2019) ##
53
98
 
54
99
  * `truncate` would return the original string if it was too short to be truncated
@@ -125,6 +125,8 @@ module ActiveSupport
125
125
  entry = @data[key]
126
126
  synchronize do
127
127
  if entry
128
+ entry = entry.dup
129
+ entry.dup_value!
128
130
  @key_access[key] = Time.now.to_f
129
131
  else
130
132
  @key_access.delete(key)
@@ -471,7 +471,7 @@ module ActiveSupport
471
471
 
472
472
  def failsafe(method, returning: nil)
473
473
  yield
474
- rescue ::Redis::BaseConnectionError => e
474
+ rescue ::Redis::BaseError => e
475
475
  handle_exception exception: e, method: method, returning: returning
476
476
  returning
477
477
  end
@@ -11,13 +11,15 @@ module ActiveSupport
11
11
  # The native Range#=== behavior is untouched.
12
12
  # ('a'..'f') === ('c') # => true
13
13
  # (5..9) === (11) # => false
14
+ #
15
+ # The given range must be fully bounded, with both start and end.
14
16
  def ===(value)
15
17
  if value.is_a?(::Range)
16
18
  # 1...10 includes 1..9 but it does not include 1..10.
17
19
  # 1..10 includes 1...11 but it does not include 1...12.
18
20
  operator = exclude_end? && !value.exclude_end? ? :< : :<=
19
21
  value_max = !exclude_end? && value.exclude_end? ? value.max : value.last
20
- super(value.first) && value_max.send(operator, last)
22
+ super(value.first) && (self.end.nil? || value_max.send(operator, last))
21
23
  else
22
24
  super
23
25
  end
@@ -32,13 +34,15 @@ module ActiveSupport
32
34
  # The native Range#include? behavior is untouched.
33
35
  # ('a'..'f').include?('c') # => true
34
36
  # (5..9).include?(11) # => false
37
+ #
38
+ # The given range must be fully bounded, with both start and end.
35
39
  def include?(value)
36
40
  if value.is_a?(::Range)
37
41
  # 1...10 includes 1..9 but it does not include 1..10.
38
42
  # 1..10 includes 1...11 but it does not include 1...12.
39
43
  operator = exclude_end? && !value.exclude_end? ? :< : :<=
40
44
  value_max = !exclude_end? && value.exclude_end? ? value.max : value.last
41
- super(value.first) && value_max.send(operator, last)
45
+ super(value.first) && (self.end.nil? || value_max.send(operator, last))
42
46
  else
43
47
  super
44
48
  end
@@ -53,13 +57,15 @@ module ActiveSupport
53
57
  # The native Range#cover? behavior is untouched.
54
58
  # ('a'..'f').cover?('c') # => true
55
59
  # (5..9).cover?(11) # => false
60
+ #
61
+ # The given range must be fully bounded, with both start and end.
56
62
  def cover?(value)
57
63
  if value.is_a?(::Range)
58
64
  # 1...10 covers 1..9 but it does not cover 1..10.
59
65
  # 1..10 covers 1...11 but it does not cover 1...12.
60
66
  operator = exclude_end? && !value.exclude_end? ? :< : :<=
61
67
  value_max = !exclude_end? && value.exclude_end? ? value.max : value.last
62
- super(value.first) && value_max.send(operator, last)
68
+ super(value.first) && (self.end.nil? || value_max.send(operator, last))
63
69
  else
64
70
  super
65
71
  end
@@ -9,9 +9,9 @@ module ActiveSupport
9
9
  # (1.hour.ago..1.hour.from_now).include?(Time.current) # => true
10
10
  #
11
11
  def include?(value)
12
- if first.is_a?(TimeWithZone)
12
+ if self.begin.is_a?(TimeWithZone)
13
13
  cover?(value)
14
- elsif last.is_a?(TimeWithZone)
14
+ elsif self.end.is_a?(TimeWithZone)
15
15
  cover?(value)
16
16
  else
17
17
  super
@@ -298,6 +298,8 @@ module ActiveSupport #:nodoc:
298
298
 
299
299
  def set_block_back_references(block, match_data)
300
300
  block.binding.eval("proc { |m| $~ = m }").call(match_data)
301
+ rescue ArgumentError
302
+ # Can't create binding from C level Proc
301
303
  end
302
304
  end
303
305
  end
@@ -54,8 +54,16 @@ module ActiveSupport
54
54
  end
55
55
 
56
56
  module Inflector
57
+ # Concurrent::Map is not needed. This is a private class, and overrides
58
+ # must be defined while the application boots.
59
+ @overrides = {}
60
+
57
61
  def self.camelize(basename, _abspath)
58
- basename.camelize
62
+ @overrides[basename] || basename.camelize
63
+ end
64
+
65
+ def self.inflect(overrides)
66
+ @overrides.merge!(overrides)
59
67
  end
60
68
  end
61
69
 
@@ -338,8 +338,8 @@ module ActiveSupport
338
338
  # 1.year.to_i # => 31556952
339
339
  #
340
340
  # In such cases, Ruby's core
341
- # Date[http://ruby-doc.org/stdlib/libdoc/date/rdoc/Date.html] and
342
- # Time[http://ruby-doc.org/stdlib/libdoc/time/rdoc/Time.html] should be used for precision
341
+ # Date[https://ruby-doc.org/stdlib/libdoc/date/rdoc/Date.html] and
342
+ # Time[https://ruby-doc.org/stdlib/libdoc/time/rdoc/Time.html] should be used for precision
343
343
  # date and time arithmetic.
344
344
  def to_i
345
345
  @value.to_i
@@ -9,8 +9,8 @@ module ActiveSupport
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 0
12
- TINY = 0
13
- PRE = nil
12
+ TINY = 1
13
+ PRE = "rc1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -57,7 +57,8 @@ module ActiveSupport
57
57
 
58
58
  def self.clock_gettime_supported? # :nodoc:
59
59
  defined?(Process::CLOCK_PROCESS_CPUTIME_ID) &&
60
- !Gem.win_platform?
60
+ !Gem.win_platform? &&
61
+ !RUBY_PLATFORM.match?(/solaris/i)
61
62
  end
62
63
  private_class_method :clock_gettime_supported?
63
64
 
@@ -16,7 +16,7 @@ module ActiveSupport
16
16
  # oh.keys # => [:a, :b], this order is guaranteed
17
17
  #
18
18
  # Also, maps the +omap+ feature for YAML files
19
- # (See http://yaml.org/type/omap.html) to support ordered items
19
+ # (See https://yaml.org/type/omap.html) to support ordered items
20
20
  # when loading from yaml.
21
21
  #
22
22
  # <tt>ActiveSupport::OrderedHash</tt> is namespaced to prevent conflicts
@@ -39,7 +39,7 @@ module ActiveSupport
39
39
  end
40
40
 
41
41
  def method_missing(name, *args)
42
- name_string = name.to_s
42
+ name_string = +name.to_s
43
43
  if name_string.chomp!("=")
44
44
  self[name_string] = args.first
45
45
  else
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: 6.0.0
4
+ version: 6.0.1.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: 2019-08-16 00:00:00.000000000 Z
11
+ date: 2019-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -84,20 +84,14 @@ dependencies:
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: '2.1'
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: 2.1.8
87
+ version: '2.2'
91
88
  type: :runtime
92
89
  prerelease: false
93
90
  version_requirements: !ruby/object:Gem::Requirement
94
91
  requirements:
95
92
  - - "~>"
96
93
  - !ruby/object:Gem::Version
97
- version: '2.1'
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- version: 2.1.8
94
+ version: '2.2'
101
95
  description: A toolkit of support libraries and Ruby core extensions extracted from
102
96
  the Rails framework. Rich support for multibyte strings, internationalization, time
103
97
  zones, and testing.
@@ -358,8 +352,11 @@ homepage: https://rubyonrails.org
358
352
  licenses:
359
353
  - MIT
360
354
  metadata:
361
- source_code_uri: https://github.com/rails/rails/tree/v6.0.0/activesupport
362
- changelog_uri: https://github.com/rails/rails/blob/v6.0.0/activesupport/CHANGELOG.md
355
+ bug_tracker_uri: https://github.com/rails/rails/issues
356
+ changelog_uri: https://github.com/rails/rails/blob/v6.0.1.rc1/activesupport/CHANGELOG.md
357
+ documentation_uri: https://api.rubyonrails.org/v6.0.1.rc1/
358
+ mailing_list_uri: https://groups.google.com/forum/#!forum/rubyonrails-talk
359
+ source_code_uri: https://github.com/rails/rails/tree/v6.0.1.rc1/activesupport
363
360
  post_install_message:
364
361
  rdoc_options:
365
362
  - "--encoding"
@@ -373,11 +370,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
373
370
  version: 2.5.0
374
371
  required_rubygems_version: !ruby/object:Gem::Requirement
375
372
  requirements:
376
- - - ">="
373
+ - - ">"
377
374
  - !ruby/object:Gem::Version
378
- version: '0'
375
+ version: 1.3.1
379
376
  requirements: []
380
- rubygems_version: 3.0.1
377
+ rubygems_version: 3.0.3
381
378
  signing_key:
382
379
  specification_version: 4
383
380
  summary: A toolkit of support libraries and Ruby core extensions extracted from the