activesupport 6.1.0 → 6.1.3.1

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: 89f141c86a0ef71902f1230ba93a5f91793d87815800871ec2ea1c71a2ad8d2a
4
- data.tar.gz: d3e98c9579e71177d76562012bdc4480311b828bb95787478cc968e8efe93bb9
3
+ metadata.gz: 5939db2eea2758243afc2711cfa5ff5b17fcc8e4f5ecdce9a6641686e22483fd
4
+ data.tar.gz: 90d04936754a5dd516a7f45fd27a4a5900811dc5ed92b52d057f49bbcc15f303
5
5
  SHA512:
6
- metadata.gz: ffc37bacd14d2786f7c5cf287040c1e8a5e39a362badf48f85edd8dd6067dbaa4a69252d21900ea91e34f66c69f6c03817f211c30891b9e8a0d0ee4cf7e36290
7
- data.tar.gz: 68172692e1dc857e587dbc2a2351b61d26e1957185bf74791109ffcf6b20ac3561884d5bc00b8f5a1a62430bd3fb57195c73d6ed7486d1b7c3b61b58bcf3e92a
6
+ metadata.gz: 3a1537343cc0d2d01eaf014660d8781ec0902b06e01ddf9c685a4a96c3518dadd4113e80e0ea5efd3d63ae09721ce6e81054338b8ecd22c6afce55b1a804295b
7
+ data.tar.gz: e6f61e34159c2fe13a3de215e2c44fce57572352f9d33000ec58b97f8589a4bc85029527d90ba13c46feefae475431c093f382f29888ee922a3bdeade6f86fd2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,61 @@
1
+ ## Rails 6.1.3.1 (March 26, 2021) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 6.1.3 (February 17, 2021) ##
7
+
8
+ * No changes.
9
+
10
+
11
+ ## Rails 6.1.2.1 (February 10, 2021) ##
12
+
13
+ * No changes.
14
+
15
+
16
+ ## Rails 6.1.2 (February 09, 2021) ##
17
+
18
+ * `ActiveSupport::Cache::MemCacheStore` now accepts an explicit `nil` for its `addresses` argument.
19
+
20
+ ```ruby
21
+ config.cache_store = :mem_cache_store, nil
22
+
23
+ # is now equivalent to
24
+
25
+ config.cache_store = :mem_cache_store
26
+
27
+ # and is also equivalent to
28
+
29
+ config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
30
+
31
+ # which is the fallback behavior of Dalli
32
+ ```
33
+
34
+ This helps those migrating from `:dalli_store`, where an explicit `nil` was permitted.
35
+
36
+ *Michael Overmeyer*
37
+
38
+
39
+ ## Rails 6.1.1 (January 07, 2021) ##
40
+
41
+ * Change `IPAddr#to_json` to match the behavior of the json gem returning the string representation
42
+ instead of the instance variables of the object.
43
+
44
+ Before:
45
+
46
+ ```ruby
47
+ IPAddr.new("127.0.0.1").to_json
48
+ # => "{\"addr\":2130706433,\"family\":2,\"mask_addr\":4294967295}"
49
+ ```
50
+
51
+ After:
52
+
53
+ ```ruby
54
+ IPAddr.new("127.0.0.1").to_json
55
+ # => "\"127.0.0.1\""
56
+ ```
57
+
58
+
1
59
  ## Rails 6.1.0 (December 09, 2020) ##
2
60
 
3
61
  * Ensure `MemoryStore` disables compression by default. Reverts behavior of
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 = nil
12
+ TINY = 3
13
+ PRE = "1"
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
@@ -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
4
+ version: 6.1.3.1
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: 2020-12-09 00:00:00.000000000 Z
11
+ date: 2021-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -357,10 +357,10 @@ 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/activesupport/CHANGELOG.md
361
- documentation_uri: https://api.rubyonrails.org/v6.1.0/
360
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.3.1/activesupport/CHANGELOG.md
361
+ documentation_uri: https://api.rubyonrails.org/v6.1.3.1/
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/activesupport
363
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.3.1/activesupport
364
364
  post_install_message:
365
365
  rdoc_options:
366
366
  - "--encoding"
@@ -378,7 +378,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
378
378
  - !ruby/object:Gem::Version
379
379
  version: '0'
380
380
  requirements: []
381
- rubygems_version: 3.1.4
381
+ rubygems_version: 3.1.2
382
382
  signing_key:
383
383
  specification_version: 4
384
384
  summary: A toolkit of support libraries and Ruby core extensions extracted from the