aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/compat
diff options
context:
space:
mode:
authorJack Nagel2013-03-18 14:59:10 -0500
committerJack Nagel2013-03-18 15:10:36 -0500
commit31fd139e57bbc56a4eb85ed8961abe1cd4c63d1e (patch)
tree9075e6cf974d98ceeac9d85be2bbd9bd158b8b18 /Library/Homebrew/compat
parentda6aa7f5a62d9e14ba565030b051d14e9d465f57 (diff)
downloadhomebrew-31fd139e57bbc56a4eb85ed8961abe1cd4c63d1e.tar.bz2
Simplify SoftwareSpec checksum methods
Reader methods for specific checksum types have been absent from the Formula class for some time, so there isn't any reason to expose them in SoftwareSpec, either. Thus, these methods now only act as setters, and #checksum should be used to access the constructed Checksum object.
Diffstat (limited to 'Library/Homebrew/compat')
-rw-r--r--Library/Homebrew/compat/compatibility.rb17
1 files changed, 5 insertions, 12 deletions
diff --git a/Library/Homebrew/compat/compatibility.rb b/Library/Homebrew/compat/compatibility.rb
index 51969330f..aee5da63f 100644
--- a/Library/Homebrew/compat/compatibility.rb
+++ b/Library/Homebrew/compat/compatibility.rb
@@ -202,22 +202,15 @@ end
# MD5 support
class Formula
- def self.md5(val=nil)
- unless val.nil?
- @stable ||= SoftwareSpec.new
- @stable.md5(val)
- end
- return @stable ? @stable.md5 : @md5
+ def self.md5(val)
+ @stable ||= SoftwareSpec.new
+ @stable.md5(val)
end
end
class SoftwareSpec
- def md5(val=nil)
- if val.nil?
- @checksum if checksum.nil? or @checksum.hash_type == :md5
- else
- @checksum = Checksum.new(:md5, val)
- end
+ def md5(val)
+ @checksum = Checksum.new(:md5, val)
end
end