class Chake::ConfigManager::Shell

Public Class Methods

accept?(node) click to toggle source
# File lib/chake/config_manager/shell.rb, line 16
def self.accept?(node)
  node.data.key?('shell')
end

Public Instance Methods

apply(config) click to toggle source
# File lib/chake/config_manager/shell.rb, line 12
def apply(config)
  node.run_as_root sh(config)
end
converge() click to toggle 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

sh(command) click to toggle 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