activesupport 5.1.7 → 5.2.7

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.

Files changed (242) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +424 -512
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +3 -3
  5. data/lib/active_support/all.rb +2 -0
  6. data/lib/active_support/array_inquirer.rb +2 -0
  7. data/lib/active_support/backtrace_cleaner.rb +2 -0
  8. data/lib/active_support/benchmarkable.rb +2 -0
  9. data/lib/active_support/builder.rb +2 -0
  10. data/lib/active_support/cache/file_store.rb +5 -4
  11. data/lib/active_support/cache/mem_cache_store.rb +39 -38
  12. data/lib/active_support/cache/memory_store.rb +2 -0
  13. data/lib/active_support/cache/null_store.rb +2 -0
  14. data/lib/active_support/cache/redis_cache_store.rb +466 -0
  15. data/lib/active_support/cache/strategy/local_cache.rb +33 -2
  16. data/lib/active_support/cache/strategy/local_cache_middleware.rb +2 -0
  17. data/lib/active_support/cache.rb +197 -83
  18. data/lib/active_support/callbacks.rb +28 -39
  19. data/lib/active_support/concern.rb +10 -4
  20. data/lib/active_support/concurrency/share_lock.rb +2 -0
  21. data/lib/active_support/configurable.rb +2 -0
  22. data/lib/active_support/core_ext/array/access.rb +4 -2
  23. data/lib/active_support/core_ext/array/conversions.rb +2 -0
  24. data/lib/active_support/core_ext/array/extract_options.rb +2 -0
  25. data/lib/active_support/core_ext/array/grouping.rb +2 -0
  26. data/lib/active_support/core_ext/array/inquiry.rb +2 -0
  27. data/lib/active_support/core_ext/array/prepend_and_append.rb +4 -2
  28. data/lib/active_support/core_ext/array/wrap.rb +2 -0
  29. data/lib/active_support/core_ext/array.rb +2 -0
  30. data/lib/active_support/core_ext/benchmark.rb +2 -0
  31. data/lib/active_support/core_ext/big_decimal/conversions.rb +2 -0
  32. data/lib/active_support/core_ext/big_decimal.rb +2 -0
  33. data/lib/active_support/core_ext/class/attribute.rb +34 -16
  34. data/lib/active_support/core_ext/class/attribute_accessors.rb +2 -0
  35. data/lib/active_support/core_ext/class/subclasses.rb +1 -2
  36. data/lib/active_support/core_ext/class.rb +2 -0
  37. data/lib/active_support/core_ext/date/acts_like.rb +2 -0
  38. data/lib/active_support/core_ext/date/blank.rb +2 -0
  39. data/lib/active_support/core_ext/date/calculations.rb +2 -0
  40. data/lib/active_support/core_ext/date/conversions.rb +10 -9
  41. data/lib/active_support/core_ext/date/zones.rb +2 -0
  42. data/lib/active_support/core_ext/date.rb +2 -0
  43. data/lib/active_support/core_ext/date_and_time/calculations.rb +50 -16
  44. data/lib/active_support/core_ext/date_and_time/compatibility.rb +3 -1
  45. data/lib/active_support/core_ext/date_and_time/zones.rb +2 -0
  46. data/lib/active_support/core_ext/date_time/acts_like.rb +2 -0
  47. data/lib/active_support/core_ext/date_time/blank.rb +2 -0
  48. data/lib/active_support/core_ext/date_time/calculations.rb +2 -0
  49. data/lib/active_support/core_ext/date_time/compatibility.rb +7 -5
  50. data/lib/active_support/core_ext/date_time/conversions.rb +2 -0
  51. data/lib/active_support/core_ext/date_time.rb +2 -0
  52. data/lib/active_support/core_ext/digest/uuid.rb +3 -1
  53. data/lib/active_support/core_ext/digest.rb +3 -0
  54. data/lib/active_support/core_ext/enumerable.rb +8 -1
  55. data/lib/active_support/core_ext/file/atomic.rb +3 -1
  56. data/lib/active_support/core_ext/file.rb +2 -0
  57. data/lib/active_support/core_ext/hash/compact.rb +2 -0
  58. data/lib/active_support/core_ext/hash/conversions.rb +4 -2
  59. data/lib/active_support/core_ext/hash/deep_merge.rb +8 -12
  60. data/lib/active_support/core_ext/hash/except.rb +2 -0
  61. data/lib/active_support/core_ext/hash/indifferent_access.rb +2 -0
  62. data/lib/active_support/core_ext/hash/keys.rb +2 -0
  63. data/lib/active_support/core_ext/hash/reverse_merge.rb +5 -2
  64. data/lib/active_support/core_ext/hash/slice.rb +4 -4
  65. data/lib/active_support/core_ext/hash/transform_values.rb +2 -0
  66. data/lib/active_support/core_ext/hash.rb +2 -0
  67. data/lib/active_support/core_ext/integer/inflections.rb +2 -0
  68. data/lib/active_support/core_ext/integer/multiple.rb +2 -0
  69. data/lib/active_support/core_ext/integer/time.rb +7 -14
  70. data/lib/active_support/core_ext/integer.rb +2 -0
  71. data/lib/active_support/core_ext/kernel/agnostics.rb +2 -0
  72. data/lib/active_support/core_ext/kernel/concern.rb +2 -0
  73. data/lib/active_support/core_ext/kernel/reporting.rb +2 -0
  74. data/lib/active_support/core_ext/kernel/singleton_class.rb +2 -0
  75. data/lib/active_support/core_ext/kernel.rb +2 -0
  76. data/lib/active_support/core_ext/load_error.rb +2 -7
  77. data/lib/active_support/core_ext/marshal.rb +2 -0
  78. data/lib/active_support/core_ext/module/aliasing.rb +2 -0
  79. data/lib/active_support/core_ext/module/anonymous.rb +2 -0
  80. data/lib/active_support/core_ext/module/attr_internal.rb +2 -0
  81. data/lib/active_support/core_ext/module/attribute_accessors.rb +21 -24
  82. data/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +2 -0
  83. data/lib/active_support/core_ext/module/concerning.rb +7 -8
  84. data/lib/active_support/core_ext/module/delegation.rb +31 -29
  85. data/lib/active_support/core_ext/module/deprecation.rb +2 -0
  86. data/lib/active_support/core_ext/module/introspection.rb +2 -0
  87. data/lib/active_support/core_ext/module/reachable.rb +3 -0
  88. data/lib/active_support/core_ext/module/redefine_method.rb +49 -0
  89. data/lib/active_support/core_ext/module/remove_method.rb +5 -23
  90. data/lib/active_support/core_ext/module.rb +3 -0
  91. data/lib/active_support/core_ext/name_error.rb +7 -0
  92. data/lib/active_support/core_ext/numeric/bytes.rb +2 -0
  93. data/lib/active_support/core_ext/numeric/conversions.rb +9 -7
  94. data/lib/active_support/core_ext/numeric/inquiry.rb +2 -0
  95. data/lib/active_support/core_ext/numeric/time.rb +7 -15
  96. data/lib/active_support/core_ext/numeric.rb +2 -0
  97. data/lib/active_support/core_ext/object/acts_like.rb +12 -1
  98. data/lib/active_support/core_ext/object/blank.rb +12 -1
  99. data/lib/active_support/core_ext/object/conversions.rb +2 -0
  100. data/lib/active_support/core_ext/object/deep_dup.rb +2 -0
  101. data/lib/active_support/core_ext/object/duplicable.rb +10 -8
  102. data/lib/active_support/core_ext/object/inclusion.rb +2 -0
  103. data/lib/active_support/core_ext/object/instance_variables.rb +2 -0
  104. data/lib/active_support/core_ext/object/json.rb +8 -0
  105. data/lib/active_support/core_ext/object/to_param.rb +2 -0
  106. data/lib/active_support/core_ext/object/to_query.rb +2 -0
  107. data/lib/active_support/core_ext/object/try.rb +2 -0
  108. data/lib/active_support/core_ext/object/with_options.rb +3 -1
  109. data/lib/active_support/core_ext/object.rb +2 -0
  110. data/lib/active_support/core_ext/range/compare_range.rb +61 -0
  111. data/lib/active_support/core_ext/range/conversions.rb +9 -1
  112. data/lib/active_support/core_ext/range/each.rb +5 -1
  113. data/lib/active_support/core_ext/range/include_range.rb +2 -22
  114. data/lib/active_support/core_ext/range/include_time_with_zone.rb +23 -0
  115. data/lib/active_support/core_ext/range/overlaps.rb +2 -0
  116. data/lib/active_support/core_ext/range.rb +4 -1
  117. data/lib/active_support/core_ext/regexp.rb +2 -0
  118. data/lib/active_support/core_ext/securerandom.rb +2 -0
  119. data/lib/active_support/core_ext/string/access.rb +2 -0
  120. data/lib/active_support/core_ext/string/behavior.rb +2 -0
  121. data/lib/active_support/core_ext/string/conversions.rb +2 -0
  122. data/lib/active_support/core_ext/string/exclude.rb +2 -0
  123. data/lib/active_support/core_ext/string/filters.rb +2 -0
  124. data/lib/active_support/core_ext/string/indent.rb +2 -0
  125. data/lib/active_support/core_ext/string/inflections.rb +26 -12
  126. data/lib/active_support/core_ext/string/inquiry.rb +2 -0
  127. data/lib/active_support/core_ext/string/multibyte.rb +4 -0
  128. data/lib/active_support/core_ext/string/output_safety.rb +6 -7
  129. data/lib/active_support/core_ext/string/starts_ends_with.rb +2 -0
  130. data/lib/active_support/core_ext/string/strip.rb +2 -0
  131. data/lib/active_support/core_ext/string/zones.rb +2 -0
  132. data/lib/active_support/core_ext/string.rb +2 -0
  133. data/lib/active_support/core_ext/time/acts_like.rb +2 -0
  134. data/lib/active_support/core_ext/time/calculations.rb +23 -15
  135. data/lib/active_support/core_ext/time/compatibility.rb +4 -2
  136. data/lib/active_support/core_ext/time/conversions.rb +2 -0
  137. data/lib/active_support/core_ext/time/zones.rb +6 -4
  138. data/lib/active_support/core_ext/time.rb +2 -0
  139. data/lib/active_support/core_ext/uri.rb +6 -6
  140. data/lib/active_support/core_ext.rb +3 -1
  141. data/lib/active_support/current_attributes.rb +195 -0
  142. data/lib/active_support/dependencies/autoload.rb +2 -0
  143. data/lib/active_support/dependencies/interlock.rb +2 -0
  144. data/lib/active_support/dependencies.rb +25 -26
  145. data/lib/active_support/deprecation/behaviors.rb +28 -9
  146. data/lib/active_support/deprecation/constant_accessor.rb +4 -2
  147. data/lib/active_support/deprecation/instance_delegator.rb +2 -0
  148. data/lib/active_support/deprecation/method_wrappers.rb +30 -17
  149. data/lib/active_support/deprecation/proxy_wrappers.rb +5 -2
  150. data/lib/active_support/deprecation/reporting.rb +5 -3
  151. data/lib/active_support/deprecation.rb +4 -2
  152. data/lib/active_support/descendants_tracker.rb +2 -0
  153. data/lib/active_support/digest.rb +20 -0
  154. data/lib/active_support/duration/iso8601_parser.rb +4 -2
  155. data/lib/active_support/duration/iso8601_serializer.rb +4 -2
  156. data/lib/active_support/duration.rb +22 -14
  157. data/lib/active_support/encrypted_configuration.rb +49 -0
  158. data/lib/active_support/encrypted_file.rb +99 -0
  159. data/lib/active_support/evented_file_update_checker.rb +2 -0
  160. data/lib/active_support/execution_wrapper.rb +18 -13
  161. data/lib/active_support/executor.rb +2 -0
  162. data/lib/active_support/file_update_checker.rb +2 -0
  163. data/lib/active_support/gem_version.rb +3 -1
  164. data/lib/active_support/gzip.rb +2 -0
  165. data/lib/active_support/hash_with_indifferent_access.rb +55 -1
  166. data/lib/active_support/i18n.rb +3 -1
  167. data/lib/active_support/i18n_railtie.rb +4 -6
  168. data/lib/active_support/inflections.rb +2 -0
  169. data/lib/active_support/inflector/inflections.rb +20 -4
  170. data/lib/active_support/inflector/methods.rb +43 -24
  171. data/lib/active_support/inflector/transliterate.rb +17 -8
  172. data/lib/active_support/inflector.rb +2 -0
  173. data/lib/active_support/json/decoding.rb +2 -0
  174. data/lib/active_support/json/encoding.rb +2 -0
  175. data/lib/active_support/json.rb +2 -0
  176. data/lib/active_support/key_generator.rb +3 -1
  177. data/lib/active_support/lazy_load_hooks.rb +2 -0
  178. data/lib/active_support/log_subscriber/test_helper.rb +2 -0
  179. data/lib/active_support/log_subscriber.rb +3 -2
  180. data/lib/active_support/logger.rb +2 -0
  181. data/lib/active_support/logger_silence.rb +3 -2
  182. data/lib/active_support/logger_thread_safe_level.rb +4 -1
  183. data/lib/active_support/message_encryptor.rb +95 -22
  184. data/lib/active_support/message_verifier.rb +78 -7
  185. data/lib/active_support/messages/metadata.rb +71 -0
  186. data/lib/active_support/messages/rotation_configuration.rb +22 -0
  187. data/lib/active_support/messages/rotator.rb +56 -0
  188. data/lib/active_support/multibyte/chars.rb +2 -0
  189. data/lib/active_support/multibyte/unicode.rb +4 -2
  190. data/lib/active_support/multibyte.rb +2 -0
  191. data/lib/active_support/notifications/fanout.rb +4 -2
  192. data/lib/active_support/notifications/instrumenter.rb +2 -0
  193. data/lib/active_support/notifications.rb +2 -0
  194. data/lib/active_support/number_helper/number_converter.rb +2 -0
  195. data/lib/active_support/number_helper/number_to_currency_converter.rb +2 -0
  196. data/lib/active_support/number_helper/number_to_delimited_converter.rb +2 -0
  197. data/lib/active_support/number_helper/number_to_human_converter.rb +2 -0
  198. data/lib/active_support/number_helper/number_to_human_size_converter.rb +2 -0
  199. data/lib/active_support/number_helper/number_to_percentage_converter.rb +2 -0
  200. data/lib/active_support/number_helper/number_to_phone_converter.rb +3 -1
  201. data/lib/active_support/number_helper/number_to_rounded_converter.rb +2 -20
  202. data/lib/active_support/number_helper/rounding_helper.rb +6 -4
  203. data/lib/active_support/number_helper.rb +2 -0
  204. data/lib/active_support/option_merger.rb +2 -0
  205. data/lib/active_support/ordered_hash.rb +2 -0
  206. data/lib/active_support/ordered_options.rb +5 -3
  207. data/lib/active_support/per_thread_registry.rb +2 -0
  208. data/lib/active_support/proxy_object.rb +2 -0
  209. data/lib/active_support/rails.rb +2 -0
  210. data/lib/active_support/railtie.rb +37 -8
  211. data/lib/active_support/reloader.rb +8 -6
  212. data/lib/active_support/rescuable.rb +3 -2
  213. data/lib/active_support/security_utils.rb +15 -11
  214. data/lib/active_support/string_inquirer.rb +2 -0
  215. data/lib/active_support/subscriber.rb +8 -2
  216. data/lib/active_support/tagged_logging.rb +2 -0
  217. data/lib/active_support/test_case.rb +3 -2
  218. data/lib/active_support/testing/assertions.rb +31 -14
  219. data/lib/active_support/testing/autorun.rb +2 -0
  220. data/lib/active_support/testing/constant_lookup.rb +2 -0
  221. data/lib/active_support/testing/declarative.rb +2 -0
  222. data/lib/active_support/testing/deprecation.rb +2 -0
  223. data/lib/active_support/testing/file_fixtures.rb +2 -0
  224. data/lib/active_support/testing/isolation.rb +3 -1
  225. data/lib/active_support/testing/method_call_assertions.rb +2 -0
  226. data/lib/active_support/testing/setup_and_teardown.rb +12 -7
  227. data/lib/active_support/testing/stream.rb +2 -0
  228. data/lib/active_support/testing/tagged_logging.rb +2 -0
  229. data/lib/active_support/testing/time_helpers.rb +33 -3
  230. data/lib/active_support/time.rb +2 -0
  231. data/lib/active_support/time_with_zone.rb +38 -0
  232. data/lib/active_support/values/time_zone.rb +20 -8
  233. data/lib/active_support/version.rb +2 -0
  234. data/lib/active_support/xml_mini/jdom.rb +4 -2
  235. data/lib/active_support/xml_mini/libxml.rb +3 -1
  236. data/lib/active_support/xml_mini/libxmlsax.rb +4 -2
  237. data/lib/active_support/xml_mini/nokogiri.rb +3 -1
  238. data/lib/active_support/xml_mini/nokogirisax.rb +3 -1
  239. data/lib/active_support/xml_mini/rexml.rb +3 -1
  240. data/lib/active_support/xml_mini.rb +4 -2
  241. data/lib/active_support.rb +5 -13
  242. metadata +17 -5
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "tzinfo"
2
4
  require "concurrent/map"
