1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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