Class: Epi::Cli::Commands::Job
- Inherits:
-
Epi::Cli::Command
- Object
- Epi::Cli::Command
- Epi::Cli::Commands::Job
- Defined in:
- lib/epi/cli/commands/job.rb
Instance Attribute Summary
Attributes inherited from Epi::Cli::Command
Instance Method Summary collapse
Methods inherited from Epi::Cli::Command
Constructor Details
This class inherits a constructor from Epi::Cli::Command
Instance Method Details
#run ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/epi/cli/commands/job.rb', line 6 def run id = args.shift raise Exceptions::Fatal, 'No job ID given' if id.nil? || id.empty? instruction = args.join(' ').strip raise Exceptions::Fatal, 'No instruction given' if instruction.empty? raise Exceptions::Fatal, 'Invalid instruction' unless instruction =~ /^((\d+ )?(more|less)|\d+|pause|resume|reset|max|min|restart)$/ Epi::Daemon.send job: {id: id, instruction: instruction} end |