15 lines
288 B
Ruby
Raw Normal View History

2016-09-24 13:52:43 +02:00
module Hbc
class Caveats
def initialize(block)
@block = block
end
2016-08-18 22:11:42 +03:00
2016-09-24 13:52:43 +02:00
def eval_and_print(cask)
dsl = DSL::Caveats.new(cask)
retval = dsl.instance_eval(&@block)
return if retval.nil?
puts retval.to_s.sub(%r{[\r\n \t]*\Z}, "\n\n")
end
2016-08-18 22:11:42 +03:00
end
end