class Pantograph::Actions::ShAction

Public Class Methods

authors() click to toggle source
# File pantograph/lib/pantograph/actions/sh.rb, line 51
def self.authors
  ["KrauseFx"]
end
available_options() click to toggle source
# File pantograph/lib/pantograph/actions/sh.rb, line 23
def self.available_options
  [
    PantographCore::ConfigItem.new(key: :command,
                                   description: 'Shell command to be executed',
                                   optional: false,
                                   type: String),
    PantographCore::ConfigItem.new(key: :log,
                                   description: 'Determines whether pantograph should print out the executed command itself and output of the executed command. If command line option --troubleshoot is used, then it overrides this option to true',
                                   optional: true,
                                   is_string: false,
                                   default_value: true),
    PantographCore::ConfigItem.new(key: :error_callback,
                                   description: 'A callback invoked with the command output if there is a non-zero exit status',
                                   optional: true,
                                   is_string: false,
                                   type: :string_callback,
                                   default_value: nil)
  ]
end
category() click to toggle source
# File pantograph/lib/pantograph/actions/sh.rb, line 66
def self.category
  :misc
end
description() click to toggle source

@!group Documentation

# File pantograph/lib/pantograph/actions/sh.rb, line 12
def self.description
  'Runs a shell command'
end
details() click to toggle source
# File pantograph/lib/pantograph/actions/sh.rb, line 16
def self.details
  [
    'Allows running an arbitrary shell command.',
    'Be aware of a specific behavior of `sh` action with regard to the working directory. For details, refer to [Advanced](https://urbanquakers.github.io/pantograph/advanced/#directory-behavior).'
  ].join("\n")
end
example_code() click to toggle source
# File pantograph/lib/pantograph/actions/sh.rb, line 59
def self.example_code
  [
    'sh("ls")',
    'sh("git", "commit", "-m", "My message")'
  ]
end
is_supported?(platform) click to toggle source
# File pantograph/lib/pantograph/actions/sh.rb, line 55
def self.is_supported?(platform)
  true
end
return_type() click to toggle source
# File pantograph/lib/pantograph/actions/sh.rb, line 47
def self.return_type
  :string
end
return_value() click to toggle source
# File pantograph/lib/pantograph/actions/sh.rb, line 43
def self.return_value
  'Outputs the string and executes it. When running in tests, it returns the actual command instead of executing it'
end
run(params) click to toggle source
# File pantograph/lib/pantograph/actions/sh.rb, line 4
def self.run(params)
  # this is implemented in the sh_helper.rb
end