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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8eded0bd62f85e98614fb6f8c2f57300036be176
4
- data.tar.gz: b7fc81a9f3bae2ed902bc6f123ed6d9537012675
2
+ SHA256:
3
+ metadata.gz: f82a8f51c6174d97745127776095269d18e02d80aa0230c196418c29de5a2d90
4
+ data.tar.gz: cbb1b0261b8ae97b7be7b89636ecb4afba4f67281f86401cadbf2ad092063d3c
5
5
  SHA512:
6
- metadata.gz: 9e8d048d6cd378fc9b0b5532d1c7acc2ed667ea885eaec6cd1cdf6b0e8e59e7cc3a4e8f5e6d016d231b251b6d0b50c0659b921f0eff1a518128aa5ec408cc622
7
- data.tar.gz: ca2bbea2c50b9fce77c3ff4b3d5ab2a2c0bf037ce278bde3fc6e5bf1dce60eed84f2f11c1789af515947e528116048c510de9bb1c293571352af1bafd173f704
6
+ metadata.gz: 28d07dd0b430a31ad3c209de07a6e3813852b1615b1f59cc862d1a74c6da041a178b472a596c0e81598c205ef1fd253342c2b099369e06f70eca7d768d67c29f
7
+ data.tar.gz: 6493a115a0c51cda15fc85a1d7d6ccfbcdb92af2cff13d7986134980dd9a37e0916907208d7892278dbfbfe867c91c489a6b6ce1fe422fd041bd15da210b8168
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- b0fØ��.�����7'�L�N��?/o�:��ژ
2
- ���?ku03"|�`��T’ 
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���,������pS����Ȫ�<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:
@@ -10,10 +10,10 @@ module Schedulability
10
10
  extend Loggability
11
11
 
12
12
  # Package version constant
13
- VERSION = '0.2.0'
13
+ VERSION = '0.3.0'
14
14
 
15
15
  # VCS revision
16
- REVISION = %q$Revision: bd7566ac26d5 $
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
- hour += 12 if qualifier == 'pm' && hour < 12
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.2.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
- MIIDMDCCAhigAwIBAgIBAjANBgkqhkiG9w0BAQUFADA+MQwwCgYDVQQDDANnZWQx
14
+ MIIEbDCCAtSgAwIBAgIBATANBgkqhkiG9w0BAQsFADA+MQwwCgYDVQQDDANnZWQx
15
15
  GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
16
- HhcNMTYwNjAyMDE1NTQ2WhcNMTcwNjAyMDE1NTQ2WjA+MQwwCgYDVQQDDANnZWQx
16
+ HhcNMTYwODIwMTgxNzQyWhcNMTcwODIwMTgxNzQyWjA+MQwwCgYDVQQDDANnZWQx
17
17
  GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
18
- ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDb92mkyYwuGBg1oRxt2tkH
19
- +Uo3LAsaL/APBfSLzy8o3+B3AUHKCjMUaVeBoZdWtMHB75X3VQlvXfZMyBxj59Vo
20
- cDthr3zdao4HnyrzAIQf7BO5Y8KBwVD+yyXCD/N65TTwqsQnO3ie7U5/9ut1rnNr
21
- OkOzAscMwkfQxBkXDzjvAWa6UF4c5c9kR/T79iA21kDx9+bUMentU59aCJtUcbxa
22
- 7kcKJhPEYsk4OdxR9q2dphNMFDQsIdRO8rywX5FRHvcb+qnXC17RvxLHtOjysPtp
23
- EWsYoZMxyCDJpUqbwoeiM+tAHoz2ABMv3Ahie3Qeb6+MZNAtMmaWfBx3dg2u+/WN
24
- AgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBSZ0hCV
25
- qoHr122fGKelqffzEQBhszANBgkqhkiG9w0BAQUFAAO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wGA1UdEQQVMBOBEWdlZEBGYWVyaWVNVUQub3JnMBwGA1UdEgQVMBOBEWdlZEBG
29
+ YWVyaWVNVUQub3JnMA0GCSqGSIb3DQEBCwUAA4IBgQAPJzKiT0zBU7kpqe0aS2qb
30
+ FI0PJ4y5I8buU4IZGUD5NEt/N7pZNfOyBxkrZkXhS44Fp+xwBH5ebLbq/WY78Bqd
31
+ db0z6ZgW4LMYMpWFfbXsRbd9TU2f52L8oMAhxOvF7Of5qJMVWuFQ8FPagk2iHrdH
32
+ inYLQagqAF6goWTXgAJCdPd6SNeeSNqA6vlY7CV1Jh5kfNJJ6xu/CVij1GzCLu/5
33
+ DMOr26DBv+qLJRRC/2h34uX71q5QgeOyxvMg+7V3u/Q06DXyQ2VgeeqiwDFFpEH0
34
+ PFkdPO6ZqbTRcLfNH7mFgCBJjsfSjJrn0sPBlYyOXgCoByfZnZyrIMH/UY+lgQqS
35
+ 6Von1VDsfQm0eJh5zYZD64ZF86phSR7mUX3mXItwH04HrZwkWpvgd871DZVR3i1n
36
+ w8aNA5re5+Rt/Vvjxj5AcEnZnZiz5x959NaddQocX32Z1unHw44pzRNUur1GInfW
37
+ p4vpx2kUSFSAGjtCbDGTNV2AH8w9OU4xEmNz8c5lyoA=
32
38
  -----END CERTIFICATE-----
33
- date: 2016-07-20 00:00:00.000000000 Z
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