aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/xml_mini.rb
diff options
context:
space:
mode:
authorSergey Nartimov <just.lest@gmail.com>2012-01-03 00:55:42 +0300
committerSergey Nartimov <just.lest@gmail.com>2012-01-03 00:57:03 +0300
commit5f09414f85edfa60ab54ce8b9f8b03874e0670dc (patch)
treec130e4279ffee79d0cd6a69610480ff9eb9ca0d1 /activesupport/lib/active_support/xml_mini.rb
parent6e9cd3846811718611543dae049c000076319587 (diff)
downloadrails-5f09414f85edfa60ab54ce8b9f8b03874e0670dc.tar.gz
rails-5f09414f85edfa60ab54ce8b9f8b03874e0670dc.tar.bz2
rails-5f09414f85edfa60ab54ce8b9f8b03874e0670dc.zip
deprecate ActiveSupport::Base64
extend and define ::Base64 if needed
Diffstat (limited to 'activesupport/lib/active_support/xml_mini.rb')
-rw-r--r--activesupport/lib/active_support/xml_mini.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/xml_mini.rb b/activesupport/lib/active_support/xml_mini.rb
index 1ea9a9d7e1..4df3fd0efa 100644
--- a/activesupport/lib/active_support/xml_mini.rb
+++ b/activesupport/lib/active_support/xml_mini.rb
@@ -48,7 +48,7 @@ module ActiveSupport
"symbol" => Proc.new { |symbol| symbol.to_s },
"date" => Proc.new { |date| date.to_s(:db) },
"datetime" => Proc.new { |time| time.xmlschema },
- "binary" => Proc.new { |binary| ActiveSupport::Base64.encode64(binary) },
+ "binary" => Proc.new { |binary| ::Base64.encode64(binary) },
"yaml" => Proc.new { |yaml| yaml.to_yaml }
} unless defined?(FORMATTING)
@@ -64,7 +64,7 @@ module ActiveSupport
"boolean" => Proc.new { |boolean| %w(1 true).include?(boolean.strip) },
"string" => Proc.new { |string| string.to_s },
"yaml" => Proc.new { |yaml| YAML::load(yaml) rescue yaml },
- "base64Binary" => Proc.new { |bin| ActiveSupport::Base64.decode64(bin) },
+ "base64Binary" => Proc.new { |bin| ::Base64.decode64(bin) },
"binary" => Proc.new { |bin, entity| _parse_binary(bin, entity) },
"file" => Proc.new { |file, entity| _parse_file(file, entity) }
}
@@ -148,14 +148,14 @@ module ActiveSupport
def _parse_binary(bin, entity) #:nodoc:
case entity['encoding']
when 'base64'
- ActiveSupport::Base64.decode64(bin)
+ ::Base64.decode64(bin)
else
bin
end
end
def _parse_file(file, entity)
- f = StringIO.new(ActiveSupport::Base64.decode64(file))
+ f = StringIO.new(::Base64.decode64(file))
f.extend(FileLike)
f.original_filename = entity['name']
f.content_type = entity['content_type']