aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/extend')
-rw-r--r--Library/Homebrew/extend/pathname.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index d1a0f8d5b..36aaa31fb 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -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