dynarex_cron 0.1.4 → 0.1.5
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 +7 -5
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00be02ca15ca7ce27f2374ed1201e231152fccca
|
4
|
+
data.tar.gz: feafd3324de2c150e663b2cf1f8627eb2f2d2d6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1777b57ed50634b7b252234e2cff6de60f2fdad6bc0c221544887b677eecb633e4586c6894e0bb34ceea3e9868d38a2aa27dd46ee658b8ce5bf52b2126cefac5
|
7
|
+
data.tar.gz: 3dee3dfe8977175feac49e7a587d64a708ad05e04ef0049bec7826c089a988f783191aa7e4daa93b302d8c60377267edf99c6e1e46b77680fb7787eb2c9ae3cc
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/dynarex_cron.rb
CHANGED
@@ -7,24 +7,26 @@ require 'chronic_cron'
|
|
7
7
|
require 'simplepubsub'
|
8
8
|
require 'rscript'
|
9
9
|
|
10
|
-
|
10
|
+
DF = "%Y-%m-%d %H:%M"
|
11
11
|
|
12
12
|
class DynarexCron
|
13
13
|
|
14
14
|
def initialize(dynarex_file, sps_address=nil)
|
15
15
|
@dynarex = Dynarex.new dynarex_file
|
16
|
-
@dynarex.to_h.each {|h| h[:cron] = ChronicCron.new(h[:expression]) }
|
16
|
+
@dynarex.to_h.each {|h| puts 'h : ' + h.inspect; h[:cron] = ChronicCron.new(h[:expression]) }
|
17
17
|
@sps_address = sps_address
|
18
18
|
end
|
19
19
|
|
20
20
|
def start
|
21
|
-
puts '[' + Time.now.strftime(
|
21
|
+
puts '[' + Time.now.strftime(DF) + '] DynarexCron started'
|
22
22
|
while true
|
23
23
|
#puts Time.now.inspect
|
24
24
|
@dynarex.to_h.each do |h|
|
25
25
|
if h[:cron].to_time.strftime(TF) == Time.now.strftime(TF) then
|
26
26
|
Thread.new { run(h[:job]) }
|
27
|
-
h[:cron].next
|
27
|
+
t = h[:cron].next
|
28
|
+
s2 = "next run time for job %s is %s" % [h[:job], t.strftime(TF)]
|
29
|
+
puts s2
|
28
30
|
end
|
29
31
|
end
|
30
32
|
sleep 60 # wait for 60 seconds
|
@@ -56,7 +58,7 @@ class DynarexCron
|
|
56
58
|
open(s, 'UserAgent' => 'DynarexCron v0.1')
|
57
59
|
|
58
60
|
else
|
59
|
-
|
61
|
+
eval(s)
|
60
62
|
end
|
61
63
|
|
62
64
|
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.1.
|
4
|
+
version: 0.1.5
|
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-07-
|
34
|
+
date: 2013-07-11 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dynarex
|
metadata.gz.sig
CHANGED
Binary file
|