diff options
| author | Max Howell | 2009-12-30 18:56:46 +0000 |
|---|---|---|
| committer | Max Howell | 2009-12-30 20:49:16 +0000 |
| commit | 6bd1741d7dbf117dbb9f52f450790fe579f798a6 (patch) | |
| tree | fab72573f1da7dc6e26313551a0ec009ea1fcf26 /Library/Homebrew | |
| parent | 650d1cb1651b7c84189a8acb7da5d9d9e9c002fc (diff) | |
| download | brew-6bd1741d7dbf117dbb9f52f450790fe579f798a6.tar.bz2 | |
Pathname.md5 method
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 5 |
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 |
