uv-rays 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uv-rays/abstract_tokenizer.rb +1 -1
- data/lib/uv-rays/scheduler.rb +1 -1
- data/lib/uv-rays/scheduler/cron.rb +3 -2
- data/lib/uv-rays/tcp_server.rb +1 -1
- data/lib/uv-rays/version.rb +1 -1
- data/spec/scheduler_cron_spec.rb +18 -7
- 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: fb2605b3097dbf2b0ef3c8c17df39580ce036185
|
4
|
+
data.tar.gz: 6983fdeea7d991cda8740e3076a98fc07d479630
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40556df7599e68cdbed13ffe47bddf74c5fee91fdb296b8f5468d6f881e44b0e5db7490b5a6f150ab90f2025beb2ccc1c754df281a2c58d5af54ecb09077f75b
|
7
|
+
data.tar.gz: 990adf1a8c5282b80ab3c93a19ea8785519e436add68136a68b8891bfe0e6e9cd7676bfe243df9429b47711bb44109c37ed4f8bbcb17bcb849a5ef02f2065dc7
|
data/lib/uv-rays/scheduler.rb
CHANGED
@@ -76,7 +76,7 @@ module UV
|
|
76
76
|
|
77
77
|
raise ArgumentError.new(
|
78
78
|
"invalid cronline: '#{line}'"
|
79
|
-
) if es && es.find { |e| ! e.is_a?(
|
79
|
+
) if es && es.find { |e| ! e.is_a?(Integer) }
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
@@ -268,7 +268,7 @@ module UV
|
|
268
268
|
end
|
269
269
|
end
|
270
270
|
|
271
|
-
weekdays = weekdays.uniq if weekdays
|
271
|
+
weekdays = weekdays.uniq.sort if weekdays
|
272
272
|
|
273
273
|
[ weekdays, monthdays ]
|
274
274
|
end
|
@@ -283,6 +283,7 @@ module UV
|
|
283
283
|
"found duplicates in #{item.inspect}"
|
284
284
|
) if r.uniq.size < r.size
|
285
285
|
|
286
|
+
r = r.sort_by { |e| e.is_a?(String) ? 61 : e.to_i }
|
286
287
|
r
|
287
288
|
end
|
288
289
|
|
data/lib/uv-rays/tcp_server.rb
CHANGED
data/lib/uv-rays/version.rb
CHANGED
data/spec/scheduler_cron_spec.rb
CHANGED
@@ -28,8 +28,8 @@ describe UV::Scheduler::CronLine do
|
|
28
28
|
|
29
29
|
it 'interprets cron strings correctly' do
|
30
30
|
|
31
|
-
to_a '* * * * *',
|
32
|
-
to_a '10-12 * * * *', [ [0], [10, 11, 12], nil, nil,
|
31
|
+
to_a '* * * * *', [ [0], nil, nil, nil, nil, nil, nil, nil ]
|
32
|
+
to_a '10-12 * * * *', [ [0], [10, 11, 12], nil, nil, nil, nil, nil, nil ]
|
33
33
|
to_a '* * * * sun,mon', [ [0], nil, nil, nil, nil, [0, 1], nil, nil ]
|
34
34
|
to_a '* * * * mon-wed', [ [0], nil, nil, nil, nil, [1, 2, 3], nil, nil ]
|
35
35
|
to_a '* * * * 7', [ [0], nil, nil, nil, nil, [0], nil, nil ]
|
@@ -40,6 +40,7 @@ describe UV::Scheduler::CronLine do
|
|
40
40
|
to_a '* * * * sun,2-4', [ [0], nil, nil, nil, nil, [0, 2, 3, 4], nil, nil ]
|
41
41
|
|
42
42
|
to_a '* * * * sun,mon-tue', [ [0], nil, nil, nil, nil, [0, 1, 2], nil, nil ]
|
43
|
+
to_a '0 0 * * mon#1,tue', [[0], [0], [0], nil, nil, [2], ["mon#1"], nil]
|
43
44
|
|
44
45
|
to_a '* * * * * *', [ nil, nil, nil, nil, nil, nil, nil, nil ]
|
45
46
|
to_a '1 * * * * *', [ [1], nil, nil, nil, nil, nil, nil, nil ]
|
@@ -48,12 +49,22 @@ describe UV::Scheduler::CronLine do
|
|
48
49
|
|
49
50
|
to_a '0 0 1 1 *', [ [0], [0], [0], [1], [1], nil, nil, nil ]
|
50
51
|
|
51
|
-
to_a '0
|
52
|
-
|
53
|
-
|
54
|
-
|
52
|
+
to_a '52 0 * * *', [ [0], [52], [0], nil, nil, nil, nil, nil ]
|
53
|
+
|
54
|
+
to_a '0 16 * * *', [ [0], [0], [16], nil, nil, nil, nil, nil ]
|
55
|
+
|
56
|
+
to_a '0 23-24 * * *', [ [0], [0], [0, 23], nil, nil, nil, nil, nil ]
|
57
|
+
|
58
|
+
to_a '0 23-2 * * *', [ [0], [0], [0, 1, 2, 23], nil, nil, nil, nil, nil ]
|
59
|
+
|
60
|
+
# modulo forms work for five-field forms
|
61
|
+
to_a '*/17 * * * *', [[0], [0, 17, 34, 51], nil, nil, nil, nil, nil, nil]
|
62
|
+
to_a '13 */17 * * *', [[0], [13], [0, 17], nil, nil, nil, nil, nil]
|
63
|
+
|
64
|
+
# modulo forms work for six-field forms
|
65
|
+
to_a '*/17 * * * * *', [[0, 17, 34, 51], nil, nil, nil, nil, nil, nil, nil]
|
66
|
+
to_a '13 */17 * * * *', [[13], [0, 17, 34, 51], nil, nil, nil, nil, nil, nil]
|
55
67
|
|
56
|
-
to_a '0 23-2 * * *', [ [0], [0], [23, 0, 1, 2], nil, nil, nil, nil, nil ]
|
57
68
|
end
|
58
69
|
|
59
70
|
it 'rejects invalid weekday expressions' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uv-rays
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen von Takach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libuv
|