activesupport 6.1.0.rc2 → 6.1.3

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: 8a801cecf8aae6d08952dcacf312cebafbeca4cbc14686a1fef35a1b828a3cf0
4
- data.tar.gz: fa4bcb04c962537481e6d7cc085ab531dd9453e58ce63f005d400c157a3c8941
3
+ metadata.gz: 0fd56b6e7b594d2bb95b107f35ff63359e6c2d20e57d009a23ac27b53bbaf22a
4
+ data.tar.gz: 4f2942e1edf853a4096aa0b305cbe79dc1f7cb4e3757e65937e98e8616d26288
5
5
  SHA512:
6
- metadata.gz: 8924d63480e794f63b392f28413423989c411a1266b9d4252fa1a022a5b8b2c6b6bc10e27b2274485a52ad4c355ec2796e49c8a2a2a82efe65c9689d6a418006
7
- data.tar.gz: fa558b277555caff9fa9e76084ffd58b370d7ad79f30189b9b4c064f9d441975f51351c2c3a21f42e28d7a11b8d7bc9a6fe465ae4f2766278638cc7c269a1341
6
+ metadata.gz: 2e0f1c3e75c7b2cbe2cc418e037200d219c54308ddf5dbacbc4d48f540f7bbf131fe7bb875550e519f292fcdc5617ef08c231bc82fa89a3f5235bee0ce4ee476
7
+ data.tar.gz: 4febcb65ed635c37dc00ff243c22b0328523b9c5ff56feab13efc7c4647de1c4dcdf6c4c24fb7b80e22b57367343bfe2a4f994aab1c612b82a37719110e10f54
data/CHANGELOG.md CHANGED
@@ -1,12 +1,63 @@
1
- ## Rails 6.1.0.rc2 (December 01, 2020) ##
1
+ ## Rails 6.1.3 (February 17, 2021) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 6.1.2.1 (February 10, 2021) ##
7
+
8
+ * No changes.
9
+
10
+
11
+ ## Rails 6.1.2 (February 09, 2021) ##
12
+
13
+ * `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
14
+
15
+ ```ruby
16
+ config.cache_store = :mem_cache_store, nil
17
+
18
+ # is now equivalent to
19
+
20
+ config.cache_store = :mem_cache_store
21
+
22
+ # and is also equivalent to
23
+
24
+ config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
25
+
26
+ # which is the fallback behavior of Dalli
27
+ ```
28
+
29
+ This helps those migrating from `:dalli_store`, where an explicit `nil` was permitted.
30
+
31
+ *Michael Overmeyer*
32
+
33
+
34
+ ## Rails 6.1.1 (January 07, 2021) ##
35
+
36
+ * Change `IPAddr#to_json` to match the behavior of the json gem returning the string representation
37
+ instead of the instance variables of the object.
38
+
39
+ Before:
40
+
41
+ ```ruby
42
+ IPAddr.new("127.0.0.1").to_json
43
+ # => "{\"addr\":2130706433,\"family\":2,\"mask_addr\":4294967295}"
44
+ ```
45
+
46
+ After:
47
+
48
+ ```ruby
49
+ IPAddr.new("127.0.0.1").to_json
50
+ # => "\"127.0.0.1\""
51
+ ```
52
+
53
+
54
+ ## Rails 6.1.0 (December 09, 2020) ##
2
55
 
3
56
  * Ensure `MemoryStore` disables compression by default. Reverts behavior of
4
57
  `MemoryStore` to its prior rails `5.1` behavior.
5
58
 
6
59
  *Max Gurewitz*
7
60
 
8
- ## Rails 6.1.0.rc1 (November 02, 2020) ##
9
-
10
61
  * Calling `iso8601` on negative durations retains the negative sign on individual
11
62
  digits instead of prepending it.
12
63
 
data/README.rdoc CHANGED
@@ -15,7 +15,7 @@ The latest version of Active Support can be installed with RubyGems:
15
15
 
16
16
  Source code can be downloaded as part of the Rails project on GitHub:
17
17
 
18
- * https://github.com/rails/rails/tree/master/activesupport
18
+ * https://github.com/rails/rails/tree/main/activesupport
19
19
 
20
20
 
21
21
  == License
@@ -64,7 +64,7 @@ module ActiveSupport
64
64
  def self.build_mem_cache(*addresses) # :nodoc:
65
65
  addresses = addresses.flatten
66
66
  options = addresses.extract_options!
67
- addresses = nil if addresses.empty?
67
+ addresses = nil if addresses.compact.empty?
68
68
  pool_options = retrieve_pool_options(options)
69
69
 
70
70
  if pool_options.empty?
