mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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:
parent
ce164c2a30
commit
b89f4520e5
2 changed files with 92 additions and 67 deletions
|
@ -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>
|
Wed Jan 21 16:01:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/digest/rmd160/extconf.rb: have_library appends found library.
|
* ext/digest/rmd160/extconf.rb: have_library appends found library.
|
||||||
|
|
|
@ -12,6 +12,8 @@ require "kconv"
|
||||||
# puts plain
|
# puts plain
|
||||||
|
|
||||||
|
|
||||||
|
module Base64
|
||||||
|
module_function
|
||||||
|
|
||||||
# Returns the Base64-decoded version of \obj{str}.
|
# Returns the Base64-decoded version of \obj{str}.
|
||||||
#
|
#
|
||||||
|
@ -82,3 +84,22 @@ def b64encode(bin, len = 60)
|
||||||
print $&, "\n"
|
print $&, "\n"
|
||||||
end
|
end
|
||||||
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
|
||||||
|
|
Loading…
Add table
Reference in a new issue