dynarex-events 0.1.6 → 0.1.7
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-events.rb +8 -6
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: 3133830be2fc1faa4cda6d4b922a1d044e9fcfee
|
4
|
+
data.tar.gz: eefd04067e8bc55452dd311d1130a03ce7840105
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 759f9aca0e2ac2678b468b60df96d40617cfdb0f969ba7d003bc87114580eba97d062af8d09b5fe39e2c30f3a888614a3063a2a7d558c49f3e2fd15624337a1c
|
7
|
+
data.tar.gz: bad67edc4b6137c5a7d4d420d841597f59ffca43ffcab2c8545683df736e6143f3a48ead80ca577b22679f0c9c5cbc51cfeb9d99f0b6b42295843d606ead8c87
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/dynarex-events.rb
CHANGED
@@ -15,7 +15,7 @@ class DynarexEvents < DynarexCron
|
|
15
15
|
|
16
16
|
opt = {sps_address: nil, drb_server: nil}.merge options
|
17
17
|
|
18
|
-
@entries, @cron_events = [], []
|
18
|
+
@entries, @other_entries, @cron_events = [], [], []
|
19
19
|
|
20
20
|
@dynarex_file = dynarex_file
|
21
21
|
load_events()
|
@@ -37,14 +37,15 @@ class DynarexEvents < DynarexCron
|
|
37
37
|
|
38
38
|
def add_entry(h)
|
39
39
|
# if the entry already exists delete it
|
40
|
-
@
|
41
|
-
@
|
40
|
+
@other_entries.delete @other_entries.find {|x| x[:job] == h[:job]}
|
41
|
+
@other_entries << h
|
42
42
|
end
|
43
43
|
|
44
44
|
def load_events()
|
45
45
|
|
46
46
|
dynarex = Dynarex.new @dynarex_file
|
47
|
-
@entries = dynarex.to_h || @
|
47
|
+
@entries = (dynarex.to_h || []) + @other_entries
|
48
|
+
|
48
49
|
@cron_events = self.to_a if @entries
|
49
50
|
'events loaded and refreshed'
|
50
51
|
end
|
@@ -67,8 +68,9 @@ class DynarexEvents < DynarexCron
|
|
67
68
|
|
68
69
|
@entries.inject([]) do |r,h|
|
69
70
|
|
70
|
-
s = h[:expression].length > 0 ? h[:expression] :
|
71
|
-
|
71
|
+
s = h[:expression].to_s.length > 0 ? h[:expression] :
|
72
|
+
h[:date] + ' ' + h[:recurring].to_s
|
73
|
+
|
72
74
|
h[:cron] = ChronicCron.new(s)
|
73
75
|
h[:job] ||= 'pub event: ' + h[:title]
|
74
76
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|