chronic_cron 0.6.0 → 0.6.1

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
  SHA256:
3
- metadata.gz: d2aa1ee213393540b1f82770bdd33cfa00443a7d0c1d23571f46450cb51c51eb
4
- data.tar.gz: ab48a734ac469da60395a23e6c4587ff1af4026801e8dbe46e0b20c4ff88884e
3
+ metadata.gz: a592752d6002e699c468d42d5bb44557ae37dd07269cbb9a242aeaaaa3705e7c
4
+ data.tar.gz: d65322901ada5081ad53d3a6bffc407dc5195142069766d05e2ff62a540c75b6
5
5
  SHA512:
6
- metadata.gz: f5f34e35492918a0709184ba47b5a6dfb113bbd6f3e4f9b03bc7258c1805c261a45cc6f67f0af57e8d69743cdb574b0a4ff2047d3a3903b232d29768ea5cd06c
7
- data.tar.gz: bf88b16ff4fa13c1fa5efaa367821b1afabe194be4927cdda20c98daf8fbd23f5111f38f6d86164a406331a53958d1b6564e5f8b948ecf9a793450a676160f9b
6
+ metadata.gz: 8c270f38875374250ab0281be21729fd21f3fc5d468a08989537cd32f1eb3575b5ca5e9bd7459da297b6995729456ff06fb8fd756dd19f662ededf3dedc50b66
7
+ data.tar.gz: debbbca0aed6c3edeeed46d071273c9bacabdb9ba191a79fea1d4b62ae36b1c80e1267ff6b1ba8062703de9004adafbcb6addb351494acb5fb0c8064ee0b2c8b
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -14,6 +14,11 @@ class ChronicCron
14
14
 
15
15
  attr_reader :to_expression
16
16
 
17
+ def self.parse(s)
18
+ r = new(s)
19
+ r.valid? ? r : nil
20
+ end
21
+
17
22
  def initialize(s, now=Time.now, log: nil, debug: false)
18
23
 
19
24
  @now, @log, @debug = now, log, debug
@@ -36,6 +41,9 @@ class ChronicCron
36
41
 
37
42
  expression = find_expression(s.downcase\
38
43
  .sub(/^(?:on|at|from|starting)\s+/,''))
44
+ puts 'expression: ' + expression.inspect if @debug
45
+ return unless expression
46
+
39
47
  @cf = CronFormat.new(expression, now)
40
48
 
41
49
  end
@@ -45,9 +53,13 @@ class ChronicCron
45
53
 
46
54
  end
47
55
 
48
- def inspect()
49
- "#<ChronicCron:%s @to_expression=\"%s\", @to_time=\"%s\">" %
56
+ def inspect()
57
+ if @cf then
58
+ "#<ChronicCron:%s @to_expression=\"%s\", @to_time=\"%s\">" %
50
59
  [self.object_id, @to_expression, @cf.to_time]
60
+ else
61
+ "#<ChronicCron:%s >" % [self.object_id]
62
+ end
51
63
  end
52
64
 
53
65
  def next()
@@ -61,6 +73,10 @@ class ChronicCron
61
73
  def to_time()
62
74
  @cf.to_time
63
75
  end
76
+
77
+ def valid?
78
+ !@cf.nil?
79
+ end
64
80
 
65
81
  protected
66
82
 
@@ -428,8 +444,10 @@ class ChronicCron
428
444
 
429
445
  t = Chronic.parse(params[:input], :now => @now)
430
446
  puts 'ChronicCron#expressions 330' if @debug
431
-
432
- "%s %s %s %s * %s" % t.to_a.values_at(1,2,3,4,5)
447
+ puts 't: ' + t.inspect if @debug
448
+ if t then
449
+ "%s %s %s %s * %s" % t.to_a.values_at(1,2,3,4,5)
450
+ end
433
451
  end
434
452
 
435
453
  def in24hrs(raw_hrs, meridiem)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chronic_cron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -11,31 +11,31 @@ cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
14
- YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTkwOTEwMTczMDU2WhcN
15
- MjAwOTA5MTczMDU2WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
- cnRzb24vREM9ZXUwggGi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Q02XiDAWeE1CekdGItDmcotFwoCSuWai+Y4rg+JX1JaJQApPEM0tabWX83n
35
- djri2zyv3s3ucIBaOlC4bOZZiydDSAXx/S/SRGyvA1/ZKgR5h+zu6T2GKcusq7QA
36
- 2O89BwLoEmEP437kjQ6HjyqC
28
+ BgkqhkiG9w0BAQsFAAOCAYEAaUlfcuP6kAan4TbMfsLwTtpKDRgmPvX0xPCzZK9Y
29
+ C47NhmUz3j4M1Tfbz6R6PUXYS50KtZ83rk9lTbiSRJ3ZbR/Q+I8WCci1342SkMSX
30
+ R3M0TPq2gK5OB0Dv/oyYhzR2iXChWD88KH74NTFHPHBoJHtlHytBUYpMG/wtbKr3
31
+ ZLF/ga/SF8CuiJdoA160i0cn1Rb4rEmmkP9y/J5jO43CF/Zs6aDjDM8bYqslntX5
32
+ Sl0J29FpvFrEiRBj3k/NEJWeArhmqaDW/7kA4CBbWDB7lpmV98IiJ8HrEDQOn7lt
33
+ VdN1c4pVVB5CiS9JlmpbB1bALwq7NcM9MGIwGjjdBDOe2i2XjgWDCjfNrT7iqjUN
34
+ Gs7jYeqFD5zboPtQtb3SiWnAbJgeGF9ojFFCO2qUwZh1PuZbCEnC80ZbM7AmAxJ7
35
+ 5/R97FUsc8ka/0HRADqJU3kQxMvTx/YlBFjaiBqJ3XO/3ZBHwLPyIXVKEmbNT5Wz
36
+ p1yxSFG+W4RfwEZu4aKdGsuB
37
37
  -----END CERTIFICATE-----
38
- date: 2019-09-10 00:00:00.000000000 Z
38
+ date: 2020-11-06 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: app-routes
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  requirements: []
146
- rubygems_version: 3.0.1
146
+ rubygems_version: 3.0.3
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Converts a human-readable time (e.g. 10:15 daily) into a cron format (e,g,
metadata.gz.sig CHANGED
Binary file