3
5
  require "active_support/core_ext/object/blank"
@@ -6,7 +8,7 @@ module ActiveSupport
6
8
  # The TimeZone class serves as a wrapper around TZInfo::Timezone instances.
7
9
  # It allows us to do the following:
8
10
  #
9
- # * Limit the set of zones provided by TZInfo to a meaningful subset of 146
11
+ # * Limit the set of zones provided by TZInfo to a meaningful subset of 134
10
12
  # zones.
11
13
  # * Retrieve and display zones with a friendlier name
12
14
  # (e.g., "Eastern Time (US & Canada)" instead of "America/New_York").
@@ -28,7 +30,7 @@ module ActiveSupport
28
30
  class TimeZone
29
31
  # Keys are Rails TimeZone names, values are TZInfo identifiers.
30
32
  MAPPING = {
31
- "International Date Line West" => "Pacific/Midway",
33
+ "International Date Line West" => "Etc/GMT+12",
32
34
  "Midway Island" => "Pacific/Midway",
33
35
  "American Samoa" => "Pacific/Pago_Pago",
34
36
  "Hawaii" => "Pacific/Honolulu",
@@ -59,6 +61,7 @@ module ActiveSupport
59
61
  "Buenos Aires" => "America/Argentina/Buenos_Aires",
60
62
  "Montevideo" => "America/Montevideo",
61
63
  "Georgetown" => "America/Guyana",
64
+ "Puerto Rico" => "America/Puerto_Rico",
62
65
  "Greenland" => "America/Godthab",
63
66
  "Mid-Atlantic" => "Atlantic/South_Georgia",
64
67
  "Azores" => "Atlantic/Azores",
@@ -235,7 +238,7 @@ module ActiveSupport
235
238
  when Numeric, ActiveSupport::Duration
236
239
  arg *= 3600 if arg.abs <= 13
237
240
  all.find { |z| z.utc_offset == arg.to_i }
238
- else
241
+ else
239
242
  raise ArgumentError, "invalid argument to TimeZone[]: #{arg.inspect}"
240
243
  end
241
244
  end
@@ -253,6 +256,13 @@ module ActiveSupport
253
256
  @country_zones[code] ||= load_country_zones(code)
254
257
  end
255
258
 
259
+ def clear #:nodoc:
260
+ @lazy_zones_map = Concurrent::Map.new
261
+ @country_zones = Concurrent::Map.new
262
+ @zones = nil
263
+ @zones_map = nil
264
+ end
265
+
256
266
  private
257
267
  def load_country_zones(code)
258
268
  country = TZInfo::Country.get(code)
@@ -269,9 +279,9 @@ module ActiveSupport
269
279
  end
270
280
 
271
281
  def zones_map
272
- @zones_map ||= begin
273
- MAPPING.each_key { |place| self[place] } # load all the zones
274
- @lazy_zones_map
282
+ @zones_map ||= MAPPING.each_with_object({}) do |(name, _), zones|
283
+ timezone = self[name]
284
+ zones[name] = timezone if timezone
275
285
  end
276
286
  end
277
287
  end
@@ -361,7 +371,7 @@ module ActiveSupport
361
371
  # Time.zone.iso8601('1999-12-31') # => Fri, 31 Dec 1999 00:00:00 HST -10:00
362
372
  #
363
373
  # If the string is invalid then an +ArgumentError+ will be raised unlike +parse+
364
- # which returns +nil+ when given an invalid date string.
374
+ # which usually returns +nil+ when given an invalid date string.
365
375
  def iso8601(str)
366
376
  parts = Date._iso8601(str)
367
377
 
@@ -400,6 +410,8 @@ module ActiveSupport
400
410
  # components are supplied, then the day of the month defaults to 1:
401
411
  #
402
412
  # Time.zone.parse('Mar 2000') # => Wed, 01 Mar 2000 00:00:00 HST -10:00
413
+ #
414
+ # If the string is invalid then an +ArgumentError+ could be raised.
403
415
  def parse(str, now = now())
404
416
  parts_to_time(Date._parse(str, false), now)
405
417
  end
@@ -504,7 +516,7 @@ module ActiveSupport
504
516
  # Available so that TimeZone instances respond like TZInfo::Timezone
505
517
  # instances.
506
518
  def period_for_local(time, dst = true)
507
- tzinfo.period_for_local(time, dst)
519
+ tzinfo.period_for_local(time, dst) { |periods| periods.last }
508
520
  end
509
521
 
510
522
  def periods_for_local(time) #:nodoc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "gem_version"
2
4
 
3
5
  module ActiveSupport
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  raise "JRuby is required to use the JDOM backend for XmlMini" unless RUBY_PLATFORM.include?("java")
2
4
 
3
5
  require "jruby"
@@ -38,7 +40,7 @@ module ActiveSupport
38
40
  else
39
41
  @dbf = DocumentBuilderFactory.new_instance
40
42
  # secure processing of java xml
41
- # http://www.ibm.com/developerworks/xml/library/x-tipcfsx/index.html
43
+ # https://archive.is/9xcQQ
42
44
  @dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false)
