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:
parent
152490b7b0
commit
28fa5b0261
@ -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
|
||||
|
||||
@ -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={}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user