public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
jweiss (author)
Thu Apr 17 10:58:31 -0700 2008
josh (committer)
Thu Apr 17 10:58:31 -0700 2008
commit  9e1d506a8cfedef2fdd605e4cbf4bf53651ad214
tree    bb68f6da2b3425008fdab9905555dd813d42756a
parent  9e53b63601ce12fb7e4c8fdb16d5706ea8609d2f
100644 23 lines (19 sloc) 0.354 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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