43
45
  @dbf.setFeature("http://xml.org/sax/features/external-general-entities", false)
44
46
  @dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false)
@@ -167,7 +169,7 @@ module ActiveSupport
167
169
  # element::
168
170
  # XML element to be checked.
169
171
  def empty_content?(element)
170
- text = ""
172
+ text = "".dup
171
173
  child_nodes = element.child_nodes
172
174
  (0...child_nodes.length).each do |i|
173
175
  item = child_nodes.item(i)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "libxml"
2
4
  require "active_support/core_ext/object/blank"
3
5
  require "stringio"
@@ -53,7 +55,7 @@ module LibXML #:nodoc:
53
55
  if c.element?
54
56
  c.to_hash(node_hash)
55
57
  elsif c.text? || c.cdata?
56
- node_hash[CONTENT_ROOT] ||= ""
58
+ node_hash[CONTENT_ROOT] ||= "".dup
57
59
  node_hash[CONTENT_ROOT] << c.content
58
60
  end
59
61
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "libxml"
2
4
  require "active_support/core_ext/object/blank"
3
5
  require "stringio"
@@ -21,7 +23,7 @@ module ActiveSupport
21
23
  end
22
24
 
23
25
  def on_start_document
24
- @hash = { CONTENT_KEY => "" }
26
+ @hash = { CONTENT_KEY => "".dup }
25
27
  @hash_stack = [@hash]
