From 5f09414f85edfa60ab54ce8b9f8b03874e0670dc Mon Sep 17 00:00:00 2001 From: Sergey Nartimov Date: Tue, 3 Jan 2012 00:55:42 +0300 Subject: deprecate ActiveSupport::Base64 extend and define ::Base64 if needed --- activesupport/lib/active_support/xml_mini.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'activesupport/lib/active_support/xml_mini.rb') 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'] -- cgit v1.2.3