chef

https://github.com/opscode/chef

Ruby

A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.

Chef::Mixin::Command#run_command

=== Parameters
args<Hash>: A number of required and optional arguments
  command<String>, <Array>: A complete command with options to execute or a command and options as an Array
  creates<String>: The absolute path to a file that prevents the command from running if it exists
  cwd<String>: Working directory to execute command in, defaults to Dir.tmpdir
  timeout<String>: How many seconds to wait for the command to execute before timing out
  returns<String>: The single exit value command is expected to return, otherwise causes an exception
  ignore_failure<Boolean>: Whether to raise an exception on failure, or just return the status
  output_on_failure<Boolean>: Return output in raised exception regardless of Log.level

  user<String>: The UID or user name of the user to execute the command as
  group<String>: The GID or group name of the group to execute the command as
  environment<Hash>: Pairs of environment variable names and their values to set before execution

=== Returns
Returns the exit status of args[:command]

Source | Google | Stack overflow

Edit

git clone [email protected]:opscode/chef.git

cd chef

open lib/chef/mixin/command.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Chef--Mixin--Command-run_command-for-pr


# Commit to git

git add lib/chef/mixin/command.rbgit commit -m "better docs for Chef::Mixin::Command#run_command"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Chef--Mixin--Command-run_command-for-pr

hub pull-request


# Celebrate!