class SousChef::Resource::Log
Public Class Methods
new(context, name=nil, &block)
click to toggle source
Calls superclass method
SousChef::Resource::Base::new
# File lib/sous_chef/resource/log.rb, line 4 def initialize(context, name=nil, &block) super @stdout = nil @stderr = nil end
Public Instance Methods
stderr(stderr=nil)
click to toggle source
# File lib/sous_chef/resource/log.rb, line 15 def stderr(stderr=nil) set_or_return(:stderr, stderr) end
stdout(stdout=nil)
click to toggle source
# File lib/sous_chef/resource/log.rb, line 11 def stdout(stdout=nil) set_or_return(:stdout, stdout) end
to_script()
click to toggle source
Calls superclass method
SousChef::Resource::Base#to_script
# File lib/sous_chef/resource/log.rb, line 19 def to_script @script ||= begin setup unless @stdout || @stderr @stdout, @stderr = name, "&1" end append exec_command(escape_path(@stdout), escape_path(@stderr)) super end end
Protected Instance Methods
exec_command(stdout, stderr)
click to toggle source
# File lib/sous_chef/resource/log.rb, line 31 def exec_command(stdout, stderr) args = [] args << "1>#{escape_path(stdout)}" if stdout args << "2>#{escape_path(stderr)}" if stderr "exec #{args.join(' ')}" end