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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/chronic_cron.rb +22 -4
- metadata +25 -25
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a592752d6002e699c468d42d5bb44557ae37dd07269cbb9a242aeaaaa3705e7c
|
4
|
+
data.tar.gz: d65322901ada5081ad53d3a6bffc407dc5195142069766d05e2ff62a540c75b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c270f38875374250ab0281be21729fd21f3fc5d468a08989537cd32f1eb3575b5ca5e9bd7459da297b6995729456ff06fb8fd756dd19f662ededf3dedc50b66
|
7
|
+
data.tar.gz: debbbca0aed6c3edeeed46d071273c9bacabdb9ba191a79fea1d4b62ae36b1c80e1267ff6b1ba8062703de9004adafbcb6addb351494acb5fb0c8064ee0b2c8b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/chronic_cron.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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.
|
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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-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lckBqYW1lc3JvYmVydHNvbi5ldTAN
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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:
|
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.
|
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
|