cron_format 0.3.4 → 0.3.5

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: ff50854da5d8f79c9b99fa047da6df86970e5d98
4
- data.tar.gz: 2885b3bf7ba3b9a2ab1509692421f6e453549b49
3
+ metadata.gz: 770687981ae1603cae0ae5742d3361dc96b5a92e
4
+ data.tar.gz: 159e4a8dc03bafb524c3daf488c8cf95e5c5ddca
5
5
  SHA512:
6
- metadata.gz: 525ea56e5f9e679771b312a55f187709ba35a0e1950cf5fd777ec9b166082eb884d54e26a108bead19104b84587c3230028de3f45090710f50bfa8e6c41202b7
7
- data.tar.gz: 5ba809520b47ab8d0b86e1031211a1b17350640306018e11d52bd7624e4caf29bc0b3824290f239c39066260f9ea48383837e994009becc3de15f709f7351420
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] and wday == t.wday then
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
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
- MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
- YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
- 8ixkARkWAmV1MB4XDTE2MTExMDE3MzczMloXDTE3MTExMDE3MzczMlowSDESMBAG
16
- A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
- EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
- ggEBAOrvtZ20zsEom4ClTrTBIfgLclsq381k7HD6kHO49DQ/sTb0DpesQ5FrE4pc
19
- NPDNGrTo4P0NvEJBTzdUdKMHYa7ULjHDwYutyd0A7KCk7oIqAW4hgIm1SQd9LtMo
20
- +6kLx87o0ZokQil2QOdIB0AbL5g0qMUwqpGzbWOZKcW2tJMOchelXwj7+7wUP91v
21
- 6duJjC4Q6omHT/BZQzCJKAbYDdQDWbA7nQFvOlJdM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mnqPYdWcrTx
18
+ khljN3zaqNX/vR5y+zIy7vXqy9M/0BPGVnEJHj8/Tn2NvXG/kfFXIcfHqKSxsvX7
19
+ go9CBM0aB3ZeueDgT6Sm5Nf5nwixgNSeQ6CSq6qrMDq7/5oDUJ5VxeyPsdhy9TJF
20
+ pjt5V93mDqgDq5SaYoEETtgqTpugtD8bUf3MSehMAG1TqdTpYrGZEewIfqIgXRxN
21
+ YG+4M8lI0S9a+OPrXNKlFOfvB1wlC+tRvYdgTdX2Qj7Eb0o17CnL4sR3WgcmAIYi
22
+ vU/XM/O4V/TWDq4NAgMBAAGjgYowgYcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
23
+ HQYDVR0OBBYEFBV/59mIpXOYt1x0MSWeLm6vy/ySMCYGA1UdEQQfMB2BG2dlbW1h
24
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTAmBgNVHRIEHzAdgRtnZW1tYXN0ZXJAamFt
25
+ ZXNyb2JlcnRzb24uZXUwDQYJKoZIhvcNAQEFBQADggEBABmqh5CsvL7K2KCHCLyX
26
+ YEuF5nVn+MsAJZj1mm6sd0sA5HkQ2lT+Xx5jwpxYLrOqV0qT5DmhaDQUkM6W7WLa
27
+ tIFEac2buOY83gIjRo14D1PRz2e8jH12ffYAxtm7bRTerzbxBqZm7xDTjuJnj1n8
28
+ 4eLJfD0Ck0i2f1z206DqwPyymN+uDH/kE5ewB9reHgUeXlFCeo8c2Su8egxJf8Ww
29
+ sZzkbSOjq5ekNiNAV7ACU+yp1AU2dWlpbCZt/1J6aOFI90nYVV1iKf3gRNgCT777
30
+ E0pbk0dRdBt0x5gnA8Q7lsQkyZT5li/rMvu6b9ZdRlzg6dA1S40k3ibt6RI6ht4T
31
+ lIM=
33
32
  -----END CERTIFICATE-----
34
- date: 2016-11-10 00:00:00.000000000 Z
33
+ date: 2018-03-13 00:00:00.000000000 Z
35
34
  dependencies: []
36
35
  description:
37
- email: james@r0bertson.co.uk
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.5.1
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