Module: EacRubyBase0::JobsRunner

Defined in:
lib/eac_ruby_base0/jobs_runner.rb

Instance Method Summary collapse

Instance Method Details

#run_job(job) ⇒ Object



10
11
12
13
14
15
# File 'lib/eac_ruby_base0/jobs_runner.rb', line 10

def run_job(job)
  return unless run_job?(job)

  infom "Running job \"#{job}\"..."
  send(job)
end

#run_job?(job) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
20
# File 'lib/eac_ruby_base0/jobs_runner.rb', line 17

def run_job?(job)
  the_method = "run_#{job}?"
  respond_to?(the_method, true) ? send(the_method) : true
end

#run_jobs(*jobs) ⇒ Object



22
23
24
25
26
# File 'lib/eac_ruby_base0/jobs_runner.rb', line 22

def run_jobs(*jobs)
  jobs = setting_value(:jobs) if jobs.empty?
  jobs.each { |job| run_job(job) }
  success 'Done'
end