From a5ca52f4a5c9d87834f3d4bf3073d12df9a9dc74 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 18 Dec 2007 21:26:01 +0000 Subject: Missed commit. References #10554. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8434 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/base64.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 activesupport/lib/active_support/base64.rb (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/base64.rb b/activesupport/lib/active_support/base64.rb new file mode 100644 index 0000000000..4fc8cd13a7 --- /dev/null +++ b/activesupport/lib/active_support/base64.rb @@ -0,0 +1,17 @@ +module ActiveSupport + if defined? ::Base64 + Base64 = ::Base64 + else + # Ruby 1.9 doesn't provide base64, so we wrap this here + module Base64 + + def self.encode64(data) + [data].pack("m") + end + + def self.decode64(data) + data.unpack("m").first + end + end + end +end -- cgit v1.2.3