Class: ForemanAdmin::DebugCommand

Inherits:
ExternalCommand show all
Defined in:
lib/foreman_admin/debug.rb

Constant Summary collapse

UPLOAD_RESPONSE =
'Archive has been uploaded'
NO_UPLOAD_RESPONSE =
'Skipping archive upload'

Instance Method Summary collapse

Methods inherited from ExternalCommand

#execute, #external_invocation, external_invocation

Methods inherited from Command

command_name, #command_name, description, #description, #execute

Instance Method Details

#external_commandObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/foreman_admin/debug.rb', line 43

def external_command
  args = []
  args << '-d' << "'#{directory}'" if directory
  args << '-g' unless generic?
  args << '-a' unless tarball?
  args << '-m' << max_lines if max_lines
  args << '-j' << "'#{filter_program}'" if filter_program
  args << '-p' if password_patterns?
  args << '-q' if quiet?
  args << '-v' if verbose?
  args << '-u' if upload?

  args.unshift(external_invocation)
  args.join(' ')
end