Pathname.md5 method
This commit is contained in:
parent
650d1cb165
commit
6bd1741d7d
@ -154,6 +154,11 @@ class Pathname
|
|||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def md5
|
||||||
|
require 'digest'
|
||||||
|
Digest::MD5.hexdigest(File.read(self))
|
||||||
|
end
|
||||||
|
|
||||||
if '1.9' <= RUBY_VERSION
|
if '1.9' <= RUBY_VERSION
|
||||||
alias_method :to_str, :to_s
|
alias_method :to_str, :to_s
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user