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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e93d531ffc08ac10c4f846f4f496b14d85be346d
4
- data.tar.gz: 08c4381481901dc79ad5d9b5a17ff2d15637452a
3
+ metadata.gz: 00be02ca15ca7ce27f2374ed1201e231152fccca
4
+ data.tar.gz: feafd3324de2c150e663b2cf1f8627eb2f2d2d6a
5
5
  SHA512:
6
- metadata.gz: 7b4b63e9188f52e9a7aef367f701cf90639c0a3e7b5e84dc2cd4c90715b6c6e54d6ae8bf616c39672b79fb0fc459d7284b0875578b02b605fddf9ec2f878be68
7
- data.tar.gz: 65dadadb4fe19f0dca933d0f14aa2283537288ab318acfee622454651c3ddc9eb4c1ee22abd9c8cb02d7686fea7a2497f0c46f183fc56c6a3edbb05fada1de1d
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
- TF = "%Y-%m-%d %H:%M"
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(TF) + '] DynarexCron started'
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
- puts eval(s)
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
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-09 00:00:00.000000000 Z
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