chronic_cron 0.2.13 → 0.2.14
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/chronic_cron.rb +11 -3
- metadata +2 -2
- 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: 2905fbb74f2751ec5e4c11dbd7252c3d8cfa18aa
|
4
|
+
data.tar.gz: 7cb2895a989f2b69e32d4fb09a9879d09cd900fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec977ff378adcc1d2d58f2715422188b4e59e9e3472e5ccc8389c4eaef697f875f8ecab61a18cae5a153a171db91080d61286c5acf50cd9a595a8ccfdeae656b
|
7
|
+
data.tar.gz: 3a15e52e2938834d2f51baace5486ebe54846b343587c1af62b581a5ac609271eb37ca48c1b420645fa56854e0b7f3572ad856b17c4bea5d2dc2a4bc9d08f796
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/chronic_cron.rb
CHANGED
@@ -44,11 +44,18 @@ class ChronicCron
|
|
44
44
|
end
|
45
45
|
|
46
46
|
# e.g. 10:15am every day
|
47
|
-
get /(\d{1,2}):(\d{1,2})([ap]m)
|
47
|
+
get /(\d{1,2}):(\d{1,2})([ap]m)?\s+every day/ do |raw_hrs, mins, meridiem|
|
48
48
|
hrs = meridiem == 'pm' ? raw_hrs.to_i + 12 : raw_hrs
|
49
49
|
"%s %s * * *" % [mins, hrs]
|
50
50
|
end
|
51
51
|
|
52
|
+
# e.g. at 7:30am Monday to Friday
|
53
|
+
get /(\d{1,2}):(\d{1,2})([ap]m)?\s+(\w+) to (\w+)/ do
|
54
|
+
|raw_hrs, mins, meridiem, wday1, wday2|
|
55
|
+
hrs = meridiem == 'pm' ? raw_hrs.to_i + 12 : raw_hrs
|
56
|
+
"%s %s * * %s-%s" % [mins, hrs , wday1, wday2]
|
57
|
+
end
|
58
|
+
|
52
59
|
# e.g. at 11:00 and 16:00 on every day
|
53
60
|
get /(\d{1,2}):(\d{1,2}) and (\d{1,2}):\d{1,2} (?:on )?every day/ do
|
54
61
|
"%s %s,%s * * *" % params[:captures].values_at(1,0,2)
|
@@ -63,7 +70,7 @@ class ChronicCron
|
|
63
70
|
get('annually') {'0 0 1 1 *'}
|
64
71
|
|
65
72
|
# e.g. at 10:30pm on every Monday
|
66
|
-
get /(\d{1,2}):(\d{1,2})([ap]m)
|
73
|
+
get /(\d{1,2}):(\d{1,2})([ap]m)?\s+(?:on )?every (\w+)/ do
|
67
74
|
|raw_hrs, mins, meridiem, wday|
|
68
75
|
hrs = meridiem == 'pm' ? raw_hrs.to_i + 12 : raw_hrs
|
69
76
|
"%s %s * * %s" % [mins, hrs , wday]
|
@@ -91,8 +98,9 @@ class ChronicCron
|
|
91
98
|
)
|
92
99
|
"%s %s %s %s *" % TimeToday.future.to_a[1..4]
|
93
100
|
end
|
101
|
+
|
94
102
|
end
|
95
103
|
|
96
104
|
alias find_expression run_route
|
97
105
|
|
98
|
-
end
|
106
|
+
end
|
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.2.
|
4
|
+
version: 0.2.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
aYYwh4InyS/QZr4LG0nh0TuYVP5vwm1cCSlLlo4dlv7bl7Q4y815j70z8O4oUrT8
|
30
30
|
5oSIzmlVDEDmwAibYqdf+aHqmum1mkYW
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2013-07-
|
32
|
+
date: 2013-07-11 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: app-routes
|
metadata.gz.sig
CHANGED
Binary file
|