mirror of
https://github.com/plashchynski/crono.git
synced 2026-11-19 06:58:18 +01:00
Add Schedule
This commit is contained in:
1 parent
2c78115ce7
commit
518160d5d9
9 files changed
+38
-7
No files matched your search
@@ -4,5 +4,6 @@ end
|
||||
require "active_support/all"
|
||||
require "crono/version.rb"
|
||||
require "crono/period.rb"
|
||||
require "crono/schedule.rb"
|
||||
require "crono/config.rb"
|
||||
require "crono/performer_proxy.rb"
|
||||
+1
-1
@@ -7,7 +7,7 @@ module Crono
|
||||
def run
|
||||
load_rails
|
||||
print_banner
|
||||
# start_working_loop
|
||||
start_working_loop
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ module Crono
|
||||
attr_accessor :schedule
|
||||
|
||||
def initialize
|
||||
self.schedule = []
|
||||
self.schedule = Schedule.new
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -5,7 +5,7 @@ module Crono
|
||||
end
|
||||
|
||||
def every(period, *args)
|
||||
Config.instance.schedule += [@performer, Period.new(period, *args)]
|
||||
Config.instance.schedule.add(@performer, Period.new(period, *args))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
module Crono
|
||||
class Schedule
|
||||
def initialize
|
||||
@schedule = []
|
||||
end
|
||||
|
||||
def add(peformer, period)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user