26
28
  end
27
29
 
@@ -31,7 +33,7 @@ module ActiveSupport
31
33
  end
32
34
 
33
35
  def on_start_element(name, attrs = {})
34
- new_hash = { CONTENT_KEY => "" }.merge!(attrs)
36
+ new_hash = { CONTENT_KEY => "".dup }.merge!(attrs)
35
37
  new_hash[HASH_SIZE_KEY] = new_hash.size + 1
36
38
 
37
39
  case current_hash[name]
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require "nokogiri"
3
5
  rescue LoadError => e
@@ -57,7 +59,7 @@ module ActiveSupport
57
59
  if c.element?
58
60
  c.to_hash(node_hash)
59
61
  elsif c.text? || c.cdata?
60
- node_hash[CONTENT_ROOT] ||= ""
62
+ node_hash[CONTENT_ROOT] ||= "".dup
61
63
  node_hash[CONTENT_ROOT] << c.content
62
64
  end
63
65
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require "nokogiri"
3
5
  rescue LoadError => e
@@ -37,7 +39,7 @@ module ActiveSupport
37
39
  end
38
40
 
39
41
  def start_element(name, attrs = [])
40
- new_hash = { CONTENT_KEY => "" }.merge!(Hash[attrs])
42
+ new_hash = { CONTENT_KEY => "".dup }.merge!(Hash[attrs])
41
43
  new_hash[HASH_SIZE_KEY] = new_hash.size + 1
