* lib/base64.rb: enclosed in a module. [ruby-core:02285]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2004-01-21 07:10:41 +00:00
Родитель ce164c2a30
Коммит b89f4520e5
2 изменённых файлов: 92 добавлений и 67 удалений

Просмотреть файл

@ -1,3 +1,7 @@
Wed Jan 21 16:10:36 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/base64.rb: enclosed in a module. [ruby-core:02285]
Wed Jan 21 16:01:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/digest/rmd160/extconf.rb: have_library appends found library.

Просмотреть файл

@ -12,6 +12,8 @@ require "kconv"
# puts plain
module Base64
module_function
# Returns the Base64-decoded version of \obj{str}.
#
@ -82,3 +84,22 @@ def b64encode(bin, len = 60)
print $&, "\n"
end
end
module Deprecated
include Base64
def _deprecated_base64(*args)
m0, m1 = caller(0)
m = m0[/\`(.*?)\'\z/, 1]
warn("#{m1}: #{m} is deprecated; use Base64.#{m} instead")
super
end
dep = instance_method(:_deprecated_base64)
remove_method(:_deprecated_base64)
for m in Base64.private_instance_methods(false)
define_method(m, dep)
end
end
end
include Base64::Deprecated