Permalink
Browse files

Missed commit. References #10554.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8434 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent f91acf0 commit a5ca52f4a5c9d87834f3d4bf3073d12df9a9dc74 @jeremy jeremy committed Dec 18, 2007
Showing with 17 additions and 0 deletions.
  1. +17 −0 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

0 comments on commit a5ca52f

Please sign in to comment.