42
44
 
43
45
  case current_hash[name]
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "active_support/core_ext/kernel/reporting"
2
4
  require "active_support/core_ext/object/blank"
3
5
  require "stringio"
@@ -74,7 +76,7 @@ module ActiveSupport
74
76
  hash
75
77
  else
76
78
  # must use value to prevent double-escaping
77
- texts = ""
79
+ texts = "".dup
78
80
  element.texts.each { |t| texts << t.value }
79
81
  merge!(hash, CONTENT_KEY, texts)
80
82
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "time"
2
4
  require "base64"
3
5
  require "bigdecimal"
@@ -73,7 +75,7 @@ module ActiveSupport
73
75
  begin
74
76
  BigDecimal(number)
75
77
  rescue ArgumentError
76
- BigDecimal("0")
78
+ BigDecimal(number.to_f.to_s)
77
79
  end
78
80
  else
79
81
  BigDecimal(number)
@@ -81,7 +83,7 @@ module ActiveSupport
81
83
  end,
82
84
  "boolean" => Proc.new { |boolean| %w(1 true).include?(boolean.to_s.strip) },
83
85
  "string" => Proc.new { |string| string.to_s },
84
- "yaml" => Proc.new { |yaml| YAML::load(yaml) rescue yaml },
86
+ "yaml" => Proc.new { |yaml| YAML.load(yaml) rescue yaml },
85
87
  "base64Binary" => Proc.new { |bin| ::Base64.decode64(bin) },
