15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/wip/runner/workflow.rb', line 15
def self.define(&block)
command = (eval 'self', block.send(:binding))
command.send(:include, InstanceMethods)
command.class_exec do
options do |parser, config|
config.overview = false
config.preview = false
parser.on('--overview', 'Prints workflow overview') do
config.no_validate = true
config.overview = true
end
parser.on('--preview', 'Prints workflow preview') do
config.preview = true
end
define_method(:builder) do
@builder ||= Builder.new(self, &block)
end
end
end
end
|