instiki/vendor/rails/activesupport/lib/active_support/base64.rb
Jacques Distler 5292899c9a Rails 2.1 RC1
Updated Instiki to Rails 2.1 RC1 (aka 2.0.991).
2008-05-17 23:22:34 -05:00

23 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