class Chake::ConfigManager::Shell
Public Class Methods
Source
# File lib/chake/config_manager/shell.rb, line 16 def self.accept?(node) node.data.key?('shell') end
Public Instance Methods
Source
# File lib/chake/config_manager/shell.rb, line 12 def apply(config) node.run_as_root sh(config) end
Source
# File lib/chake/config_manager/shell.rb, line 7 def converge commands = node.data['shell'].join(' && ') node.run_as_root sh(commands) end
Private Instance Methods
Source
# File lib/chake/config_manager/shell.rb, line 22 def sh(command) if node.path command = "cd #{node.path} && " + command end if node.silent "sh -ec '#{command}' >/dev/null" else "sh -xec '#{command}'" end end