cron_format 0.1.14 → 0.1.15
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 +18 -4
- metadata +24 -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: 414d4064981ad653741b80fce46e863167607379
|
4
|
+
data.tar.gz: 67023e8ba3f5ee0790307bcc1794cada00e85542
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41b84a6ab78e19bf48da04158fef9f1b1d12a8a699944757d8f64085a7552160cbeeb6e5479f7720dd9a6b73683a15a598c36ec8e62b66005569f5b888149993
|
7
|
+
data.tar.gz: 4b5d0578b5a212952b0267961a24a483e4b32c56ce9a1ed64e1b89fe72e2b7ba0eae347899179ad93910344730f623de9a650495eddd081c3bcc4234373f1461
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/cron_format.rb
CHANGED
@@ -22,7 +22,7 @@ class CronFormat
|
|
22
22
|
parse()
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
25
|
+
def next_date()
|
26
26
|
|
27
27
|
nudge() unless @cron_string =~ %r{/}
|
28
28
|
parse()
|
@@ -69,7 +69,18 @@ class CronFormat
|
|
69
69
|
|
70
70
|
raw_a = @cron_string.split
|
71
71
|
raw_a << '*' if raw_a.length <= 5 # add the year?
|
72
|
+
|
73
|
+
dayceiling = raw_a[2][/-(\d+)$/,1]
|
74
|
+
|
75
|
+
if dayceiling and dayceiling.to_i <= @to_time.day then
|
72
76
|
|
77
|
+
dt2 = @to_time.to_datetime
|
78
|
+
next_month = dt2.next_month.month
|
79
|
+
dt2 += 1 until dt2.month == next_month
|
80
|
+
|
81
|
+
@to_time = dt2.to_time
|
82
|
+
end
|
83
|
+
|
73
84
|
units = @to_time.to_a.values_at(1..4) + [nil, @to_time.year]
|
74
85
|
|
75
86
|
procs = {
|
@@ -109,6 +120,8 @@ class CronFormat
|
|
109
120
|
raw_units << v1
|
110
121
|
repeaters << v2
|
111
122
|
end
|
123
|
+
|
124
|
+
|
112
125
|
|
113
126
|
if raw_a[4] != '*' then
|
114
127
|
r = /(sun|mon|tues|wed|thurs|fri|satur|sun)(day)?|tue|thu|sat/i
|
@@ -121,7 +134,8 @@ class CronFormat
|
|
121
134
|
raw_units[4].gsub!(r,&to_i)
|
122
135
|
end
|
123
136
|
|
124
|
-
@to_expression = raw_a[0..4].join ' '
|
137
|
+
@to_expression = raw_a[0..4].join ' '
|
138
|
+
|
125
139
|
raw_date = raw_units.map.with_index {|x,i| dt[i].call(x) }
|
126
140
|
|
127
141
|
# expand the repeater
|
@@ -153,7 +167,6 @@ class CronFormat
|
|
153
167
|
|
154
168
|
next unless day_valid? d.reverse.take 3
|
155
169
|
t = Time.parse(TF % d.reverse)
|
156
|
-
|
157
170
|
# if there is a defined weekday, increment a day at
|
158
171
|
# a time to match that weekday
|
159
172
|
if wday and wday != t.wday then
|
@@ -182,6 +195,7 @@ class CronFormat
|
|
182
195
|
|
183
196
|
# starting from the biggest unit, attempt to increment that
|
184
197
|
# unit where it is equal to '*'
|
198
|
+
|
185
199
|
if t < @to_time then
|
186
200
|
|
187
201
|
if t.month < @to_time.month and raw_a[4] == '*' then
|
@@ -275,4 +289,4 @@ class CronFormat
|
|
275
289
|
end
|
276
290
|
end
|
277
291
|
|
278
|
-
end
|
292
|
+
end
|
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.1.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,28 +10,28 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
YXN0ZXIxHjAcBgoJkiaJk/
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
MIIDmDCCAoCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBJMRIwEAYDVQQDDAlnZW1t
|
14
|
+
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjETMBEGCgmSJomT
|
15
|
+
8ixkARkWA2V1XzAeFw0xNTAxMTQyMTI2NDdaFw0xNjAxMTQyMTI2NDdaMEkxEjAQ
|
16
|
+
BgNVBAMMCWdlbW1hc3RlcjEeMBwGCgmSJomT8ixkARkWDmphbWVzcm9iZXJ0c29u
|
17
|
+
MRMwEQYKCZImiZPyLGQBGRYDZXVfMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
|
18
|
+
CgKCAQEAr9xvXIQaNXIGdnLqaDHCEjb+8JPxElPK0kO7sz+DHXJgGr2gZ7Fpp9H/
|
19
|
+
7ps4nOysRBuAjZWXM6f2V20MVekpoknLkMqJb0MGkX+fipeioarVUUoDTmFBDFhb
|
20
|
+
zOD8Hwq4JOyOBpyD90xHBMBFve+ZRgwXRayAW3dlQEn3YsGukt91IJzJzG3B9ewq
|
21
|
+
QXyD27cOwuac+9E6wsbhsqLa0UjdHjMnQ2wKvZb28J8iIY5juNbz81CssuVmolH8
|
22
|
+
+B096ge0IkGIiAnyMrf9Uye7kzVixeJMxNHZU8/n/h5UFDyOBkVrZxjdmSHPLm+I
|
23
|
+
i+yg9/LrBBvBlzykrKgRc2U6B7McHQIDAQABo4GKMIGHMAkGA1UdEwQCMAAwCwYD
|
24
|
+
VR0PBAQDAgSwMB0GA1UdDgQWBBQYtwchW6cgSusk8+Q+iJpSpLU47DAmBgNVHREE
|
25
|
+
HzAdgRtnZW1tYXN0ZXJAamFtZXNyb2JlcnRzb24uZXUwJgYDVR0SBB8wHYEbZ2Vt
|
26
|
+
bWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MA0GCSqGSIb3DQEBBQUAA4IBAQAAvEHq
|
27
|
+
yXYlDk/eBMY5TEYYqJ1yC2ojqhPWte6XHiB2HM81FIWeVdttdn6okb30AEbR6q2f
|
28
|
+
5i4eAIJW7xGG3GNnDTvkd3/GzdrjgBhVkAuJwQyn9yow/uoxUOv8oQF/8xurum6V
|
29
|
+
PDf269Dp/SOaLlKW5CwJUPuEXJ5wTYM/HacwyxhrxTT4Lo9h4+sewKsJKZwmLdyJ
|
30
|
+
2qaxwo1jIFkqEkmoAO+0DdHSxt0oOaa69+O0RsBlDbbCXeK8jCApP8OEsTLnzove
|
31
|
+
MmJuAQVfTk9wZd03YN619a64hLGIvud4ASW7UVAW0B4U0PcmbhHvne07e11jt7j5
|
32
|
+
WwVcDIvT38Bo3hAt
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2015-01-14 00:00:00.000000000 Z
|
35
35
|
dependencies: []
|
36
36
|
description:
|
37
37
|
email: james@r0bertson.co.uk
|
@@ -52,7 +52,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
52
52
|
requirements:
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: 2.1.2
|
56
56
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - ">="
|
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
60
|
version: '0'
|
61
61
|
requirements: []
|
62
62
|
rubyforge_project:
|
63
|
-
rubygems_version: 2.
|
63
|
+
rubygems_version: 2.2.2
|
64
64
|
signing_key:
|
65
65
|
specification_version: 4
|
66
66
|
summary: cron_format
|
metadata.gz.sig
CHANGED
Binary file
|