aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMax Howell2009-12-30 18:56:46 +0000
committerMax Howell2009-12-30 20:49:16 +0000
commit6bd1741d7dbf117dbb9f52f450790fe579f798a6 (patch)
treefab72573f1da7dc6e26313551a0ec009ea1fcf26 /Library/Homebrew
parent650d1cb1651b7c84189a8acb7da5d9d9e9c002fc (diff)
downloadbrew-6bd1741d7dbf117dbb9f52f450790fe579f798a6.tar.bz2
Pathname.md5 method
Diffstat (limited to 'Library/Homebrew')
-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