chronic_cron 0.2.8 → 0.2.9
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 +13 -0
- metadata +1 -1
- 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: 726d8479ad06604da7703cf5bb9f359a8ab61062
|
4
|
+
data.tar.gz: 9672cb56eabf1b3a40f3031ec99b8461fc495df7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3e0ce2c2834887ab316efa042a1b5dfef0affafb106767c0bd198778a27ba77d4ab4824ef4d3f6aab3e62f19f4b9cc73737214f7e75b14161ff13f49c8630d9
|
7
|
+
data.tar.gz: 796a22895b045f38d9757dbaa73e7d2a83e8e7ab867bc3289ee99e0da9ea93e7529bedc18d771001cb001a3ead56f910aea7775469cddc44c6c971b298c97df9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/chronic_cron.rb
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
require 'app-routes'
|
6
6
|
require 'chronic'
|
7
7
|
require 'cron_format'
|
8
|
+
require 'timetoday'
|
8
9
|
|
9
10
|
|
10
11
|
class ChronicCron
|
@@ -77,6 +78,18 @@ class ChronicCron
|
|
77
78
|
# e.g. every 2 days
|
78
79
|
get(/every (\d{1,2}) days?/){|days| "* * */%s * *" % [days]}
|
79
80
|
get(/every day/){ "0 0 * * *"}
|
81
|
+
|
82
|
+
get /any\s?time today/ do
|
83
|
+
self.instance_eval %q(
|
84
|
+
def next()
|
85
|
+
t = TimeToday.any + DAY
|
86
|
+
@cf = CronFormat.new("%s %s %s %s *" % (t)
|
87
|
+
.to_a.values_at(1,2,3,4))
|
88
|
+
t
|
89
|
+
end
|
90
|
+
)
|
91
|
+
"%s %s %s %s *" % TimeToday.future.to_a.values_at(1,2,3,4)
|
92
|
+
end
|
80
93
|
|
81
94
|
end
|
82
95
|
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|