Pathname.md5 method

This commit is contained in:
Max Howell 2009-12-30 18:56:46 +00:00
parent 650d1cb165
commit 6bd1741d7d

View File

@ -154,6 +154,11 @@ class Pathname
nil
end
def md5
require 'digest'
Digest::MD5.hexdigest(File.read(self))
end
if '1.9' <= RUBY_VERSION
alias_method :to_str, :to_s
end