mirror of
https://github.com/plashchynski/crono.git
synced 2026-04-09 19:03:44 +02:00
22 lines
531 B
Ruby
22 lines
531 B
Ruby
module Crono
|
|
# Crono::Config stores Crono configuration
|
|
class Config
|
|
CRONOTAB = 'config/cronotab.rb'
|
|
LOGFILE = 'log/crono.log'
|
|
PIDFILE = 'tmp/pids/crono.pid'
|
|
|
|
attr_accessor :cronotab, :logfile, :pidfile, :daemonize, :environment
|
|
|
|
def initialize
|
|
self.cronotab = CRONOTAB
|
|
self.logfile = LOGFILE
|
|
self.daemonize = false
|
|
self.environment = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
|
|
end
|
|
|
|
def pidfile
|
|
@pidfile || (daemonize ? PIDFILE : nil)
|
|
end
|
|
end
|
|
end
|