lib/paperclip/helpers.rb
# The run method takes the name of a binary to run, the arguments to that binary
# and some options:
#
#   :command_path -> A $PATH-like variable that defines where to look for the binary
#                    on the filesystem. Colon-separated, just like $PATH.
#
#   :expected_outcodes -> An array of integers that defines the expected exit codes
#                         of the binary. Defaults to [0].
#
#   :log_command -> Log the command being run when set to true (defaults to true).
#                   This will only log if logging in general is set to true as well.
#
#   :swallow_stderr -> Set to true if you don't care what happens on STDERR.
#
The run method takes the name of a binary to run, the arguments to that binary
and some options.

:command_path -> A $PATH-like variable that defines where to look for the binary
on the filesystem. Colon-separated, just like $PATH.

:expected_outcodes -> An array of integers that defines the expected exit codes
of the binary. Defaults to [0].

:log_command -> Log the command being run when set to true (defaults to true).
This will only log if logging in general is set to true as well.

:swallow_stderr -> Set to true if you don't care what happens on STDERR.
The run method takes the name of a binary to run the arguments to that binary and some options . : command_path - > A $PATH - like variable that defines where to look for the binary on the filesystem . Colon - separated just like $PATH . : expected_outcodes - > An array of integers that defines the expected exit codes of the binary . Defaults to [ 0 ] . : log_command - > Log the command being run when set to true ( defaults to true ) . This will only log if logging in general is set to true as well . : swallow_stderr - > Set to true if you don ' t care what happens on STDERR .
def run(cmd, arguments = "", interpolation_values = {}, local_options = {})
      command_path = options[:command_path]
      Cocaine::CommandLine.path = [Cocaine::CommandLine.path, command_path].flatten.compact.uniq
      if logging? && (options[:log_command] || local_options[:log_command])
        local_options = local_options.merge(:logger => logger)
      end
      Cocaine::CommandLine.new(cmd, arguments, local_options).run(interpolation_values)
    end
def run ( cmd , arguments = "" , interpolation_values = { } , local_options = { } ) command_path = options [ :command_path ] Cocaine :: CommandLine . path = [ Cocaine :: CommandLine . path , command_path ] . flatten . compact . uniq if logging? && ( options [ :log_command ] || local_options [ :log_command ] ) local_options = local_options . merge ( :logger => logger ) end Cocaine :: CommandLine . new ( cmd , arguments , local_options ) . run ( interpolation_values ) end
The run method takes the name of a binary to run, the arguments to that binary
and some options:
The run method takes the name of a binary to run the arguments to that binary and some options :
cmd
<not_specific>
arguments
<not_specific>
interpolation_values
<not_specific>
local_options
<not_specific>