chrono 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/chrono/next_time.rb +13 -7
- data/lib/chrono/schedule.rb +8 -0
- data/lib/chrono/version.rb +1 -1
- data/spec/chrono/iterator_spec.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82628fe0ca33aeac8bd5b8f6d72d570a250e5636
|
4
|
+
data.tar.gz: 093720914965710dccca4dca1054616bc676e783
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bdc77b1029f70e80ccde05ac6c5a3f4fe84d8e39d34c1484cf1b56a84580b0234e0e01b9b1604937d705c4241940f953565f5ff436a193cfb26f930b7339751
|
7
|
+
data.tar.gz: ff6f91a205265f49e78e208ada8f87f1c61d881d52c0bd9b6786eab1732944d8f72ce3fe1825327eacfa10f62507ca36a2cb92c11fbe709b6867bd1c41d95830
|
data/CHANGELOG.md
CHANGED
data/lib/chrono/next_time.rb
CHANGED
@@ -27,8 +27,6 @@ module Chrono
|
|
27
27
|
carry_month
|
28
28
|
when !scheduled_in_this_day?
|
29
29
|
carry_day
|
30
|
-
when !scheduled_in_this_wday?
|
31
|
-
carry_day
|
32
30
|
when !scheduled_in_this_hour?
|
33
31
|
carry_hour
|
34
32
|
when !scheduled_in_this_minute?
|
@@ -54,11 +52,19 @@ module Chrono
|
|
54
52
|
end
|
55
53
|
|
56
54
|
def scheduled_in_this_day?
|
57
|
-
schedule.days
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
55
|
+
if schedule.days?
|
56
|
+
if schedule.wdays?
|
57
|
+
schedule.days.include?(time.day) || schedule.wdays.include?(time.wday)
|
58
|
+
else
|
59
|
+
schedule.days.include?(time.day)
|
60
|
+
end
|
61
|
+
else
|
62
|
+
if schedule.wdays?
|
63
|
+
schedule.wdays.include?(time.wday)
|
64
|
+
else
|
65
|
+
true
|
66
|
+
end
|
67
|
+
end
|
62
68
|
end
|
63
69
|
|
64
70
|
def scheduled_in_this_hour?
|
data/lib/chrono/schedule.rb
CHANGED
data/lib/chrono/version.rb
CHANGED
@@ -22,6 +22,8 @@ describe Chrono::Iterator do
|
|
22
22
|
"2000-01-04 00:00:00", "2000-01-04 00:01:00", "* * * * 2,3",
|
23
23
|
"2000-01-01 00:01:00", "2000-01-01 00:04:00", "1-20/3 * * * *",
|
24
24
|
"2000-01-01 00:20:00", "2000-01-01 01:01:00", "1-20/3 * * * *",
|
25
|
+
"2000-01-01 00:00:00", "2000-01-03 00:00:00", "0 0 1,15 * 1",
|
26
|
+
"2000-01-01 00:00:00", "2000-01-05 00:00:00", "0 0 5,15,25 * 5",
|
25
27
|
].each_slice(3) do |from, to, source|
|
26
28
|
it "ticks #{from} to #{to} by #{source}" do
|
27
29
|
now = Time.parse(from)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chrono
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|