mirror of
https://github.com/plashchynski/crono.git
synced 2026-04-24 09:48:39 +02:00
CLI refactoring
This commit is contained in:
@@ -4,7 +4,7 @@ require 'optparse'
|
|||||||
module Crono
|
module Crono
|
||||||
mattr_accessor :scheduler
|
mattr_accessor :scheduler
|
||||||
|
|
||||||
# Crono::CLI - Main class for the crono daemon exacutable `bin/crono`
|
# Crono::CLI - The main class for the crono daemon exacutable `bin/crono`
|
||||||
class CLI
|
class CLI
|
||||||
include Singleton
|
include Singleton
|
||||||
include Logging
|
include Logging
|
||||||
@@ -62,7 +62,8 @@ module Crono
|
|||||||
|
|
||||||
logger.info 'Jobs:'
|
logger.info 'Jobs:'
|
||||||
Crono.scheduler.jobs.each do |job|
|
Crono.scheduler.jobs.each do |job|
|
||||||
logger.info %("#{job.performer}" with rule "#{job.period.description}" next time will perform at #{job.next})
|
logger.info "'#{job.performer}' with rule '#{job.period.description}'"\
|
||||||
|
"next time will perform at #{job.next}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -75,9 +76,8 @@ module Crono
|
|||||||
end
|
end
|
||||||
|
|
||||||
def check_jobs
|
def check_jobs
|
||||||
if Crono.scheduler.jobs.empty?
|
return if Crono.scheduler.jobs.present?
|
||||||
logger.error "You have no jobs defined in you cronotab file #{config.cronotab}"
|
logger.error "You have no jobs in you cronotab file #{config.cronotab}"
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def start_working_loop
|
def start_working_loop
|
||||||
|
|||||||
Reference in New Issue
Block a user