activesupport 4.2.0 → 5.0.0
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 +4 -4
- data/CHANGELOG.md +630 -220
- data/MIT-LICENSE +2 -2
- data/README.rdoc +2 -3
- data/lib/active_support/array_inquirer.rb +44 -0
- data/lib/active_support/backtrace_cleaner.rb +1 -1
- data/lib/active_support/benchmarkable.rb +1 -1
- data/lib/active_support/cache/file_store.rb +36 -22
- data/lib/active_support/cache/mem_cache_store.rb +63 -54
- data/lib/active_support/cache/memory_store.rb +16 -21
- data/lib/active_support/cache/null_store.rb +1 -4
- data/lib/active_support/cache/strategy/local_cache.rb +31 -20
- data/lib/active_support/cache.rb +73 -89
- data/lib/active_support/callbacks.rb +195 -155
- data/lib/active_support/concern.rb +2 -2
- data/lib/active_support/concurrency/latch.rb +7 -15
- data/lib/active_support/concurrency/share_lock.rb +186 -0
- data/lib/active_support/configurable.rb +1 -0
- data/lib/active_support/core_ext/array/access.rb +27 -1
- data/lib/active_support/core_ext/array/conversions.rb +6 -4
- data/lib/active_support/core_ext/array/grouping.rb +9 -18
- data/lib/active_support/core_ext/array/inquiry.rb +17 -0
- data/lib/active_support/core_ext/array/wrap.rb +5 -4
- data/lib/active_support/core_ext/array.rb +1 -0
- data/lib/active_support/core_ext/big_decimal/conversions.rb +8 -10
- data/lib/active_support/core_ext/class/attribute.rb +10 -9
- data/lib/active_support/core_ext/class/subclasses.rb +3 -4
- data/lib/active_support/core_ext/class.rb +0 -1
- data/lib/active_support/core_ext/date/blank.rb +12 -0
- data/lib/active_support/core_ext/date/calculations.rb +1 -1
- data/lib/active_support/core_ext/date/conversions.rb +13 -6
- data/lib/active_support/core_ext/date.rb +1 -1
- data/lib/active_support/core_ext/date_and_time/calculations.rb +109 -25
- data/lib/active_support/core_ext/date_and_time/compatibility.rb +18 -0
- data/lib/active_support/core_ext/date_and_time/zones.rb +3 -4
- data/lib/active_support/core_ext/date_time/blank.rb +12 -0
- data/lib/active_support/core_ext/date_time/calculations.rb +36 -10
- data/lib/active_support/core_ext/date_time/compatibility.rb +5 -0
- data/lib/active_support/core_ext/date_time/conversions.rb +2 -0
- data/lib/active_support/core_ext/date_time.rb +2 -1
- data/lib/active_support/core_ext/enumerable.rb +49 -5
- data/lib/active_support/core_ext/file/atomic.rb +30 -25
- data/lib/active_support/core_ext/hash/conversions.rb +23 -4
- data/lib/active_support/core_ext/hash/deep_merge.rb +1 -1
- data/lib/active_support/core_ext/hash/except.rb +9 -8
- data/lib/active_support/core_ext/hash/indifferent_access.rb +1 -1
- data/lib/active_support/core_ext/hash/keys.rb +23 -19
- data/lib/active_support/core_ext/hash/slice.rb +1 -1
- data/lib/active_support/core_ext/hash/transform_values.rb +11 -5
- data/lib/active_support/core_ext/integer/time.rb +1 -16
- data/lib/active_support/core_ext/kernel/concern.rb +2 -0
- data/lib/active_support/core_ext/kernel/debugger.rb +3 -10
- data/lib/active_support/core_ext/kernel/reporting.rb +2 -83
- data/lib/active_support/core_ext/kernel.rb +0 -1
- data/lib/active_support/core_ext/load_error.rb +4 -2
- data/lib/active_support/core_ext/marshal.rb +12 -11
- data/lib/active_support/core_ext/module/aliasing.rb +6 -1
- data/lib/active_support/core_ext/module/anonymous.rb +10 -1
- data/lib/active_support/core_ext/module/attr_internal.rb +2 -5
- data/lib/active_support/core_ext/module/attribute_accessors.rb +15 -15
- data/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +141 -0
- data/lib/active_support/core_ext/module/concerning.rb +4 -4
- data/lib/active_support/core_ext/module/delegation.rb +35 -25
- data/lib/active_support/core_ext/module/deprecation.rb +2 -2
- data/lib/active_support/core_ext/module/introspection.rb +4 -0
- data/lib/active_support/core_ext/module/method_transplanting.rb +3 -11
- data/lib/active_support/core_ext/module/qualified_const.rb +30 -12
- data/lib/active_support/core_ext/module/remove_method.rb +23 -0
- data/lib/active_support/core_ext/module.rb +1 -0
- data/lib/active_support/core_ext/name_error.rb +15 -2
- data/lib/active_support/core_ext/numeric/bytes.rb +20 -0
- data/lib/active_support/core_ext/numeric/conversions.rb +74 -64
- data/lib/active_support/core_ext/numeric/inquiry.rb +26 -0
- data/lib/active_support/core_ext/numeric/time.rb +24 -19
- data/lib/active_support/core_ext/numeric.rb +1 -0
- data/lib/active_support/core_ext/object/blank.rb +17 -5
- data/lib/active_support/core_ext/object/deep_dup.rb +10 -3
- data/lib/active_support/core_ext/object/duplicable.rb +8 -13
- data/lib/active_support/core_ext/object/inclusion.rb +2 -2
- data/lib/active_support/core_ext/object/instance_variables.rb +1 -1
- data/lib/active_support/core_ext/object/json.rb +15 -7
- data/lib/active_support/core_ext/object/to_query.rb +1 -1
- data/lib/active_support/core_ext/object/try.rb +68 -22
- data/lib/active_support/core_ext/object/with_options.rb +1 -1
- data/lib/active_support/core_ext/object.rb +0 -1
- data/lib/active_support/core_ext/range/conversions.rb +18 -6
- data/lib/active_support/core_ext/range/each.rb +16 -18
- data/lib/active_support/core_ext/range/include_range.rb +20 -20
- data/lib/active_support/core_ext/securerandom.rb +23 -0
- data/lib/active_support/core_ext/string/access.rb +1 -1
- data/lib/active_support/core_ext/string/behavior.rb +1 -1
- data/lib/active_support/core_ext/string/conversions.rb +4 -3
- data/lib/active_support/core_ext/string/filters.rb +5 -5
- data/lib/active_support/core_ext/string/inflections.rb +32 -5
- data/lib/active_support/core_ext/string/multibyte.rb +11 -7
- data/lib/active_support/core_ext/string/output_safety.rb +18 -16
- data/lib/active_support/core_ext/string/strip.rb +3 -6
- data/lib/active_support/core_ext/struct.rb +3 -6
- data/lib/active_support/core_ext/time/calculations.rb +36 -11
- data/lib/active_support/core_ext/time/compatibility.rb +5 -0
- data/lib/active_support/core_ext/time/conversions.rb +4 -2
- data/lib/active_support/core_ext/time/marshal.rb +2 -29
- data/lib/active_support/core_ext/time/zones.rb +36 -4
- data/lib/active_support/core_ext/time.rb +1 -1
- data/lib/active_support/core_ext/uri.rb +1 -3
- data/lib/active_support/core_ext.rb +2 -1
- data/lib/active_support/dependencies/interlock.rb +51 -0
- data/lib/active_support/dependencies.rb +87 -95
- data/lib/active_support/deprecation/behaviors.rb +16 -2
- data/lib/active_support/deprecation/method_wrappers.rb +42 -16
- data/lib/active_support/deprecation/proxy_wrappers.rb +47 -24
- data/lib/active_support/deprecation/reporting.rb +23 -5
- data/lib/active_support/deprecation.rb +1 -1
- data/lib/active_support/duration/iso8601_parser.rb +122 -0
- data/lib/active_support/duration/iso8601_serializer.rb +51 -0
- data/lib/active_support/duration.rb +55 -10
- data/lib/active_support/evented_file_update_checker.rb +194 -0
- data/lib/active_support/execution_wrapper.rb +117 -0
- data/lib/active_support/executor.rb +6 -0
- data/lib/active_support/file_update_checker.rb +23 -3
- data/lib/active_support/gem_version.rb +3 -3
- data/lib/active_support/hash_with_indifferent_access.rb +46 -13
- data/lib/active_support/i18n_railtie.rb +25 -4
- data/lib/active_support/inflector/inflections.rb +36 -5
- data/lib/active_support/inflector/methods.rb +97 -90
- data/lib/active_support/inflector/transliterate.rb +36 -21
- data/lib/active_support/json/decoding.rb +11 -10
- data/lib/active_support/json/encoding.rb +4 -49
- data/lib/active_support/key_generator.rb +7 -9
- data/lib/active_support/locale/en.yml +2 -0
- data/lib/active_support/log_subscriber/test_helper.rb +3 -3
- data/lib/active_support/log_subscriber.rb +1 -1
- data/lib/active_support/logger.rb +50 -1
- data/lib/active_support/logger_silence.rb +8 -4
- data/lib/active_support/logger_thread_safe_level.rb +31 -0
- data/lib/active_support/message_encryptor.rb +4 -4
- data/lib/active_support/message_verifier.rb +70 -8
- data/lib/active_support/multibyte/chars.rb +13 -4
- data/lib/active_support/multibyte/unicode.rb +44 -21
- data/lib/active_support/notifications/fanout.rb +6 -6
- data/lib/active_support/notifications/instrumenter.rb +20 -2
- data/lib/active_support/notifications.rb +2 -2
- data/lib/active_support/number_helper/number_to_currency_converter.rb +7 -9
- data/lib/active_support/number_helper/number_to_delimited_converter.rb +8 -3
- data/lib/active_support/number_helper/number_to_human_converter.rb +6 -4
- data/lib/active_support/number_helper/number_to_human_size_converter.rb +6 -2
- data/lib/active_support/number_helper/number_to_percentage_converter.rb +1 -1
- data/lib/active_support/number_helper/number_to_phone_converter.rb +11 -2
- data/lib/active_support/number_helper/number_to_rounded_converter.rb +30 -25
- data/lib/active_support/number_helper.rb +90 -67
- data/lib/active_support/ordered_hash.rb +1 -1
- data/lib/active_support/ordered_options.rb +15 -1
- data/lib/active_support/per_thread_registry.rb +8 -3
- data/lib/active_support/rails.rb +2 -2
- data/lib/active_support/railtie.rb +6 -1
- data/lib/active_support/reloader.rb +129 -0
- data/lib/active_support/rescuable.rb +93 -47
- data/lib/active_support/security_utils.rb +7 -0
- data/lib/active_support/string_inquirer.rb +1 -1
- data/lib/active_support/subscriber.rb +5 -10
- data/lib/active_support/tagged_logging.rb +3 -1
- data/lib/active_support/test_case.rb +15 -29
- data/lib/active_support/testing/assertions.rb +15 -13
- data/lib/active_support/testing/autorun.rb +8 -1
- data/lib/active_support/testing/deprecation.rb +9 -8
- data/lib/active_support/testing/file_fixtures.rb +34 -0
- data/lib/active_support/testing/isolation.rb +22 -8
- data/lib/active_support/testing/method_call_assertions.rb +41 -0
- data/lib/active_support/testing/stream.rb +42 -0
- data/lib/active_support/testing/time_helpers.rb +13 -10
- data/lib/active_support/time_with_zone.rb +135 -46
- data/lib/active_support/values/time_zone.rb +95 -47
- data/lib/active_support/values/unicode_tables.dat +0 -0
- data/lib/active_support/xml_mini/jdom.rb +7 -6
- data/lib/active_support/xml_mini/libxml.rb +2 -2
- data/lib/active_support/xml_mini/nokogiri.rb +2 -2
- data/lib/active_support/xml_mini/rexml.rb +7 -8
- data/lib/active_support/xml_mini.rb +22 -14
- data/lib/active_support.rb +20 -6
- metadata +32 -35
- data/lib/active_support/core_ext/big_decimal/yaml_conversions.rb +0 -14
- data/lib/active_support/core_ext/class/delegating_attributes.rb +0 -45
- data/lib/active_support/core_ext/date_time/zones.rb +0 -6
- data/lib/active_support/core_ext/object/itself.rb +0 -15
- data/lib/active_support/core_ext/thread.rb +0 -86
@@ -46,7 +46,7 @@ module ActiveSupport
|
|
46
46
|
xml_string_reader = StringReader.new(data)
|
47
47
|
xml_input_source = InputSource.new(xml_string_reader)
|
48
48
|
doc = @dbf.new_document_builder.parse(xml_input_source)
|
49
|
-
merge_element!({CONTENT_KEY => ''}, doc.document_element)
|
49
|
+
merge_element!({CONTENT_KEY => ''}, doc.document_element, XmlMini.depth)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
@@ -58,9 +58,10 @@ module ActiveSupport
|
|
58
58
|
# Hash to merge the converted element into.
|
59
59
|
# element::
|
60
60
|
# XML element to merge into hash
|
61
|
-
def merge_element!(hash, element)
|
61
|
+
def merge_element!(hash, element, depth)
|
62
|
+
raise 'Document too deep!' if depth == 0
|
62
63
|
delete_empty(hash)
|
63
|
-
merge!(hash, element.tag_name, collapse(element))
|
64
|
+
merge!(hash, element.tag_name, collapse(element, depth))
|
64
65
|
end
|
65
66
|
|
66
67
|
def delete_empty(hash)
|
@@ -71,14 +72,14 @@ module ActiveSupport
|
|
71
72
|
#
|
72
73
|
# element::
|
73
74
|
# The document element to be collapsed.
|
74
|
-
def collapse(element)
|
75
|
+
def collapse(element, depth)
|
75
76
|
hash = get_attributes(element)
|
76
77
|
|
77
78
|
child_nodes = element.child_nodes
|
78
79
|
if child_nodes.length > 0
|
79
80
|
(0...child_nodes.length).each do |i|
|
80
81
|
child = child_nodes.item(i)
|
81
|
-
merge_element!(hash, child) unless child.node_type == Node.TEXT_NODE
|
82
|
+
merge_element!(hash, child, depth - 1) unless child.node_type == Node.TEXT_NODE
|
82
83
|
end
|
83
84
|
merge_texts!(hash, element) unless empty_content?(element)
|
84
85
|
hash
|
@@ -141,7 +142,7 @@ module ActiveSupport
|
|
141
142
|
(0...attributes.length).each do |i|
|
142
143
|
attribute_hash[CONTENT_KEY] ||= ''
|
143
144
|
attribute_hash[attributes.item(i).name] = attributes.item(i).value
|
144
|
-
|
145
|
+
end
|
145
146
|
attribute_hash
|
146
147
|
end
|
147
148
|
|
@@ -75,5 +75,5 @@ module LibXML #:nodoc:
|
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
-
LibXML::XML::Document.
|
79
|
-
LibXML::XML::Node.
|
78
|
+
LibXML::XML::Document.include(LibXML::Conversions::Document)
|
79
|
+
LibXML::XML::Node.include(LibXML::Conversions::Node)
|
@@ -77,7 +77,7 @@ module ActiveSupport
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
Nokogiri::XML::Document.
|
81
|
-
Nokogiri::XML::Node.
|
80
|
+
Nokogiri::XML::Document.include(Conversions::Document)
|
81
|
+
Nokogiri::XML::Node.include(Conversions::Node)
|
82
82
|
end
|
83
83
|
end
|
@@ -20,16 +20,14 @@ module ActiveSupport
|
|
20
20
|
data = StringIO.new(data || '')
|
21
21
|
end
|
22
22
|
|
23
|
-
|
24
|
-
if char.nil?
|
23
|
+
if data.eof?
|
25
24
|
{}
|
26
25
|
else
|
27
|
-
data.ungetc(char)
|
28
26
|
silence_warnings { require 'rexml/document' } unless defined?(REXML::Document)
|
29
27
|
doc = REXML::Document.new(data)
|
30
28
|
|
31
29
|
if doc.root
|
32
|
-
merge_element!({}, doc.root)
|
30
|
+
merge_element!({}, doc.root, XmlMini.depth)
|
33
31
|
else
|
34
32
|
raise REXML::ParseException,
|
35
33
|
"The document #{doc.to_s.inspect} does not have a valid root"
|
@@ -44,19 +42,20 @@ module ActiveSupport
|
|
44
42
|
# Hash to merge the converted element into.
|
45
43
|
# element::
|
46
44
|
# XML element to merge into hash
|
47
|
-
def merge_element!(hash, element)
|
48
|
-
|
45
|
+
def merge_element!(hash, element, depth)
|
46
|
+
raise REXML::ParseException, "The document is too deep" if depth == 0
|
47
|
+
merge!(hash, element.name, collapse(element, depth))
|
49
48
|
end
|
50
49
|
|
51
50
|
# Actually converts an XML document element into a data structure.
|
52
51
|
#
|
53
52
|
# element::
|
54
53
|
# The document element to be collapsed.
|
55
|
-
def collapse(element)
|
54
|
+
def collapse(element, depth)
|
56
55
|
hash = get_attributes(element)
|
57
56
|
|
58
57
|
if element.has_elements?
|
59
|
-
element.each_element {|child| merge_element!(hash, child) }
|
58
|
+
element.each_element {|child| merge_element!(hash, child, depth - 1) }
|
60
59
|
merge_texts!(hash, element) unless empty_content?(element)
|
61
60
|
hash
|
62
61
|
else
|
@@ -32,20 +32,25 @@ module ActiveSupport
|
|
32
32
|
"binary" => "base64"
|
33
33
|
} unless defined?(DEFAULT_ENCODINGS)
|
34
34
|
|
35
|
-
TYPE_NAMES
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
35
|
+
unless defined?(TYPE_NAMES)
|
36
|
+
TYPE_NAMES = {
|
37
|
+
"Symbol" => "symbol",
|
38
|
+
"Integer" => "integer",
|
39
|
+
"BigDecimal" => "decimal",
|
40
|
+
"Float" => "float",
|
41
|
+
"TrueClass" => "boolean",
|
42
|
+
"FalseClass" => "boolean",
|
43
|
+
"Date" => "date",
|
44
|
+
"DateTime" => "dateTime",
|
45
|
+
"Time" => "dateTime",
|
46
|
+
"Array" => "array",
|
47
|
+
"Hash" => "hash"
|
48
|
+
}
|
49
|
+
|
50
|
+
# No need to map these on Ruby 2.4+
|
51
|
+
TYPE_NAMES["Fixnum"] = "integer" unless Fixnum == Integer
|
52
|
+
TYPE_NAMES["Bignum"] = "integer" unless Bignum == Integer
|
53
|
+
end
|
49
54
|
|
50
55
|
FORMATTING = {
|
51
56
|
"symbol" => Proc.new { |symbol| symbol.to_s },
|
@@ -78,6 +83,9 @@ module ActiveSupport
|
|
78
83
|
)
|
79
84
|
end
|
80
85
|
|
86
|
+
attr_accessor :depth
|
87
|
+
self.depth = 100
|
88
|
+
|
81
89
|
delegate :parse, :to => :backend
|
82
90
|
|
83
91
|
def backend
|
data/lib/active_support.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2005-
|
2
|
+
# Copyright (c) 2005-2016 David Heinemeier Hansson
|
3
3
|
#
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
5
5
|
# a copy of this software and associated documentation files (the
|
@@ -26,6 +26,7 @@ require "active_support/dependencies/autoload"
|
|
26
26
|
require "active_support/version"
|
27
27
|
require "active_support/logger"
|
28
28
|
require "active_support/lazy_load_hooks"
|
29
|
+
require "active_support/core_ext/date_and_time/compatibility"
|
29
30
|
|
30
31
|
module ActiveSupport
|
31
32
|
extend ActiveSupport::Autoload
|
@@ -33,9 +34,13 @@ module ActiveSupport
|
|
33
34
|
autoload :Concern
|
34
35
|
autoload :Dependencies
|
35
36
|
autoload :DescendantsTracker
|
37
|
+
autoload :ExecutionWrapper
|
38
|
+
autoload :Executor
|
36
39
|
autoload :FileUpdateChecker
|
40
|
+
autoload :EventedFileUpdateChecker
|
37
41
|
autoload :LogSubscriber
|
38
42
|
autoload :Notifications
|
43
|
+
autoload :Reloader
|
39
44
|
|
40
45
|
eager_autoload do
|
41
46
|
autoload :BacktraceCleaner
|
@@ -59,6 +64,7 @@ module ActiveSupport
|
|
59
64
|
autoload :StringInquirer
|
60
65
|
autoload :TaggedLogging
|
61
66
|
autoload :XmlMini
|
67
|
+
autoload :ArrayInquirer
|
62
68
|
end
|
63
69
|
|
64
70
|
autoload :Rescuable
|
@@ -71,14 +77,22 @@ module ActiveSupport
|
|
71
77
|
NumberHelper.eager_load!
|
72
78
|
end
|
73
79
|
|
74
|
-
|
80
|
+
cattr_accessor :test_order # :nodoc:
|
75
81
|
|
76
|
-
def self.
|
77
|
-
|
82
|
+
def self.halt_callback_chains_on_return_false
|
83
|
+
Callbacks.halt_and_display_warning_on_return_false
|
78
84
|
end
|
79
85
|
|
80
|
-
def self.
|
81
|
-
|
86
|
+
def self.halt_callback_chains_on_return_false=(value)
|
87
|
+
Callbacks.halt_and_display_warning_on_return_false = value
|
88
|
+
end
|
89
|
+
|
90
|
+
def self.to_time_preserves_timezone
|
91
|
+
DateAndTime::Compatibility.preserve_timezone
|
92
|
+
end
|
93
|
+
|
94
|
+
def self.to_time_preserves_timezone=(value)
|
95
|
+
DateAndTime::Compatibility.preserve_timezone = value
|
82
96
|
end
|
83
97
|
end
|
84
98
|
|
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:
|
4
|
+
version: 5.0.0
|
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:
|
11
|
+
date: 2016-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -24,26 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.7'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: json
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.7'
|
34
|
-
- - ">="
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: 1.7.7
|
37
|
-
type: :runtime
|
38
|
-
prerelease: false
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
40
|
-
requirements:
|
41
|
-
- - "~>"
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: '1.7'
|
44
|
-
- - ">="
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 1.7.7
|
47
27
|
- !ruby/object:Gem::Dependency
|
48
28
|
name: tzinfo
|
49
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,25 +53,25 @@ dependencies:
|
|
73
53
|
- !ruby/object:Gem::Version
|
74
54
|
version: '5.1'
|
75
55
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
56
|
+
name: concurrent-ruby
|
77
57
|
requirement: !ruby/object:Gem::Requirement
|
78
58
|
requirements:
|
79
59
|
- - "~>"
|
80
60
|
- !ruby/object:Gem::Version
|
81
|
-
version: '0
|
61
|
+
version: '1.0'
|
82
62
|
- - ">="
|
83
63
|
- !ruby/object:Gem::Version
|
84
|
-
version: 0.
|
64
|
+
version: 1.0.2
|
85
65
|
type: :runtime
|
86
66
|
prerelease: false
|
87
67
|
version_requirements: !ruby/object:Gem::Requirement
|
88
68
|
requirements:
|
89
69
|
- - "~>"
|
90
70
|
- !ruby/object:Gem::Version
|
91
|
-
version: '0
|
71
|
+
version: '1.0'
|
92
72
|
- - ">="
|
93
73
|
- !ruby/object:Gem::Version
|
94
|
-
version: 0.
|
74
|
+
version: 1.0.2
|
95
75
|
description: A toolkit of support libraries and Ruby core extensions extracted from
|
96
76
|
the Rails framework. Rich support for multibyte strings, internationalization, time
|
97
77
|
zones, and testing.
|
@@ -105,6 +85,7 @@ files:
|
|
105
85
|
- README.rdoc
|
106
86
|
- lib/active_support.rb
|
107
87
|
- lib/active_support/all.rb
|
88
|
+
- lib/active_support/array_inquirer.rb
|
108
89
|
- lib/active_support/backtrace_cleaner.rb
|
109
90
|
- lib/active_support/benchmarkable.rb
|
110
91
|
- lib/active_support/builder.rb
|
@@ -118,6 +99,7 @@ files:
|
|
118
99
|
- lib/active_support/callbacks.rb
|
119
100
|
- lib/active_support/concern.rb
|
120
101
|
- lib/active_support/concurrency/latch.rb
|
102
|
+
- lib/active_support/concurrency/share_lock.rb
|
121
103
|
- lib/active_support/configurable.rb
|
122
104
|
- lib/active_support/core_ext.rb
|
123
105
|
- lib/active_support/core_ext/array.rb
|
@@ -125,29 +107,31 @@ files:
|
|
125
107
|
- lib/active_support/core_ext/array/conversions.rb
|
126
108
|
- lib/active_support/core_ext/array/extract_options.rb
|
127
109
|
- lib/active_support/core_ext/array/grouping.rb
|
110
|
+
- lib/active_support/core_ext/array/inquiry.rb
|
128
111
|
- lib/active_support/core_ext/array/prepend_and_append.rb
|
129
112
|
- lib/active_support/core_ext/array/wrap.rb
|
130
113
|
- lib/active_support/core_ext/benchmark.rb
|
131
114
|
- lib/active_support/core_ext/big_decimal.rb
|
132
115
|
- lib/active_support/core_ext/big_decimal/conversions.rb
|
133
|
-
- lib/active_support/core_ext/big_decimal/yaml_conversions.rb
|
134
116
|
- lib/active_support/core_ext/class.rb
|
135
117
|
- lib/active_support/core_ext/class/attribute.rb
|
136
118
|
- lib/active_support/core_ext/class/attribute_accessors.rb
|
137
|
-
- lib/active_support/core_ext/class/delegating_attributes.rb
|
138
119
|
- lib/active_support/core_ext/class/subclasses.rb
|
139
120
|
- lib/active_support/core_ext/date.rb
|
140
121
|
- lib/active_support/core_ext/date/acts_like.rb
|
122
|
+
- lib/active_support/core_ext/date/blank.rb
|
141
123
|
- lib/active_support/core_ext/date/calculations.rb
|
142
124
|
- lib/active_support/core_ext/date/conversions.rb
|
143
125
|
- lib/active_support/core_ext/date/zones.rb
|
144
126
|
- lib/active_support/core_ext/date_and_time/calculations.rb
|
127
|
+
- lib/active_support/core_ext/date_and_time/compatibility.rb
|
145
128
|
- lib/active_support/core_ext/date_and_time/zones.rb
|
146
129
|
- lib/active_support/core_ext/date_time.rb
|
147
130
|
- lib/active_support/core_ext/date_time/acts_like.rb
|
131
|
+
- lib/active_support/core_ext/date_time/blank.rb
|
148
132
|
- lib/active_support/core_ext/date_time/calculations.rb
|
133
|
+
- lib/active_support/core_ext/date_time/compatibility.rb
|
149
134
|
- lib/active_support/core_ext/date_time/conversions.rb
|
150
|
-
- lib/active_support/core_ext/date_time/zones.rb
|
151
135
|
- lib/active_support/core_ext/digest/uuid.rb
|
152
136
|
- lib/active_support/core_ext/enumerable.rb
|
153
137
|
- lib/active_support/core_ext/file.rb
|
@@ -179,6 +163,7 @@ files:
|
|
179
163
|
- lib/active_support/core_ext/module/anonymous.rb
|
180
164
|
- lib/active_support/core_ext/module/attr_internal.rb
|
181
165
|
- lib/active_support/core_ext/module/attribute_accessors.rb
|
166
|
+
- lib/active_support/core_ext/module/attribute_accessors_per_thread.rb
|
182
167
|
- lib/active_support/core_ext/module/concerning.rb
|
183
168
|
- lib/active_support/core_ext/module/delegation.rb
|
184
169
|
- lib/active_support/core_ext/module/deprecation.rb
|
@@ -191,6 +176,7 @@ files:
|
|
191
176
|
- lib/active_support/core_ext/numeric.rb
|
192
177
|
- lib/active_support/core_ext/numeric/bytes.rb
|
193
178
|
- lib/active_support/core_ext/numeric/conversions.rb
|
179
|
+
- lib/active_support/core_ext/numeric/inquiry.rb
|
194
180
|
- lib/active_support/core_ext/numeric/time.rb
|
195
181
|
- lib/active_support/core_ext/object.rb
|
196
182
|
- lib/active_support/core_ext/object/acts_like.rb
|
@@ -200,7 +186,6 @@ files:
|
|
200
186
|
- lib/active_support/core_ext/object/duplicable.rb
|
201
187
|
- lib/active_support/core_ext/object/inclusion.rb
|
202
188
|
- lib/active_support/core_ext/object/instance_variables.rb
|
203
|
-
- lib/active_support/core_ext/object/itself.rb
|
204
189
|
- lib/active_support/core_ext/object/json.rb
|
205
190
|
- lib/active_support/core_ext/object/to_param.rb
|
206
191
|
- lib/active_support/core_ext/object/to_query.rb
|
@@ -212,6 +197,7 @@ files:
|
|
212
197
|
- lib/active_support/core_ext/range/include_range.rb
|
213
198
|
- lib/active_support/core_ext/range/overlaps.rb
|
214
199
|
- lib/active_support/core_ext/regexp.rb
|
200
|
+
- lib/active_support/core_ext/securerandom.rb
|
215
201
|
- lib/active_support/core_ext/string.rb
|
216
202
|
- lib/active_support/core_ext/string/access.rb
|
217
203
|
- lib/active_support/core_ext/string/behavior.rb
|
@@ -227,16 +213,17 @@ files:
|
|
227
213
|
- lib/active_support/core_ext/string/strip.rb
|
228
214
|
- lib/active_support/core_ext/string/zones.rb
|
229
215
|
- lib/active_support/core_ext/struct.rb
|
230
|
-
- lib/active_support/core_ext/thread.rb
|
231
216
|
- lib/active_support/core_ext/time.rb
|
232
217
|
- lib/active_support/core_ext/time/acts_like.rb
|
233
218
|
- lib/active_support/core_ext/time/calculations.rb
|
219
|
+
- lib/active_support/core_ext/time/compatibility.rb
|
234
220
|
- lib/active_support/core_ext/time/conversions.rb
|
235
221
|
- lib/active_support/core_ext/time/marshal.rb
|
236
222
|
- lib/active_support/core_ext/time/zones.rb
|
237
223
|
- lib/active_support/core_ext/uri.rb
|
238
224
|
- lib/active_support/dependencies.rb
|
239
225
|
- lib/active_support/dependencies/autoload.rb
|
226
|
+
- lib/active_support/dependencies/interlock.rb
|
240
227
|
- lib/active_support/deprecation.rb
|
241
228
|
- lib/active_support/deprecation/behaviors.rb
|
242
229
|
- lib/active_support/deprecation/instance_delegator.rb
|
@@ -245,6 +232,11 @@ files:
|
|
245
232
|
- lib/active_support/deprecation/reporting.rb
|
246
233
|
- lib/active_support/descendants_tracker.rb
|
247
234
|
- lib/active_support/duration.rb
|
235
|
+
- lib/active_support/duration/iso8601_parser.rb
|
236
|
+
- lib/active_support/duration/iso8601_serializer.rb
|
237
|
+
- lib/active_support/evented_file_update_checker.rb
|
238
|
+
- lib/active_support/execution_wrapper.rb
|
239
|
+
- lib/active_support/executor.rb
|
248
240
|
- lib/active_support/file_update_checker.rb
|
249
241
|
- lib/active_support/gem_version.rb
|
250
242
|
- lib/active_support/gzip.rb
|
@@ -266,6 +258,7 @@ files:
|
|
266
258
|
- lib/active_support/log_subscriber/test_helper.rb
|
267
259
|
- lib/active_support/logger.rb
|
268
260
|
- lib/active_support/logger_silence.rb
|
261
|
+
- lib/active_support/logger_thread_safe_level.rb
|
269
262
|
- lib/active_support/message_encryptor.rb
|
270
263
|
- lib/active_support/message_verifier.rb
|
271
264
|
- lib/active_support/multibyte.rb
|
@@ -290,6 +283,7 @@ files:
|
|
290
283
|
- lib/active_support/proxy_object.rb
|
291
284
|
- lib/active_support/rails.rb
|
292
285
|
- lib/active_support/railtie.rb
|
286
|
+
- lib/active_support/reloader.rb
|
293
287
|
- lib/active_support/rescuable.rb
|
294
288
|
- lib/active_support/security_utils.rb
|
295
289
|
- lib/active_support/string_inquirer.rb
|
@@ -301,8 +295,11 @@ files:
|
|
301
295
|
- lib/active_support/testing/constant_lookup.rb
|
302
296
|
- lib/active_support/testing/declarative.rb
|
303
297
|
- lib/active_support/testing/deprecation.rb
|
298
|
+
- lib/active_support/testing/file_fixtures.rb
|
304
299
|
- lib/active_support/testing/isolation.rb
|
300
|
+
- lib/active_support/testing/method_call_assertions.rb
|
305
301
|
- lib/active_support/testing/setup_and_teardown.rb
|
302
|
+
- lib/active_support/testing/stream.rb
|
306
303
|
- lib/active_support/testing/tagged_logging.rb
|
307
304
|
- lib/active_support/testing/time_helpers.rb
|
308
305
|
- lib/active_support/time.rb
|
@@ -317,7 +314,7 @@ files:
|
|
317
314
|
- lib/active_support/xml_mini/nokogiri.rb
|
318
315
|
- lib/active_support/xml_mini/nokogirisax.rb
|
319
316
|
- lib/active_support/xml_mini/rexml.rb
|
320
|
-
homepage: http://
|
317
|
+
homepage: http://rubyonrails.org
|
321
318
|
licenses:
|
322
319
|
- MIT
|
323
320
|
metadata: {}
|
@@ -331,7 +328,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
331
328
|
requirements:
|
332
329
|
- - ">="
|
333
330
|
- !ruby/object:Gem::Version
|
334
|
-
version:
|
331
|
+
version: 2.2.2
|
335
332
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
336
333
|
requirements:
|
337
334
|
- - ">="
|
@@ -339,7 +336,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
339
336
|
version: '0'
|
340
337
|
requirements: []
|
341
338
|
rubyforge_project:
|
342
|
-
rubygems_version: 2.
|
339
|
+
rubygems_version: 2.6.4
|
343
340
|
signing_key:
|
344
341
|
specification_version: 4
|
345
342
|
summary: A toolkit of support libraries and Ruby core extensions extracted from the
|
@@ -1,14 +0,0 @@
|
|
1
|
-
ActiveSupport::Deprecation.warn 'core_ext/big_decimal/yaml_conversions is deprecated and will be removed in the future.'
|
2
|
-
|
3
|
-
require 'bigdecimal'
|
4
|
-
require 'yaml'
|
5
|
-
require 'active_support/core_ext/big_decimal/conversions'
|
6
|
-
|
7
|
-
class BigDecimal
|
8
|
-
YAML_MAPPING = { 'Infinity' => '.Inf', '-Infinity' => '-.Inf', 'NaN' => '.NaN' }
|
9
|
-
|
10
|
-
def encode_with(coder)
|
11
|
-
string = to_s
|
12
|
-
coder.represent_scalar(nil, YAML_MAPPING[string] || string)
|
13
|
-
end
|
14
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'active_support/core_ext/kernel/singleton_class'
|
2
|
-
require 'active_support/core_ext/module/remove_method'
|
3
|
-
require 'active_support/core_ext/module/deprecation'
|
4
|
-
|
5
|
-
|
6
|
-
class Class
|
7
|
-
def superclass_delegating_accessor(name, options = {})
|
8
|
-
# Create private _name and _name= methods that can still be used if the public
|
9
|
-
# methods are overridden.
|
10
|
-
_superclass_delegating_accessor("_#{name}", options)
|
11
|
-
|
12
|
-
# Generate the public methods name, name=, and name?.
|
13
|
-
# These methods dispatch to the private _name, and _name= methods, making them
|
14
|
-
# overridable.
|
15
|
-
singleton_class.send(:define_method, name) { send("_#{name}") }
|
16
|
-
singleton_class.send(:define_method, "#{name}?") { !!send("_#{name}") }
|
17
|
-
singleton_class.send(:define_method, "#{name}=") { |value| send("_#{name}=", value) }
|
18
|
-
|
19
|
-
# If an instance_reader is needed, generate public instance methods name and name?.
|
20
|
-
if options[:instance_reader] != false
|
21
|
-
define_method(name) { send("_#{name}") }
|
22
|
-
define_method("#{name}?") { !!send("#{name}") }
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
deprecate superclass_delegating_accessor: :class_attribute
|
27
|
-
|
28
|
-
private
|
29
|
-
# Take the object being set and store it in a method. This gives us automatic
|
30
|
-
# inheritance behavior, without having to store the object in an instance
|
31
|
-
# variable and look up the superclass chain manually.
|
32
|
-
def _stash_object_in_method(object, method, instance_reader = true)
|
33
|
-
singleton_class.remove_possible_method(method)
|
34
|
-
singleton_class.send(:define_method, method) { object }
|
35
|
-
remove_possible_method(method)
|
36
|
-
define_method(method) { object } if instance_reader
|
37
|
-
end
|
38
|
-
|
39
|
-
def _superclass_delegating_accessor(name, options = {})
|
40
|
-
singleton_class.send(:define_method, "#{name}=") do |value|
|
41
|
-
_stash_object_in_method(value, name, options[:instance_reader] != false)
|
42
|
-
end
|
43
|
-
send("#{name}=", nil)
|
44
|
-
end
|
45
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class Object
|
2
|
-
# TODO: Remove this file when we drop support for Ruby < 2.2
|
3
|
-
unless respond_to?(:itself)
|
4
|
-
# Returns the object itself.
|
5
|
-
#
|
6
|
-
# Useful for chaining methods, such as Active Record scopes:
|
7
|
-
#
|
8
|
-
# Event.public_send(state.presence_in([ :trashed, :drafted ]) || :itself).order(:created_at)
|
9
|
-
#
|
10
|
-
# @return Object
|
11
|
-
def itself
|
12
|
-
self
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,86 +0,0 @@
|
|
1
|
-
class Thread
|
2
|
-
LOCK = Mutex.new # :nodoc:
|
3
|
-
|
4
|
-
# Returns the value of a thread local variable that has been set. Note that
|
5
|
-
# these are different than fiber local values.
|
6
|
-
#
|
7
|
-
# Thread local values are carried along with threads, and do not respect
|
8
|
-
# fibers. For example:
|
9
|
-
#
|
10
|
-
# Thread.new {
|
11
|
-
# Thread.current.thread_variable_set("foo", "bar") # set a thread local
|
12
|
-
# Thread.current["foo"] = "bar" # set a fiber local
|
13
|
-
#
|
14
|
-
# Fiber.new {
|
15
|
-
# Fiber.yield [
|
16
|
-
# Thread.current.thread_variable_get("foo"), # get the thread local
|
17
|
-
# Thread.current["foo"], # get the fiber local
|
18
|
-
# ]
|
19
|
-
# }.resume
|
20
|
-
# }.join.value # => ['bar', nil]
|
21
|
-
#
|
22
|
-
# The value <tt>"bar"</tt> is returned for the thread local, where +nil+ is returned
|
23
|
-
# for the fiber local. The fiber is executed in the same thread, so the
|
24
|
-
# thread local values are available.
|
25
|
-
def thread_variable_get(key)
|
26
|
-
_locals[key.to_sym]
|
27
|
-
end
|
28
|
-
|
29
|
-
# Sets a thread local with +key+ to +value+. Note that these are local to
|
30
|
-
# threads, and not to fibers. Please see Thread#thread_variable_get for
|
31
|
-
# more information.
|
32
|
-
def thread_variable_set(key, value)
|
33
|
-
_locals[key.to_sym] = value
|
34
|
-
end
|
35
|
-
|
36
|
-
# Returns an array of the names of the thread-local variables (as Symbols).
|
37
|
-
#
|
38
|
-
# thr = Thread.new do
|
39
|
-
# Thread.current.thread_variable_set(:cat, 'meow')
|
40
|
-
# Thread.current.thread_variable_set("dog", 'woof')
|
41
|
-
# end
|
42
|
-
# thr.join # => #<Thread:0x401b3f10 dead>
|
43
|
-
# thr.thread_variables # => [:dog, :cat]
|
44
|
-
#
|
45
|
-
# Note that these are not fiber local variables. Please see Thread#thread_variable_get
|
46
|
-
# for more details.
|
47
|
-
def thread_variables
|
48
|
-
_locals.keys
|
49
|
-
end
|
50
|
-
|
51
|
-
# Returns <tt>true</tt> if the given string (or symbol) exists as a
|
52
|
-
# thread-local variable.
|
53
|
-
#
|
54
|
-
# me = Thread.current
|
55
|
-
# me.thread_variable_set(:oliver, "a")
|
56
|
-
# me.thread_variable?(:oliver) # => true
|
57
|
-
# me.thread_variable?(:stanley) # => false
|
58
|
-
#
|
59
|
-
# Note that these are not fiber local variables. Please see Thread#thread_variable_get
|
60
|
-
# for more details.
|
61
|
-
def thread_variable?(key)
|
62
|
-
_locals.has_key?(key.to_sym)
|
63
|
-
end
|
64
|
-
|
65
|
-
# Freezes the thread so that thread local variables cannot be set via
|
66
|
-
# Thread#thread_variable_set, nor can fiber local variables be set.
|
67
|
-
#
|
68
|
-
# me = Thread.current
|
69
|
-
# me.freeze
|
70
|
-
# me.thread_variable_set(:oliver, "a") #=> RuntimeError: can't modify frozen thread locals
|
71
|
-
# me[:oliver] = "a" #=> RuntimeError: can't modify frozen thread locals
|
72
|
-
def freeze
|
73
|
-
_locals.freeze
|
74
|
-
super
|
75
|
-
end
|
76
|
-
|
77
|
-
private
|
78
|
-
|
79
|
-
def _locals
|
80
|
-
if defined?(@_locals)
|
81
|
-
@_locals
|
82
|
-
else
|
83
|
-
LOCK.synchronize { @_locals ||= {} }
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end unless Thread.instance_methods.include?(:thread_variable_set)
|