86
88
  "binary" => Proc.new { |bin, entity| _parse_binary(bin, entity) },
87
89
  "file" => Proc.new { |file, entity| _parse_file(file, entity) }
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
- # Copyright (c) 2005-2017 David Heinemeier Hansson
4
+ # Copyright (c) 2005-2018 David Heinemeier Hansson
3
5
  #
4
6
  # Permission is hereby granted, free of charge, to any person obtaining
5
7
  # a copy of this software and associated documentation files (the
@@ -32,6 +34,7 @@ module ActiveSupport
32
34
  extend ActiveSupport::Autoload
33
35
 
34
36
  autoload :Concern
37
+ autoload :CurrentAttributes
35
38
  autoload :Dependencies
36
39
  autoload :DescendantsTracker
37
40
  autoload :ExecutionWrapper
@@ -50,6 +53,7 @@ module ActiveSupport
50
53
  autoload :Callbacks
51
54
  autoload :Configurable
52
55
  autoload :Deprecation
56
+ autoload :Digest
53
57
  autoload :Gzip
54
58
  autoload :Inflector
55
59
  autoload :JSON
@@ -79,18 +83,6 @@ module ActiveSupport
79
83
 
80
84
  cattr_accessor :test_order # :nodoc:
81
85
 
82
- def self.halt_callback_chains_on_return_false
83
- ActiveSupport::Deprecation.warn(<<-MSG.squish)
84
- ActiveSupport.halt_callback_chains_on_return_false is deprecated and will be removed in Rails 5.2.
85
- MSG
86
- end
87
-
88
- def self.halt_callback_chains_on_return_false=(value)
89
- ActiveSupport::Deprecation.warn(<<-MSG.squish)
90
- ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2.
91
- MSG
92
- end
93
-
94
86
  def self.to_time_preserves_timezone
