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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b399811476c1f91e12fbfb070f5fc999590bfe31
4
- data.tar.gz: ff2f614db99a2beaaec82e61b86d61b3a7b1225b
3
+ metadata.gz: 3133830be2fc1faa4cda6d4b922a1d044e9fcfee
4
+ data.tar.gz: eefd04067e8bc55452dd311d1130a03ce7840105
5
5
  SHA512:
6
- metadata.gz: 578176b86c1916104e97c742bc0282143c9f9b24e0f75f33792e3363a8868f8e5a26d9438064149bc8c26c51f3a5f65c5b191dd61b81c5cebe5e23469275f226
7
- data.tar.gz: ab92aeb414777e9054439223fc9fda9ec94136339e82c0b25c929899ea584d222e859de354c358052cd08c290a6868b0c1cb48f279428c57208e3c4e578d3e69
6
+ metadata.gz: 759f9aca0e2ac2678b468b60df96d40617cfdb0f969ba7d003bc87114580eba97d062af8d09b5fe39e2c30f3a888614a3063a2a7d558c49f3e2fd15624337a1c
7
+ data.tar.gz: bad67edc4b6137c5a7d4d420d841597f59ffca43ffcab2c8545683df736e6143f3a48ead80ca577b22679f0c9c5cbc51cfeb9d99f0b6b42295843d606ead8c87
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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
- @entries.delete @entries.find {|x| x[:job] == h[:job]}
41
- @entries << h
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 || @entries
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] : h[:date] + ' ' \
71
- + h[:recurring].to_s
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynarex-events
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file