diff options
| author | Max Howell | 2009-12-30 18:56:46 +0000 |
|---|---|---|
| committer | Max Howell | 2009-12-30 20:49:16 +0000 |
| commit | 270a1bcd9b1c7656a159c5f302a4c3d9bcba1e57 (patch) | |
| tree | a99e21cb1bb271423c8c3b1a8566ebe5f81cc23b /Library | |
| parent | 699759848dab3cb2f5728f9529b815c93676cf52 (diff) | |
| download | homebrew-270a1bcd9b1c7656a159c5f302a4c3d9bcba1e57.tar.bz2 | |
Pathname.md5 method
Diffstat (limited to 'Library')
| -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 |
