activesupport 4.1.16 → 4.2.0.beta1
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 +140 -714
- data/README.rdoc +7 -2
- data/lib/active_support/backtrace_cleaner.rb +4 -4
- data/lib/active_support/cache.rb +18 -20
- data/lib/active_support/cache/file_store.rb +5 -0
- data/lib/active_support/cache/strategy/local_cache.rb +5 -4
- data/lib/active_support/cache/strategy/local_cache_middleware.rb +5 -0
- data/lib/active_support/callbacks.rb +92 -140
- data/lib/active_support/concern.rb +9 -1
- data/lib/active_support/core_ext/array/access.rb +5 -1
- data/lib/active_support/core_ext/array/grouping.rb +5 -0
- data/lib/active_support/core_ext/class/delegating_attributes.rb +4 -0
- data/lib/active_support/core_ext/date_time/calculations.rb +11 -1
- data/lib/active_support/core_ext/date_time/conversions.rb +2 -2
- data/lib/active_support/core_ext/digest/uuid.rb +51 -0
- data/lib/active_support/core_ext/hash.rb +1 -0
- data/lib/active_support/core_ext/hash/conversions.rb +2 -3
- data/lib/active_support/core_ext/hash/indifferent_access.rb +1 -1
- data/lib/active_support/core_ext/hash/keys.rb +10 -6
- data/lib/active_support/core_ext/hash/transform_values.rb +23 -0
- data/lib/active_support/core_ext/kernel.rb +3 -2
- data/lib/active_support/core_ext/kernel/concern.rb +10 -0
- data/lib/active_support/core_ext/kernel/reporting.rb +14 -0
- data/lib/active_support/core_ext/load_error.rb +4 -1
- data/lib/active_support/core_ext/module/delegation.rb +13 -25
- data/lib/active_support/core_ext/numeric/time.rb +1 -19
- data/lib/active_support/core_ext/object.rb +1 -0
- data/lib/active_support/core_ext/object/duplicable.rb +4 -11
- data/lib/active_support/core_ext/object/itself.rb +12 -0
- data/lib/active_support/core_ext/object/json.rb +1 -1
- data/lib/active_support/core_ext/object/to_query.rb +2 -1
- data/lib/active_support/core_ext/object/with_options.rb +15 -2
- data/lib/active_support/core_ext/string/access.rb +4 -4
- data/lib/active_support/core_ext/string/filters.rb +25 -1
- data/lib/active_support/core_ext/string/inflections.rb +3 -1
- data/lib/active_support/core_ext/string/output_safety.rb +29 -19
- data/lib/active_support/core_ext/thread.rb +7 -0
- data/lib/active_support/core_ext/time/conversions.rb +1 -1
- data/lib/active_support/core_ext/time/zones.rb +0 -1
- data/lib/active_support/dependencies.rb +5 -4
- data/lib/active_support/duration.rb +2 -3
- data/lib/active_support/gem_version.rb +3 -3
- data/lib/active_support/hash_with_indifferent_access.rb +13 -5
- data/lib/active_support/i18n_railtie.rb +1 -7
- data/lib/active_support/inflector/inflections.rb +1 -1
- data/lib/active_support/inflector/methods.rb +39 -15
- data/lib/active_support/json/encoding.rb +0 -4
- data/lib/active_support/logger.rb +0 -14
- data/lib/active_support/logger_silence.rb +3 -24
- data/lib/active_support/message_encryptor.rb +2 -1
- data/lib/active_support/multibyte/unicode.rb +5 -3
- data/lib/active_support/notifications.rb +7 -2
- data/lib/active_support/notifications/fanout.rb +11 -6
- data/lib/active_support/number_helper.rb +7 -8
- data/lib/active_support/number_helper/number_to_rounded_converter.rb +2 -2
- data/lib/active_support/test_case.rb +3 -13
- data/lib/active_support/testing/assertions.rb +1 -1
- data/lib/active_support/testing/declarative.rb +1 -25
- data/lib/active_support/testing/isolation.rb +16 -6
- data/lib/active_support/testing/tagged_logging.rb +1 -1
- data/lib/active_support/testing/time_helpers.rb +5 -1
- data/lib/active_support/time.rb +0 -2
- data/lib/active_support/time_with_zone.rb +14 -3
- data/lib/active_support/values/time_zone.rb +76 -75
- data/lib/active_support/xml_mini.rb +0 -3
- data/lib/active_support/xml_mini/jdom.rb +5 -6
- data/lib/active_support/xml_mini/rexml.rb +5 -6
- metadata +17 -16
- data/lib/active_support/core_ext/object/to_json.rb +0 -5
- data/lib/active_support/file_watcher.rb +0 -36
- data/lib/active_support/security_utils.rb +0 -27
@@ -1,36 +0,0 @@
|
|
1
|
-
module ActiveSupport
|
2
|
-
class FileWatcher
|
3
|
-
class Backend
|
4
|
-
def initialize(path, watcher)
|
5
|
-
@watcher = watcher
|
6
|
-
@path = path
|
7
|
-
end
|
8
|
-
|
9
|
-
def trigger(files)
|
10
|
-
@watcher.trigger(files)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def initialize
|
15
|
-
@regex_matchers = {}
|
16
|
-
end
|
17
|
-
|
18
|
-
def watch(pattern, &block)
|
19
|
-
@regex_matchers[pattern] = block
|
20
|
-
end
|
21
|
-
|
22
|
-
def trigger(files)
|
23
|
-
trigger_files = Hash.new { |h,k| h[k] = Hash.new { |h2,k2| h2[k2] = [] } }
|
24
|
-
|
25
|
-
files.each do |file, state|
|
26
|
-
@regex_matchers.each do |pattern, block|
|
27
|
-
trigger_files[block][state] << file if pattern === file
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
trigger_files.each do |block, payload|
|
32
|
-
block.call payload
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'digest'
|
2
|
-
|
3
|
-
module ActiveSupport
|
4
|
-
module SecurityUtils
|
5
|
-
# Constant time string comparison.
|
6
|
-
#
|
7
|
-
# The values compared should be of fixed length, such as strings
|
8
|
-
# that have already been processed by HMAC. This should not be used
|
9
|
-
# on variable length plaintext strings because it could leak length info
|
10
|
-
# via timing attacks.
|
11
|
-
def secure_compare(a, b)
|
12
|
-
return false unless a.bytesize == b.bytesize
|
13
|
-
|
14
|
-
l = a.unpack "C#{a.bytesize}"
|
15
|
-
|
16
|
-
res = 0
|
17
|
-
b.each_byte { |byte| res |= byte ^ l.shift }
|
18
|
-
res == 0
|
19
|
-
end
|
20
|
-
module_function :secure_compare
|
21
|
-
|
22
|
-
def variable_size_secure_compare(a, b) # :nodoc:
|
23
|
-
secure_compare(::Digest::SHA256.hexdigest(a), ::Digest::SHA256.hexdigest(b))
|
24
|
-
end
|
25
|
-
module_function :variable_size_secure_compare
|
26
|
-
end
|
27
|
-
end
|