schedulability 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 +5 -5
- checksums.yaml.gz.sig +3 -2
- data.tar.gz.sig +0 -0
- data/History.md +7 -0
- data/lib/schedulability.rb +2 -2
- data/lib/schedulability/parser.rb +8 -4
- data/spec/schedulability/schedule_spec.rb +56 -1
- metadata +24 -18
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f82a8f51c6174d97745127776095269d18e02d80aa0230c196418c29de5a2d90
|
4
|
+
data.tar.gz: cbb1b0261b8ae97b7be7b89636ecb4afba4f67281f86401cadbf2ad092063d3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28d07dd0b430a31ad3c209de07a6e3813852b1615b1f59cc862d1a74c6da041a178b472a596c0e81598c205ef1fd253342c2b099369e06f70eca7d768d67c29f
|
7
|
+
data.tar.gz: 6493a115a0c51cda15fc85a1d7d6ccfbcdb92af2cff13d7986134980dd9a37e0916907208d7892278dbfbfe867c91c489a6b6ce1fe422fd041bd15da210b8168
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
��Գ$�LV����M��y=�֢�#k��p�G����C6�:v��L����ƅ`�=ke�h#D~�l�k*|���)e3X������=y��A��M���{Ro8�Or�[\W$�I�aC�̗tG��i�kW�kO��)��~@��A,&�5�1+Ƥb�n!�E�iYʔv�]�8 U켒�Ǽ�"|��)�+�O��<��:��<h��n>]����]�<��yc�O��'��@j�����y�q\�#.���.j0�L�@]���1e�@U�D>+�q���,������p�S����Ȫ�<m���+��Y���a����P��F��
|
2
|
+
�Z椎
|
3
|
+
�ZB�@cc�m!-]�k�>��P�َ��x�'�٨a���^RHY
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## v0.3.0 [2016-07-29] Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
Bugfix:
|
4
|
+
- Add support for 0th hour and 12am (thanks to
|
5
|
+
Meining Lu <meining@getupperhand.com> on Github for the patch)
|
6
|
+
|
7
|
+
|
1
8
|
## v0.2.0 [2016-07-20] Michael Granger <ged@FaerieMUD.org>
|
2
9
|
|
3
10
|
Bugfixes:
|
data/lib/schedulability.rb
CHANGED
@@ -10,10 +10,10 @@ module Schedulability
|
|
10
10
|
extend Loggability
|
11
11
|
|
12
12
|
# Package version constant
|
13
|
-
VERSION = '0.
|
13
|
+
VERSION = '0.3.0'
|
14
14
|
|
15
15
|
# VCS revision
|
16
|
-
REVISION = %q$Revision:
|
16
|
+
REVISION = %q$Revision: 4eb3e8287023 $
|
17
17
|
|
18
18
|
|
19
19
|
# Loggability API -- set up a logger for Schedulability objects
|
@@ -240,11 +240,16 @@ module Schedulability::Parser
|
|
240
240
|
if qualifier
|
241
241
|
raise Schedulability::RangeError, "invalid hour value: %p" % [ time_value ] if
|
242
242
|
hour > 12
|
243
|
-
|
243
|
+
|
244
|
+
if qualifier == 'am' && hour == 12
|
245
|
+
hour = 0
|
246
|
+
elsif qualifier == 'pm' && hour < 12
|
247
|
+
hour += 12
|
248
|
+
end
|
249
|
+
|
244
250
|
else
|
245
251
|
raise Schedulability::RangeError, "invalid hour value: %p" % [ time_value ] if
|
246
|
-
hour > 24
|
247
|
-
hour = 24 if hour.zero?
|
252
|
+
hour < 0 || hour > 24
|
248
253
|
end
|
249
254
|
|
250
255
|
return hour
|
@@ -328,4 +333,3 @@ module Schedulability::Parser
|
|
328
333
|
end
|
329
334
|
|
330
335
|
end # module Schedulability::Parser
|
331
|
-
|
@@ -346,6 +346,62 @@ describe Schedulability::Schedule do
|
|
346
346
|
end
|
347
347
|
|
348
348
|
|
349
|
+
|
350
|
+
it "handles 12am correctly" do
|
351
|
+
schedule = described_class.parse( "hr {12am}" )
|
352
|
+
time = Time.iso8601( '2015-12-15T00:00:00-00:00' )
|
353
|
+
|
354
|
+
expect( schedule ).to_not include( time - 1 )
|
355
|
+
expect( schedule ).to include( time )
|
356
|
+
expect( schedule ).to include( time + 1.minute )
|
357
|
+
expect( schedule ).to include( time + 20.minutes )
|
358
|
+
expect( schedule ).to include( time + (1.hour - 1.minute) )
|
359
|
+
expect( schedule ).to_not include( time + 1.hour )
|
360
|
+
expect( schedule ).to_not include( time + 3.hours )
|
361
|
+
end
|
362
|
+
|
363
|
+
|
364
|
+
it "handles am times correctly" do
|
365
|
+
schedule = described_class.parse( "hr {9am}" )
|
366
|
+
time = Time.iso8601( '2015-12-15T09:00:00-00:00' )
|
367
|
+
|
368
|
+
expect( schedule ).to_not include( time - 1 )
|
369
|
+
expect( schedule ).to include( time )
|
370
|
+
expect( schedule ).to include( time + 1.minute )
|
371
|
+
expect( schedule ).to include( time + 20.minutes )
|
372
|
+
expect( schedule ).to include( time + (1.hour - 1.minute) )
|
373
|
+
expect( schedule ).to_not include( time + 1.hour )
|
374
|
+
expect( schedule ).to_not include( time + 3.hours )
|
375
|
+
end
|
376
|
+
|
377
|
+
|
378
|
+
it "handles 0 correctly" do
|
379
|
+
schedule = described_class.parse( "hr {0}" )
|
380
|
+
time = Time.iso8601( '2015-12-15T00:00:00-00:00' )
|
381
|
+
|
382
|
+
expect( schedule ).to_not include( time - 1 )
|
383
|
+
expect( schedule ).to include( time )
|
384
|
+
expect( schedule ).to include( time + 1.minute )
|
385
|
+
expect( schedule ).to include( time + 20.minutes )
|
386
|
+
expect( schedule ).to include( time + (1.hour - 1.minute) )
|
387
|
+
expect( schedule ).to_not include( time + 1.hour )
|
388
|
+
expect( schedule ).to_not include( time + 3.hours )
|
389
|
+
end
|
390
|
+
|
391
|
+
|
392
|
+
it "allows hour values equal to 0" do
|
393
|
+
expect {
|
394
|
+
described_class.parse( 'hr {0}' )
|
395
|
+
}.not_to raise_error
|
396
|
+
expect {
|
397
|
+
described_class.parse( 'hr {0 5 10}' )
|
398
|
+
}.not_to raise_error
|
399
|
+
expect {
|
400
|
+
described_class.parse( 'hr {0-23}' )
|
401
|
+
}.not_to raise_error
|
402
|
+
end
|
403
|
+
|
404
|
+
|
349
405
|
it "matches single day number values as a 86400-second exclusive range" do
|
350
406
|
schedule = described_class.parse( "md {11}" )
|
351
407
|
|
@@ -926,4 +982,3 @@ describe Schedulability::Schedule do
|
|
926
982
|
end
|
927
983
|
|
928
984
|
end
|
929
|
-
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schedulability
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -11,26 +11,32 @@ bindir: bin
|
|
11
11
|
cert_chain:
|
12
12
|
- |
|
13
13
|
-----BEGIN CERTIFICATE-----
|
14
|
-
|
14
|
+
MIIEbDCCAtSgAwIBAgIBATANBgkqhkiG9w0BAQsFADA+MQwwCgYDVQQDDANnZWQx
|
15
15
|
GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
|
16
|
-
|
16
|
+
HhcNMTYwODIwMTgxNzQyWhcNMTcwODIwMTgxNzQyWjA+MQwwCgYDVQQDDANnZWQx
|
17
17
|
GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
18
|
+
ggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC/JWGRHO+USzR97vXjkFgt
|
19
|
+
83qeNf2KHkc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Q06DXyQ2VgeeqiwDFFpEH0
|
34
|
+
PFkdPO6ZqbTRcLfNH7mFgCBJjsfSjJrn0sPBlYyOXgCoByfZnZyrIMH/UY+lgQqS
|
35
|
+
6Von1VDsfQm0eJh5zYZD64ZF86phSR7mUX3mXItwH04HrZwkWpvgd871DZVR3i1n
|
36
|
+
w8aNA5re5+Rt/Vvjxj5AcEnZnZiz5x959NaddQocX32Z1unHw44pzRNUur1GInfW
|
37
|
+
p4vpx2kUSFSAGjtCbDGTNV2AH8w9OU4xEmNz8c5lyoA=
|
32
38
|
-----END CERTIFICATE-----
|
33
|
-
date: 2016-
|
39
|
+
date: 2016-10-21 00:00:00.000000000 Z
|
34
40
|
dependencies:
|
35
41
|
- !ruby/object:Gem::Dependency
|
36
42
|
name: loggability
|
metadata.gz.sig
CHANGED
Binary file
|