Module: Gat::Action

Defined in:
lib/gat/action/base.rb,
lib/gat/action/ruby_method.rb,
lib/gat/action/shell_command.rb,
lib/gatgets/dar_backup/dar_backup.rb

Overview

Gat::Action::Base

Action are pieces of operations. Actions are the objetives of dependences Actions have the next config options at YML definition

<action_name> *must be uniq*

type: <shell_command> || <ruby_method>
  Type of the action. It can be
    - shell_command:  Action will execute a shell command
    - ruby_method: Action will call a ruby_method called by action.name
flags: [ <action flags> ]
  Conditional flags have to been passed to execute action. Action is skipped if only one flag failed
  Flags can be marked as negative. For example, [ '!file_doesnt_exist' ]. In this case, flags must be marked as false
  to result in action execution

 syntax: "<shell_command_syntax">
   Only in Shell Commands types, syntax is the command line form to be executed by Ruby Terminal.

 multiple: ["<n multiple parameters>"]
   Only in shell commands types.
   If multiple isnt empty, Action will interprete multiple parameters as multiple values. That means, that gat expect

that multiple paramters return an array of values. Gat::Action will loop and execute each shell_command with these parameters substitions

  For example, that is usefull to exec one command peer each File in one Dir.

onfail: "<continue> || <abort>"

What happens is action end with non 0 status

onfail_message: "<onfail_message>"

Custom message to be logged at error

onfail_callback: "<on_fail_callback>"
  Custom ruby method that is executed if action fails

Defined Under Namespace

Classes: Base, RubyMethod, ShellCommand, ShellCommandChild