mirror of
https://github.com/plashchynski/crono.git
synced 2026-07-14 08:42:52 +02:00
Add pidfile option
This commit is contained in:
@@ -2,14 +2,17 @@ module Crono
|
|||||||
class Config
|
class Config
|
||||||
CRONOTAB = "config/cronotab.rb"
|
CRONOTAB = "config/cronotab.rb"
|
||||||
LOGFILE = "log/crono.log"
|
LOGFILE = "log/crono.log"
|
||||||
|
PIDFILE = "tmp/pids/crono.pid"
|
||||||
|
|
||||||
attr_accessor :cronotab
|
attr_accessor :cronotab
|
||||||
attr_accessor :logfile
|
attr_accessor :logfile
|
||||||
|
attr_accessor :pidfile
|
||||||
attr_accessor :daemonize
|
attr_accessor :daemonize
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
self.cronotab = CRONOTAB
|
self.cronotab = CRONOTAB
|
||||||
self.logfile = LOGFILE
|
self.logfile = LOGFILE
|
||||||
|
self.pidfile = PIDFILE
|
||||||
self.daemonize = false
|
self.daemonize = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+2
-1
@@ -2,10 +2,11 @@ require "spec_helper"
|
|||||||
|
|
||||||
describe Crono::Config do
|
describe Crono::Config do
|
||||||
describe "#initialize" do
|
describe "#initialize" do
|
||||||
it "should initialize schedule" do
|
it "should initialize with default configuration options" do
|
||||||
@config = Crono::Config.new
|
@config = Crono::Config.new
|
||||||
expect(@config.cronotab).to be Crono::Config::CRONOTAB
|
expect(@config.cronotab).to be Crono::Config::CRONOTAB
|
||||||
expect(@config.logfile).to be Crono::Config::LOGFILE
|
expect(@config.logfile).to be Crono::Config::LOGFILE
|
||||||
|
expect(@config.pidfile).to be Crono::Config::PIDFILE
|
||||||
expect(@config.daemonize).to be false
|
expect(@config.daemonize).to be false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user