@@ -185,10 +185,14 @@ module ActiveSupport
185
185
  # before applying the regular expression to ensure we are escaping all
186
186
  # characters properly.
187
187
  def normalize_key(key, options)
188
- key = super.dup
189
- key = key.force_encoding(Encoding::ASCII_8BIT)
190
- key = key.gsub(ESCAPE_KEY_CHARS) { |match| "%#{match.getbyte(0).to_s(16).upcase}" }
191
- key = "#{key[0, 213]}:md5:#{ActiveSupport::Digest.hexdigest(key)}" if key.size > 250
188
+ key = super
189
+
190
+ if key
191
+ key = key.dup.force_encoding(Encoding::ASCII_8BIT)
192
+ key = key.gsub(ESCAPE_KEY_CHARS) { |match| "%#{match.getbyte(0).to_s(16).upcase}" }
193
+ key = "#{key[0, 213]}:md5:#{ActiveSupport::Digest.hexdigest(key)}" if key.size > 250
194
+ end
195
+
192
196
  key
193
197
  end
194
198
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Dir.glob(File.expand_path("core_ext/*.rb", __dir__)).each do |path|
3
+ Dir.glob(File.expand_path("core_ext/*.rb", __dir__)).sort.each do |path|
4
4
  require path
5
5
  end
@@ -3,6 +3,7 @@
3
3
  # Hack to load json gem first so we can overwrite its to_json.
4
4
  require "json"
5
5
  require "bigdecimal"
6
+ require "ipaddr"
6
7
  require "uri/generic"
7
8
  require "pathname"
8
9
  require "active_support/core_ext/big_decimal/conversions" # for #to_s
@@ -219,6 +220,12 @@ class Pathname #:nodoc:
219
220
  end
220
221
  end
221
222
 
223
+ class IPAddr # :nodoc:
224
+ def as_json(options = nil)
225
+ to_s
226
+ end
227
+ end
228
+
222
229
  class Process::Status #:nodoc:
223
230
  def as_json(options = nil)
224
231
  { exitstatus: exitstatus, pid: pid }
@@ -84,7 +84,7 @@ class ERB
84
84
  # use inside HTML attributes.
85
85
  #
86
86
  # If your JSON is being used downstream for insertion into the DOM, be aware of
87
- # whether or not it is being inserted via +html()+. Most jQuery plugins do this.
87
+ # whether or not it is being inserted via <tt>html()</tt>. Most jQuery plugins do this.
88
88
  # If that is the case, be sure to +html_escape+ or +sanitize+ any user-generated
89
89
  # content returned by your JSON.
90
90
  #
@@ -42,8 +42,14 @@ class Time
42
42
 
43
43
  # Layers additional behavior on Time.at so that ActiveSupport::TimeWithZone and DateTime
44
44
  # instances can be used when called with a single argument
45
- def at_with_coercion(*args)
46
- return at_without_coercion(*args) if args.size != 1
45
+ def at_with_coercion(*args, **kwargs)
46
+ if args.size != 1
47
+ if kwargs.empty?
48
+ return at_without_coercion(*args)
49
+ else
50
+ return at_without_coercion(*args, **kwargs)
51
+ end
52
+ end
47
53
 
48
54
  # Time.at can be called with a time or numerical value
49
55
  time_or_number = args.first
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "time"
3
4
  require "active_support/inflector/methods"
4
5
  require "active_support/values/time_zone"
5
6
 
@@ -9,8 +9,8 @@ module ActiveSupport
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 1
12
- TINY = 0
13
- PRE = "rc2"
12
+ TINY = 3
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -113,7 +113,7 @@ module ActiveSupport
113
113
  # <tt>ActiveSupport::HashWithIndifferentAccess</tt> or a regular +Hash+.
114
114
  # In either case the merge respects the semantics of indifferent access.
115
115
  #
116
- # If the argument is a regular hash with keys +:key+ and +"key"+ only one
116
+ # If the argument is a regular hash with keys +:key+ and <tt>"key"</tt> only one
117
117
  # of the values end up in the receiver, but which one is unspecified.
118
118
  #
119
119
  # When given a block, the value for duplicated keys will be determined
@@ -363,8 +363,14 @@ module ActiveSupport
363
363
  end
364
364
 
365
365
  private
366
- def convert_key(key)
367
- key.kind_of?(Symbol) ? key.to_s : key
366
+ if Symbol.method_defined?(:name)
367
+ def convert_key(key)
368
+ key.kind_of?(Symbol) ? key.name : key
369
+ end
370
+ else
371
+ def convert_key(key)
372
+ key.kind_of?(Symbol) ? key.to_s : key
373
+ end
368
374
  end
