dynarex_cron 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc5be501fb9bb3599ae8a2e86ab1450afafb48a1
4
- data.tar.gz: 9b968457ea66d490d8e8cbaf2208488ec841b32b
3
+ metadata.gz: 3f0b6db6fcf13afdfe2cc863b594a939ae1cf7d4
4
+ data.tar.gz: cbe99ac332b168b09879a2d4681b9ab10a63ed32
5
5
  SHA512:
6
- metadata.gz: f605c98b625ebad00f2fc80f21cb10dcde2079c13b1b76b21147d3ee6f6f197a6686995903f32ed6aea0766dcc9a0f4180a42263c92c120836a6efc3f0085e23
7
- data.tar.gz: 624759657be1df840824b33505f933accdeba1c6a94f0c5122ea2646f30dcd97b9036d7309f829f0520d790f3bac50011b3ac765c173422066333f186e84235f
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
- h[:cron].next # advances the time
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] + ' ' + h[:recurring])
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]) - ChronicDuration.parse(h[:reminder])).to_s)
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.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-06 00:00:00.000000000 Z
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
- �#��#��&@ԑWt��� I`�ٷf{Mٶ�xl*��3CM��ɵ4*����;���'�e��ĝ0[S�S�A��B IF�0��=<tˉ&�hF�B80��!���{\�/*n��sF]2��#�Fi���"���Mת(羣�0����R��>t|_Ɏ���:f#4����˰P4�$x3
2
- ���3�"n퀁ԃM���&ZI�?4{( �������v��t����k3q��8ֆ��$�8ػ���~׫Xc7
1
+ @�_7Pu����C�O"���eգڴ �b��J���[~�5��rt��=�4^�3Rdr�<��S��>wk�<҅�yAՃ�;���U[hp%*lsz"F!I.9T
2
+ u ZZ(�bNrD~kG� jl`Й
3
+ �/�^�X�i�1