Refactor to remove global variables

This commit is contained in:
Dzmitry Plashchynski
2015-03-03 19:33:56 +02:00
parent 4c59804472
commit cbc33324cc
9 changed files with 33 additions and 50 deletions
-7
View File
@@ -1,23 +1,16 @@
module Crono
class Config
include Singleton
CRONOTAB = "config/cronotab.rb"
LOGFILE = "log/crono.rb"
attr_accessor :schedule
attr_accessor :cronotab
attr_accessor :logfile
attr_accessor :daemonize
def initialize
self.schedule = Schedule.new
self.cronotab = CRONOTAB
self.logfile = LOGFILE
self.daemonize = false
end
end
def self.config
Config.instance
end
end