Pathname.md5 method
This commit is contained in:
parent
650d1cb165
commit
6bd1741d7d
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user