1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/digest/lib/sha1.rb
knu 957ce6574c * ext/digest/lib/md5.rb, ext/digest/lib/sha1.rb: Add an
obsoleteness warning under -w/-v.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-24 07:21:12 +00:00

25 lines
464 B
Ruby

# just for compatibility; requiring "sha1" is obsoleted
#
# $RoughId: sha1.rb,v 1.4 2001/07/13 15:38:27 knu Exp $
# $Id$
warn "require 'sha1' is obsolete; require 'digest' and use Digest::SHA1." if $VERBOSE
require 'digest/sha1'
class SHA1 < Digest::SHA1
class << self
alias orig_new new
def new(str = nil)
if str
orig_new.update(str)
else
orig_new
end
end
def sha1(*args)
new(*args)
end
end
end