cron_format 0.3.4 → 0.3.5
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/cron_format.rb +19 -2
- metadata +23 -24
- 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: 770687981ae1603cae0ae5742d3361dc96b5a92e
|
4
|
+
data.tar.gz: 159e4a8dc03bafb524c3daf488c8cf95e5c5ddca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6a96846405c3a0fb418f361d806fcb1535a7cee7682e58014937e83e36ee98523456178bd2386b16d0ec97619b7ec6a0273a04b02e33d2b076e282449bc1633
|
7
|
+
data.tar.gz: 36115594470e04363446f08bdc91516a6f3bce814500f6442ce8879eabc44ca6de8b6ff63cc66ddb930ba1e742aead7bebb2efddea3bc0749a29e8adec6121aa
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/cron_format.rb
CHANGED
@@ -22,6 +22,23 @@ class CronFormat
|
|
22
22
|
parse()
|
23
23
|
end
|
24
24
|
|
25
|
+
# supply a Time object. Modifying the date can be helpful when
|
26
|
+
# triggering a day before an actual expression date e.g. the day
|
27
|
+
# before the last sunday in March (British summer time).
|
28
|
+
#
|
29
|
+
def adjust_date(d)
|
30
|
+
|
31
|
+
@to_time = d
|
32
|
+
m, h, dd, mm, yy = @to_expression.split
|
33
|
+
|
34
|
+
day = dd =~ /^\d+$/ ? d.day : dd
|
35
|
+
month = mm =~ /^\d+$/ ? d.month : mm
|
36
|
+
year = yy =~ /^\d+$/ ? d.year : yy
|
37
|
+
|
38
|
+
@to_expression = [m, h, day, month, year].join(' ')
|
39
|
+
|
40
|
+
end
|
41
|
+
|
25
42
|
def next()
|
26
43
|
|
27
44
|
nudge() #unless @cron_string =~ %r{/}
|
@@ -216,11 +233,11 @@ class CronFormat
|
|
216
233
|
t = Time.parse(TF % d.reverse)
|
217
234
|
# if there is a defined weekday, increment a day at
|
218
235
|
# a time to match that weekday
|
219
|
-
if wday then
|
236
|
+
if wday and wday != t.wday then
|
220
237
|
|
221
238
|
t = Time.parse(TF % d.reverse)
|
222
239
|
|
223
|
-
if repeaters[4]
|
240
|
+
if repeaters[4] then
|
224
241
|
t += repeaters[4].to_i * WEEK while t < @to_time
|
225
242
|
else
|
226
243
|
d[2], d[3] = @to_time.to_a.values_at(3,4).map(&:to_s)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cron_format
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,31 +10,30 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
7X96Zq3xSMq7wQ==
|
13
|
+
MIIDXjCCAkagAwIBAgIBATANBgkqhkiG9w0BAQUFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTgwMzEzMjIzNDEyWhcN
|
15
|
+
MTkwMzEzMjIzNDEyWjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cn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5li/rMvu6b9ZdRlzg6dA1S40k3ibt6RI6ht4T
|
31
|
+
lIM=
|
33
32
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
33
|
+
date: 2018-03-13 00:00:00.000000000 Z
|
35
34
|
dependencies: []
|
36
35
|
description:
|
37
|
-
email: james@
|
36
|
+
email: james@jamesrobertson.eu
|
38
37
|
executables: []
|
39
38
|
extensions: []
|
40
39
|
extra_rdoc_files: []
|
@@ -60,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
59
|
version: '0'
|
61
60
|
requirements: []
|
62
61
|
rubyforge_project:
|
63
|
-
rubygems_version: 2.
|
62
|
+
rubygems_version: 2.6.13
|
64
63
|
signing_key:
|
65
64
|
specification_version: 4
|
66
65
|
summary: cron_format
|
metadata.gz.sig
CHANGED
Binary file
|