95
87
  DateAndTime::Compatibility.preserve_timezone
96
88
  end
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.1.7
4
+ version: 5.2.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: 2019-03-28 00:00:00.000000000 Z
11
+ date: 2022-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -100,6 +100,7 @@ files:
100
100
  - lib/active_support/cache/mem_cache_store.rb
101
101
  - lib/active_support/cache/memory_store.rb
102
102
  - lib/active_support/cache/null_store.rb
103
+ - lib/active_support/cache/redis_cache_store.rb
103
104
  - lib/active_support/cache/strategy/local_cache.rb
104
105
  - lib/active_support/cache/strategy/local_cache_middleware.rb
105
106
  - lib/active_support/callbacks.rb
@@ -138,6 +139,7 @@ files:
138
139
  - lib/active_support/core_ext/date_time/calculations.rb
139
140
  - lib/active_support/core_ext/date_time/compatibility.rb
140
141
  - lib/active_support/core_ext/date_time/conversions.rb
142
+ - lib/active_support/core_ext/digest.rb
141
143
  - lib/active_support/core_ext/digest/uuid.rb
142
144
  - lib/active_support/core_ext/enumerable.rb
143
145
  - lib/active_support/core_ext/file.rb
@@ -174,6 +176,7 @@ files:
174
176
  - lib/active_support/core_ext/module/deprecation.rb
