aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2009-12-30 18:56:46 +0000
committerMax Howell2009-12-30 20:49:16 +0000
commit270a1bcd9b1c7656a159c5f302a4c3d9bcba1e57 (patch)
treea99e21cb1bb271423c8c3b1a8566ebe5f81cc23b /Library
parent699759848dab3cb2f5728f9529b815c93676cf52 (diff)
downloadhomebrew-270a1bcd9b1c7656a159c5f302a4c3d9bcba1e57.tar.bz2
Pathname.md5 method
Diffstat (limited to 'Library')
-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