1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport/lib/active_support/base64.rb
2008-02-07 21:50:46 +00:00

22 lines
354 B
Ruby

begin
require 'base64'
rescue LoadError
end
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