Class: Tango::Runner
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Shell
#shell, #shell!
Methods included from MetAndMeet
#meet, #met?
Methods included from Fetch
#fetch
Methods included from Delegate
included
#as_user, #in_context, #in_directory, #with_umask
#write
Class Method Details
.step(step_name, &block) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/tango/runner.rb', line 17
def self.step(step_name, &block)
define_method(step_name) do |*args|
description = step_description(step_name, args)
logger.enter(description)
result = instance_exec(*args, &block)
logger.leave(description)
result
end
end
|
Instance Method Details
#logger ⇒ Object
37
38
39
|
# File 'lib/tango/runner.rb', line 37
def logger
Logger.instance
end
|
#step_description(step_name, args) ⇒ Object
29
30
31
32
33
|
# File 'lib/tango/runner.rb', line 29
def step_description(step_name, args)
description = "#{self.class.name}.#{step_name}"
description << "(" + args.map {|arg| arg.inspect }.join(", ") + ")" unless args.empty?
description
end
|