Remove some evals from formula DSL

The default arguments were removed from these methods long ago, so
nothing is standing in the way of using define_method here.
This commit is contained in:
Jack Nagel 2014-05-27 21:02:00 -05:00
parent 152490b7b0
commit 28fa5b0261
2 changed files with 4 additions and 12 deletions

View File

@ -633,12 +633,8 @@ class Formula
stable.mirror(val)
end
Checksum::TYPES.each do |cksum|
class_eval <<-EOS, __FILE__, __LINE__ + 1
def #{cksum}(val)
stable.#{cksum}(val)
end
EOS
Checksum::TYPES.each do |type|
define_method(type) { |val| stable.send(type, val) }
end
def bottle *, &block

View File

@ -95,12 +95,8 @@ class Resource
puts "For your reference the SHA1 is: #{fn.sha1}"
end
Checksum::TYPES.each do |cksum|
class_eval <<-EOS, __FILE__, __LINE__ + 1
def #{cksum}(val)
@checksum = Checksum.new(:#{cksum}, val)
end
EOS
Checksum::TYPES.each do |type|
define_method(type) { |val| @checksum = Checksum.new(type, val) }
end
def url val=nil, specs={}