369
375
 
370
376
  def convert_value(value, conversion: nil)
@@ -178,7 +178,7 @@ module ActiveSupport
178
178
  #
179
179
  # Subscribers using a regexp or other pattern-matching object will remain subscribed
180
180
  # to all events that match their original pattern, unless those events match a string
181
- # passed to `unsubscribe`:
181
+ # passed to +unsubscribe+:
182
182
  #
183
183
  # subscriber = ActiveSupport::Notifications.subscribe(/render/) { }
184
184
  # ActiveSupport::Notifications.unsubscribe('render_template.action_view')
@@ -33,7 +33,7 @@ module ActiveSupport
33
33
  #
34
34
  # ==== Options
35
35
  #
36
- # * <tt>:mask</tt> - A replaced object when filtered. Defaults to +"[FILTERED]"+
36
+ # * <tt>:mask</tt> - A replaced object when filtered. Defaults to <tt>"[FILTERED]"</tt>.
37
37
  def initialize(filters = [], mask: FILTERED)
38
38
  @filters = filters
39
39
  @mask = mask
@@ -14,12 +14,12 @@ module ActiveSupport
14
14
  end
15
15
 
16
16
  module ClassMethods
17
- # Rescue exceptions raised in controller actions.
17
+ # Registers exception classes with a handler to be called by <tt>rescue_with_handler</tt>.
18
18
  #
19
19
  # <tt>rescue_from</tt> receives a series of exception classes or class
20
- # names, and a trailing <tt>:with</tt> option with the name of a method
21
- # or a Proc object to be called to handle them. Alternatively a block can
22
- # be given.
20
+ # names, and an exception handler specified by a trailing <tt>:with</tt>
21
+ # option containing the name of a method or a Proc object. Alternatively, a block
22
+ # can be given as the handler.
23
23
  #
24
24
  # Handlers that take one argument will be called with the exception, so
25
25
  # that the exception can be inspected when dealing with it.
@@ -301,7 +301,7 @@ module ActiveSupport
301
301
  alias_method :in, :+
302
302
 
303
303
  # Subtracts an interval of time and returns a new TimeWithZone object unless
304
- # the other value `acts_like?` time. Then it will return a Float of the difference
304
+ # the other value +acts_like?+ time. Then it will return a Float of the difference
305
305
  # between the two times that represents the difference between the current
306
306
  # object's time and the +other+ time.
307
307
  #
@@ -508,7 +508,7 @@ module ActiveSupport
508
508
  # Time#in_time_zone() instead.
509
509
  #
510
510
  # As of tzinfo 2, utc_to_local returns a Time with a non-zero utc_offset.
511
- # See the `utc_to_local_returns_utc_offset_times` config for more info.
511
+ # See the +utc_to_local_returns_utc_offset_times+ config for more info.
512
512
  def utc_to_local(time)
513
513
  tzinfo.utc_to_local(time).yield_self do |t|
514
514
  ActiveSupport.utc_to_local_returns_utc_offset_times ?
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.1.0.rc2
4
+ version: 6.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-01 00:00:00.000000000 Z
11
+ date: 2021-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -357,11 +357,11 @@ licenses:
357
357
  - MIT
358
358
  metadata:
359
359
  bug_tracker_uri: https://github.com/rails/rails/issues
360
- changelog_uri: https://github.com/rails/rails/blob/v6.1.0.rc2/activesupport/CHANGELOG.md
361
- documentation_uri: https://api.rubyonrails.org/v6.1.0.rc2/
360
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.3/activesupport/CHANGELOG.md
361
+ documentation_uri: https://api.rubyonrails.org/v6.1.3/
362
362
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
363
- source_code_uri: https://github.com/rails/rails/tree/v6.1.0.rc2/activesupport
364
- post_install_message:
363
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.3/activesupport
364
+ post_install_message:
365
365
  rdoc_options:
366
366
  - "--encoding"
367
367
  - UTF-8
@@ -374,12 +374,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
374
374
  version: 2.5.0
375
375
  required_rubygems_version: !ruby/object:Gem::Requirement
376
376
  requirements:
377
- - - ">"
377
+ - - ">="
378
378
  - !ruby/object:Gem::Version
379
- version: 1.3.1
379
+ version: '0'
380
380
  requirements: []
381
- rubygems_version: 3.1.4
382
- signing_key:
381
+ rubygems_version: 3.2.3
382
+ signing_key:
383
383
  specification_version: 4
384
384
  summary: A toolkit of support libraries and Ruby core extensions extracted from the
385
385
  Rails framework.