mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Missed commit. References #10554.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8434 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
f91acf0258
commit
a5ca52f4a5
1 changed files with 17 additions and 0 deletions
17
activesupport/lib/active_support/base64.rb
Normal file
17
activesupport/lib/active_support/base64.rb
Normal file
|
@ -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
|
Loading…
Reference in a new issue