dynarex_cron 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/dynarex_cron.rb +12 -4
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f0b6db6fcf13afdfe2cc863b594a939ae1cf7d4
|
4
|
+
data.tar.gz: cbe99ac332b168b09879a2d4681b9ab10a63ed32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04502c1ac5da8123f9910dc20d484245499309167ab5cd546b5554a41134dd9d6730ac4255150d019864212f0ff0f44e9efb41e46438a6582f2783bfe94afc26
|
7
|
+
data.tar.gz: 7bf86d7e07c569c6633710a24752d89a9b4136be85bbddc886822b197d12883060a72dd16854f9626e533335349e5dfbe785e83b83c5fa47a8d4e02e0d7257ea
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/dynarex_cron.rb
CHANGED
@@ -14,7 +14,8 @@ class DynarexCron
|
|
14
14
|
|
15
15
|
def initialize(dynarex_file=nil, options={})
|
16
16
|
|
17
|
-
opt = {sps_address: nil, drb_server: false}.merge options
|
17
|
+
opt = {sps_address: nil, drb_server: false, log: nil}.merge options
|
18
|
+
@logger = Logger.new(opt[:log],'weekly') if opt[:log]
|
18
19
|
|
19
20
|
@cron_entries, @cron_events = [], []
|
20
21
|
|
@@ -81,7 +82,13 @@ class DynarexCron
|
|
81
82
|
if h[:cron].to_time.strftime(DF) == Time.now.strftime(DF) then
|
82
83
|
|
83
84
|
Thread.new { run(h[:job]) }
|
84
|
-
|
85
|
+
begin
|
86
|
+
h[:cron].next # advances the time
|
87
|
+
rescue
|
88
|
+
|
89
|
+
@logger.debug h.inspect ' : ' + ($!) if @logger
|
90
|
+
end
|
91
|
+
|
85
92
|
end
|
86
93
|
end
|
87
94
|
end
|
@@ -167,12 +174,13 @@ class DynarexEvents < DynarexCron
|
|
167
174
|
|
168
175
|
@entries.inject([]) do |r,h|
|
169
176
|
|
170
|
-
h[:cron] = ChronicCron.new(h[:date]
|
177
|
+
h[:cron] = ChronicCron.new(h[:date])
|
171
178
|
h[:job] = 'pub event: ' + h[:title]
|
172
179
|
|
173
180
|
if h[:reminder].length > 0 then
|
174
181
|
rmndr = {}
|
175
|
-
rmndr[:cron] = ChronicCron.new((Chronic.parse(h[:date]) -
|
182
|
+
rmndr[:cron] = ChronicCron.new((Chronic.parse(h[:date]) -
|
183
|
+
ChronicDuration.parse(h[:reminder])).to_s)
|
176
184
|
rmndr[:job] = 'pub event: reminder ' + h[:title]
|
177
185
|
r << rmndr
|
178
186
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynarex_cron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
y6cNz+NnybgoQfG28NcwV1e/31NTJk5VqdKHKnTfPcp/y35T9YoElNn5cSs93qc5
|
32
32
|
U5VVkvsVQudaZw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2013-08-
|
34
|
+
date: 2013-08-12 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dynarex
|
metadata.gz.sig
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
@�_�7�Pu����C�O"���eգڴ�b��J���[~�5��rt��=�4^�3Rdr�<��S��>w�k�<҅�yAՃ�;���U[hp%*l�sz"F!I.9T
|
2
|
+
uZZ(�b�N�rD~kG�jl`Й
|
3
|
+
�/�^�X�i�1
|