Class: EcoRake::Lib::Export::Payload

Inherits:
BaseTask show all
Defined in:
lib/eco-rake/lib/export/payload.rb

Constant Summary collapse

FORWARDED_OPTIONS =
%i[csv txt col_sep simulate no_email notify].freeze
FORWARD_RULES =
{
  enviro:    ->(enviro) { "-#{enviro}"      },
  space:     ->(space)  { "-space #{space}" },
  simulate:  '-simulate',
  no_email:  '-no-email',
  notify:    '-notify',
  csv:       '-csv',
  txt:       '-txt',
  col_sep:   ->(sep)  { "-col-sep #{sep}"     },
  multi_sep: ->(sep)  { "-multi-sep #{sep}"   },
  full:      ->(full) { full ? nil : '-delta' },
  asat:      ->(asat) { "-asatdate #{asat}"   }
}.freeze

Constants inherited from EcoRake

VERSION

Instance Method Summary collapse

Instance Method Details

#task(*_args) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
# File 'lib/eco-rake/lib/export/payload.rb', line 66

def task(*_args)
  sh_exit_on_fail people_get_command unless options[:no_get]

  sh_chain(commands) do |ok, res|
    next if ok

    error_notify!(res)
  end

  success_notify
end