175
177
  - lib/active_support/core_ext/module/introspection.rb
176
178
  - lib/active_support/core_ext/module/reachable.rb
179
+ - lib/active_support/core_ext/module/redefine_method.rb
177
180
  - lib/active_support/core_ext/module/remove_method.rb
178
181
  - lib/active_support/core_ext/name_error.rb
179
182
  - lib/active_support/core_ext/numeric.rb
@@ -195,9 +198,11 @@ files:
195
198
  - lib/active_support/core_ext/object/try.rb
196
199
  - lib/active_support/core_ext/object/with_options.rb
197
200
  - lib/active_support/core_ext/range.rb
201
+ - lib/active_support/core_ext/range/compare_range.rb
198
202
  - lib/active_support/core_ext/range/conversions.rb
199
203
  - lib/active_support/core_ext/range/each.rb
200
204
  - lib/active_support/core_ext/range/include_range.rb
205
+ - lib/active_support/core_ext/range/include_time_with_zone.rb
201
206
  - lib/active_support/core_ext/range/overlaps.rb
202
207
  - lib/active_support/core_ext/regexp.rb
203
208
  - lib/active_support/core_ext/securerandom.rb
@@ -222,6 +227,7 @@ files:
222
227
  - lib/active_support/core_ext/time/conversions.rb
223
228
  - lib/active_support/core_ext/time/zones.rb
224
229
  - lib/active_support/core_ext/uri.rb
230
+ - lib/active_support/current_attributes.rb
225
231
  - lib/active_support/dependencies.rb
226
232
  - lib/active_support/dependencies/autoload.rb
227
233
  - lib/active_support/dependencies/interlock.rb
@@ -233,9 +239,12 @@ files:
233
239
  - lib/active_support/deprecation/proxy_wrappers.rb
234
240
  - lib/active_support/deprecation/reporting.rb
235
241
  - lib/active_support/descendants_tracker.rb
242
+ - lib/active_support/digest.rb
236
243
  - lib/active_support/duration.rb
237
244
  - lib/active_support/duration/iso8601_parser.rb
238
245
  - lib/active_support/duration/iso8601_serializer.rb
246
+ - lib/active_support/encrypted_configuration.rb
247
+ - lib/active_support/encrypted_file.rb
239
248
  - lib/active_support/evented_file_update_checker.rb
240
249
  - lib/active_support/execution_wrapper.rb
241
250
  - lib/active_support/executor.rb
@@ -263,6 +272,9 @@ files:
263
272
  - lib/active_support/logger_thread_safe_level.rb
264
273
  - lib/active_support/message_encryptor.rb
265
274
  - lib/active_support/message_verifier.rb
275
+ - lib/active_support/messages/metadata.rb
276
+ - lib/active_support/messages/rotation_configuration.rb
277
+ - lib/active_support/messages/rotator.rb
266
278
  - lib/active_support/multibyte.rb
267
279
  - lib/active_support/multibyte/chars.rb
268
280
  - lib/active_support/multibyte/unicode.rb
@@ -321,8 +333,8 @@ homepage: http://rubyonrails.org
321
333
  licenses:
322
334
  - MIT
323
335
  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
336
+ source_code_uri: https://github.com/rails/rails/tree/v5.2.7/activesupport
337
+ changelog_uri: https://github.com/rails/rails/blob/v5.2.7/activesupport/CHANGELOG.md
326
338
  post_install_message:
327
339
  rdoc_options:
328
340
  - "--encoding"
@@ -340,7 +352,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
340
352
  - !ruby/object:Gem::Version
341
353
  version: '0'
342
354
  requirements: []
343
- rubygems_version: 3.0.1
355
+ rubygems_version: 3.1.6
344
356
  signing_key:
345
357
  specification_version: 4
346
358
  summary: A toolkit of support libraries and Ruby core extensions extracted from the