aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/json/decoding.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/json/decoding.rb')
-rw-r--r--activesupport/lib/active_support/json/decoding.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/json/decoding.rb b/activesupport/lib/active_support/json/decoding.rb
index c66500aa9c..70e9f40fc7 100644
--- a/activesupport/lib/active_support/json/decoding.rb
+++ b/activesupport/lib/active_support/json/decoding.rb
@@ -1,6 +1,3 @@
-autoload :YAML, 'yaml' unless defined? YAML
-autoload :StringScanner, 'strscan' unless defined? StringScanner
-
require 'active_support/core_ext/string/starts_ends_with'
module ActiveSupport
@@ -22,7 +19,8 @@ module ActiveSupport
# Ensure that ":" and "," are always followed by a space
def convert_json_to_yaml(json) #:nodoc:
- scanner, quoting, marks, pos, times = StringScanner.new(json), false, [], nil, []
+ require 'strscan' unless defined? ::StringScanner
+ scanner, quoting, marks, pos, times = ::StringScanner.new(json), false, [], nil, []
while scanner.scan_until(/(\\['"]|['":,\\]|\\.)/)
case char = scanner[1]
when '"', "'"