mirror of
https://github.com/plashchynski/crono.git
synced 2026-03-29 05:42:02 +02:00
Add logfile option
This commit is contained in:
@@ -42,9 +42,13 @@ module Crono
|
||||
OptionParser.new do |opts|
|
||||
opts.banner = "Usage: crono [options]"
|
||||
|
||||
opts.on("-c", "--cronotab cronotab.rb", "Cronotab file (Default: #{Crono.config.cronotab})") do |cronotab|
|
||||
opts.on("-C", "--cronotab PATH", "Path to cronotab file (Default: #{Crono.config.cronotab})") do |cronotab|
|
||||
Crono.config.cronotab = cronotab
|
||||
end
|
||||
|
||||
opts.on("-L", "--logfile PATH", "Path to writable logfile (Default: #{Crono.config.logfile})") do |logfile|
|
||||
Crono.config.logfile = logfile
|
||||
end
|
||||
end.parse!(argv)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
module Crono
|
||||
class Config
|
||||
CRONOTAB = "config/cronotab.rb"
|
||||
include Singleton
|
||||
CRONOTAB = "config/cronotab.rb"
|
||||
LOGFILE = "log/crono.rb"
|
||||
|
||||
attr_accessor :schedule
|
||||
attr_accessor :cronotab
|
||||
attr_accessor :logfile
|
||||
|
||||
def initialize
|
||||
self.schedule = Schedule.new
|
||||
self.cronotab = CRONOTAB
|
||||
self.logfile = LOGFILE
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
2
lib/crono/logging.rb
Normal file
2
lib/crono/logging.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Crono
|
||||
end
|
||||
Reference in New Issue
Block a user