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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea05ae786dcebc37d1ef84cb3d2d7d5509ed6e72
4
- data.tar.gz: 2b43bb14cd91406d42ead3ff66711008884b52f6
3
+ metadata.gz: fb2605b3097dbf2b0ef3c8c17df39580ce036185
4
+ data.tar.gz: 6983fdeea7d991cda8740e3076a98fc07d479630
5
5
  SHA512:
6
- metadata.gz: 235f1a3189b0356e59a06f26eed5c971483371c146d793f8343f971d8543827a60f749010b239379a503d787f565a2aebe47087d87b2a50c8da154074c6b7ccc
7
- data.tar.gz: 8100f97d5d06df4ea953771e4a2dcf85cee6ea9afbd1de9e3d6d98a7d4a398b6302704c826a981e369db746a5b3b4c6d7467ba4d017417999bb95f37a5692d7c
6
+ metadata.gz: 40556df7599e68cdbed13ffe47bddf74c5fee91fdb296b8f5468d6f881e44b0e5db7490b5a6f150ab90f2025beb2ccc1c754df281a2c58d5af54ecb09077f75b
7
+ data.tar.gz: 990adf1a8c5282b80ab3c93a19ea8785519e436add68136a68b8891bfe0e6e9cd7676bfe243df9429b47711bb44109c37ed4f8bbcb17bcb849a5ef02f2065dc7
@@ -61,7 +61,7 @@ module UV
61
61
 
62
62
  # Check for multi-byte indicator edge case
63
63
  case result
64
- when Integer, Fixnum
64
+ when Integer
65
65
  entities << last[0...result]
66
66
  @input = last[result..-1]
67
67
  else
@@ -138,7 +138,7 @@ module UV
138
138
 
139
139
  def next_time
140
140
  @last_scheduled = @reactor.now
141
- if @every.is_a? Fixnum
141
+ if @every.is_a? Integer
142
142
  @next_scheduled = @last_scheduled + @every
143
143
  else
144
144
  # must be a cron
@@ -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?(Fixnum) }
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
 
@@ -8,7 +8,7 @@ module UV
8
8
  @klass = klass
9
9
  @args = args
10
10
 
11
- if server == port && port.is_a?(Fixnum)
11
+ if server == port && port.is_a?(Integer)
12
12
  # We are opening a socket descriptor
13
13
  open(server)
14
14
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UV
4
- VERSION = '2.0.3'
4
+ VERSION = '2.0.4'
5
5
  end
@@ -28,8 +28,8 @@ describe UV::Scheduler::CronLine do
28
28
 
29
29
  it 'interprets cron strings correctly' do
30
30
 
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 ]
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 23-24 * * *', [ [0], [0], [23, 0], nil, nil, nil, nil, nil ]
52
- #
53
- # as reported by Aimee Rose in
54
- # https://github.com/jmettraux/rufus-scheduler/issues/56
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.3
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-12 00:00:00.000000000 Z
11
+ date: 2017-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libuv