slow_blink 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +9 -0
- data/ext/slow_blink/ext_schema_parser/parser.c +4 -4
- data/ext/slow_blink/message/ext_compact_encoder/compact_encoder.c +5 -5
- data/ext/slow_blink/message/ext_compact_encoder/ext_compact_encoder.c +31 -18
- data/lib/slow_blink/annotatable.rb +20 -17
- data/lib/slow_blink/annotation.rb +20 -18
- data/lib/slow_blink/binary.rb +20 -17
- data/lib/slow_blink/boolean.rb +20 -17
- data/lib/slow_blink/date.rb +20 -17
- data/lib/slow_blink/decimal.rb +20 -17
- data/lib/slow_blink/definition.rb +21 -19
- data/lib/slow_blink/enumeration.rb +30 -26
- data/lib/slow_blink/field.rb +20 -17
- data/lib/slow_blink/fixed.rb +20 -17
- data/lib/slow_blink/floating_point.rb +20 -17
- data/lib/slow_blink/group.rb +21 -18
- data/lib/slow_blink/incremental_annotation.rb +21 -18
- data/lib/slow_blink/integer.rb +20 -17
- data/lib/slow_blink/log.rb +20 -17
- data/lib/slow_blink/message/binary.rb +23 -18
- data/lib/slow_blink/message/boolean.rb +22 -17
- data/lib/slow_blink/message/date.rb +23 -18
- data/lib/slow_blink/message/decimal.rb +38 -21
- data/lib/slow_blink/message/enumeration.rb +31 -21
- data/lib/slow_blink/message/field.rb +23 -18
- data/lib/slow_blink/message/fixed.rb +23 -19
- data/lib/slow_blink/message/floating_point.rb +22 -17
- data/lib/slow_blink/message/group.rb +90 -55
- data/lib/slow_blink/message/integer.rb +51 -24
- data/lib/slow_blink/message/model.rb +197 -131
- data/lib/slow_blink/message/sequence.rb +31 -25
- data/lib/slow_blink/message/string.rb +23 -18
- data/lib/slow_blink/message/time.rb +31 -25
- data/lib/slow_blink/message/time_of_day.rb +24 -18
- data/lib/slow_blink/name_with_id.rb +20 -17
- data/lib/slow_blink/namespace.rb +22 -19
- data/lib/slow_blink/object.rb +20 -17
- data/lib/slow_blink/parse_error.rb +26 -0
- data/lib/slow_blink/ref.rb +20 -17
- data/lib/slow_blink/schema.rb +26 -24
- data/lib/slow_blink/schema_buffer.rb +20 -17
- data/lib/slow_blink/sequence.rb +20 -17
- data/lib/slow_blink/string.rb +20 -17
- data/lib/slow_blink/sym.rb +20 -17
- data/lib/slow_blink/time.rb +20 -17
- data/lib/slow_blink/time_of_day.rb +20 -17
- data/lib/slow_blink/type.rb +20 -17
- data/lib/slow_blink/version.rb +21 -18
- data/lib/slow_blink.rb +19 -17
- data/test/tc_compact_encoder.rb +64 -30
- data/test/tc_group.rb +0 -19
- data/test/tc_incr_annote.rb +0 -21
- data/test/tc_model_decimal.rb +94 -0
- data/test/tc_model_dynamic_group.rb +0 -19
- data/test/tc_model_extension.rb +0 -19
- data/test/tc_model_sequence_of_string.rb +29 -0
- data/test/tc_model_static_group.rb +0 -19
- data/test/tc_model_think_blink.rb +0 -19
- data/test/tc_types.rb +0 -19
- metadata +8 -4
- data/lib/slow_blink/compact_encoder.rb +0 -72
- data/lib/slow_blink/error.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20d7c9ee2ab3bde244ae63f132424510c5157a25
|
4
|
+
data.tar.gz: 3f69a1496d4696214ad7dfb780f94631ea76367b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d2f085b62ac487a53aaa03c6b839728411db49d9f1a78d7ca593ee9c5e5e5d6469ed34a3066d75af7f972ae61715896185e9e84262a1070e01f89131467c91c
|
7
|
+
data.tar.gz: 3c17d9832aca43cbdc2d32975251b127c90a2c74dbb8b6c448ee901d26e34d7186360b523bd10585890c741a7781b53949ecb9fa302c2cfca98f538196fe8c01
|
data/.yardopts
ADDED
@@ -120,7 +120,7 @@ static VALUE cFieldTypeRef;
|
|
120
120
|
|
121
121
|
static VALUE cLog;
|
122
122
|
|
123
|
-
static VALUE
|
123
|
+
static VALUE cParseError;
|
124
124
|
|
125
125
|
/* generated **********************************************************/
|
126
126
|
|
@@ -3773,7 +3773,7 @@ void Init_ext_schema_parser(void)
|
|
3773
3773
|
|
3774
3774
|
cLog = rb_const_get(cSlowBlink, rb_intern("Log"));
|
3775
3775
|
|
3776
|
-
|
3776
|
+
cParseError = rb_const_get(cSlowBlink, rb_intern("ParseError"));
|
3777
3777
|
|
3778
3778
|
rb_define_singleton_method(cNamespace, "parse", parseFileBuffer, -1);
|
3779
3779
|
}
|
@@ -3800,7 +3800,7 @@ static VALUE parseFileBuffer(int argc, VALUE* argv, VALUE self)
|
|
3800
3800
|
rb_scan_args(argc, argv, "10:", &buffer, &opts);
|
3801
3801
|
|
3802
3802
|
if(buffer == Qnil){
|
3803
|
-
rb_raise(
|
3803
|
+
rb_raise(rb_eTypeError, "error: input must be a string");
|
3804
3804
|
}
|
3805
3805
|
|
3806
3806
|
if(opts == Qnil){
|
@@ -3821,7 +3821,7 @@ static VALUE parseFileBuffer(int argc, VALUE* argv, VALUE self)
|
|
3821
3821
|
case 0:
|
3822
3822
|
break;
|
3823
3823
|
case 1:
|
3824
|
-
rb_raise(
|
3824
|
+
rb_raise(cParseError, "parse error");
|
3825
3825
|
break;
|
3826
3826
|
case 2:
|
3827
3827
|
rb_bug("yyparse: bison parser reports memory exhaustion");
|
@@ -118,19 +118,19 @@ uint8_t BLINK_getSizeSigned(int64_t value)
|
|
118
118
|
else if(value <= 0x7fffL){
|
119
119
|
retval = 3U;
|
120
120
|
}
|
121
|
-
else if(value
|
121
|
+
else if(value <= 0x7fffffL){
|
122
122
|
retval = 4U;
|
123
123
|
}
|
124
|
-
else if(value
|
124
|
+
else if(value <= 0x7fffffffL){
|
125
125
|
retval = 5U;
|
126
126
|
}
|
127
|
-
else if(value
|
127
|
+
else if(value <= 0x7fffffffffL){
|
128
128
|
retval = 6U;
|
129
129
|
}
|
130
|
-
else if(value
|
130
|
+
else if(value <= 0x7fffffffffffL){
|
131
131
|
retval = 7U;
|
132
132
|
}
|
133
|
-
else if(value
|
133
|
+
else if(value <= 0x7fffffffffffffL){
|
134
134
|
retval = 8U;
|
135
135
|
}
|
136
136
|
else{
|
@@ -89,18 +89,31 @@ static VALUE getInt(VALUE input, int64_t min, int64_t max, bool isSigned);
|
|
89
89
|
|
90
90
|
/* static variables ***************************************************/
|
91
91
|
|
92
|
-
static VALUE
|
92
|
+
static VALUE cStrongError1;
|
93
|
+
|
94
|
+
static VALUE cWeakError3;
|
95
|
+
static VALUE cWeakError4;
|
96
|
+
static VALUE cWeakError9;
|
97
|
+
static VALUE cWeakError11;
|
98
|
+
|
99
|
+
|
93
100
|
|
94
101
|
/* functions **********************************************************/
|
95
102
|
|
96
103
|
void Init_ext_compact_encoder(void)
|
97
104
|
{
|
98
105
|
VALUE cSlowBlink;
|
99
|
-
|
100
|
-
rb_require("slow_blink/message/model.rb");
|
106
|
+
VALUE cMessage;
|
101
107
|
|
102
108
|
cSlowBlink = rb_define_module("SlowBlink");
|
103
|
-
|
109
|
+
cMessage = rb_const_get(cSlowBlink, rb_intern("Message"));
|
110
|
+
|
111
|
+
cStrongError1 = rb_const_get(cMessage, rb_intern("StrongError1"));
|
112
|
+
|
113
|
+
cWeakError3 = rb_const_get(cMessage, rb_intern("WeakError3"));
|
114
|
+
cWeakError4 = rb_const_get(cMessage, rb_intern("WeakError4"));
|
115
|
+
cWeakError9 = rb_const_get(cMessage, rb_intern("WeakError9"));
|
116
|
+
cWeakError11 = rb_const_get(cMessage, rb_intern("WeakError11"));
|
104
117
|
|
105
118
|
rb_define_method(rb_cString, "putNull", putNull, 0);
|
106
119
|
rb_define_method(rb_cString, "putPresent", putPresent, 0);
|
@@ -298,7 +311,7 @@ static VALUE putInt(VALUE self, VALUE val, int64_t min, int64_t max, bool isSign
|
|
298
311
|
|
299
312
|
if((value < min) || (value > max)){
|
300
313
|
|
301
|
-
rb_raise(
|
314
|
+
rb_raise(rb_eRangeError, "Input exceeds allowable range of type");
|
302
315
|
}
|
303
316
|
|
304
317
|
retval = rb_str_buf_cat(self, (const char *)out, BLINK_putVLC((uint64_t)value, true, out, sizeof(out)));
|
@@ -309,7 +322,7 @@ static VALUE putInt(VALUE self, VALUE val, int64_t min, int64_t max, bool isSign
|
|
309
322
|
|
310
323
|
if(value > (uint64_t)max){
|
311
324
|
|
312
|
-
rb_raise(
|
325
|
+
rb_raise(rb_eRangeError, "Input exceeds allowable range of type");
|
313
326
|
}
|
314
327
|
|
315
328
|
retval = rb_str_buf_cat(self, (const char *)out, BLINK_putVLC(value, false, out, sizeof(out)));
|
@@ -378,7 +391,7 @@ static VALUE getF64(VALUE self)
|
|
378
391
|
}
|
379
392
|
else{
|
380
393
|
|
381
|
-
rb_raise(
|
394
|
+
rb_raise(cStrongError1, "S1: Group encoding ends prematurely");
|
382
395
|
}
|
383
396
|
|
384
397
|
return retval;
|
@@ -411,7 +424,7 @@ static VALUE getBool(VALUE self)
|
|
411
424
|
}
|
412
425
|
else{
|
413
426
|
|
414
|
-
rb_raise(
|
427
|
+
rb_raise(cWeakError11, "W11: Decoded value is not 0x00 or 0x01");
|
415
428
|
}
|
416
429
|
|
417
430
|
return retval;
|
@@ -425,7 +438,7 @@ static VALUE getBinary(VALUE self)
|
|
425
438
|
if(size != Qnil){
|
426
439
|
|
427
440
|
if(NUM2UINT(size) > RSTRING_LEN(self)){
|
428
|
-
rb_raise(
|
441
|
+
rb_raise(cStrongError1, "S1: Group encoding ends prematurely");
|
429
442
|
}
|
430
443
|
|
431
444
|
retval = rb_str_substr(self, 0, NUM2UINT(size));
|
@@ -453,7 +466,7 @@ static VALUE getFixed(VALUE self, VALUE size)
|
|
453
466
|
|
454
467
|
if(NUM2UINT(size) > RSTRING_LEN(self)){
|
455
468
|
|
456
|
-
rb_raise(
|
469
|
+
rb_raise(cStrongError1, "S1: Group encoding ends prematurely");
|
457
470
|
}
|
458
471
|
|
459
472
|
retval = rb_str_substr(self, 0, NUM2UINT(size));
|
@@ -485,19 +498,19 @@ static VALUE getFixedOptional(VALUE self, VALUE size)
|
|
485
498
|
|
486
499
|
if(RSTRING_LEN(retval) != NUM2UINT(size)){
|
487
500
|
|
488
|
-
rb_raise(
|
501
|
+
rb_raise(cStrongError1, "S1: Group encoding ends prematurely");
|
489
502
|
}
|
490
503
|
|
491
504
|
rb_str_drop_bytes(self, NUM2UINT(size));
|
492
505
|
}
|
493
506
|
else{
|
494
507
|
|
495
|
-
rb_raise(
|
508
|
+
rb_raise(cWeakError9, "W9: Presence flag is not 0xC0 or 0x01");
|
496
509
|
}
|
497
510
|
}
|
498
511
|
else{
|
499
512
|
|
500
|
-
rb_raise(
|
513
|
+
rb_raise(cStrongError1, "S1: Group encoding ends prematurely");
|
501
514
|
}
|
502
515
|
|
503
516
|
return retval;
|
@@ -522,12 +535,12 @@ static VALUE getInt(VALUE input, int64_t min, int64_t max, bool isSigned)
|
|
522
535
|
|
523
536
|
if(((int64_t)out < min) || ((int64_t)out > max)){
|
524
537
|
|
525
|
-
rb_raise(
|
538
|
+
rb_raise(cWeakError3, "W3: Decoded value overflows range");
|
526
539
|
}
|
527
540
|
|
528
541
|
if(BLINK_getSizeSigned((int64_t)out) != ret){
|
529
542
|
|
530
|
-
rb_raise(
|
543
|
+
rb_raise(cWeakError4, "W4: VLC entity contains more bytes than needed to express full width of type");
|
531
544
|
}
|
532
545
|
|
533
546
|
retval = LL2NUM((int64_t)out);
|
@@ -536,12 +549,12 @@ static VALUE getInt(VALUE input, int64_t min, int64_t max, bool isSigned)
|
|
536
549
|
|
537
550
|
if(out > (uint64_t)max){
|
538
551
|
|
539
|
-
rb_raise(
|
552
|
+
rb_raise(cWeakError3, "W3: Decoded value overflows range");
|
540
553
|
}
|
541
554
|
|
542
555
|
if(BLINK_getSizeUnsigned(out) != ret){
|
543
556
|
|
544
|
-
rb_raise(
|
557
|
+
rb_raise(cWeakError4, "W4: VLC entity contains more bytes than needed to express full width of type");
|
545
558
|
}
|
546
559
|
|
547
560
|
retval = ULL2NUM(out);
|
@@ -550,7 +563,7 @@ static VALUE getInt(VALUE input, int64_t min, int64_t max, bool isSigned)
|
|
550
563
|
}
|
551
564
|
else{
|
552
565
|
|
553
|
-
rb_raise(
|
566
|
+
rb_raise(cStrongError1, "S1: Group encoding ends prematurely");
|
554
567
|
}
|
555
568
|
|
556
569
|
return retval;
|
@@ -1,21 +1,24 @@
|
|
1
|
-
#
|
1
|
+
# @license
|
2
|
+
#
|
3
|
+
# Copyright (c) 2016 Cameron Harper
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
# this software and associated documentation files (the "Software"), to deal in
|
7
|
+
# the Software without restriction, including without limitation the rights to
|
8
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
# subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
2
14
|
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
15
|
-
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
16
|
-
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
17
|
-
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
|
-
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
19
22
|
|
20
23
|
module SlowBlink
|
21
24
|
|
@@ -1,22 +1,24 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
1
|
+
# @license
|
2
|
+
#
|
3
|
+
# Copyright (c) 2016 Cameron Harper
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
# this software and associated documentation files (the "Software"), to deal in
|
7
|
+
# the Software without restriction, including without limitation the rights to
|
8
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
# subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
13
14
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
20
22
|
|
21
23
|
module SlowBlink
|
22
24
|
|
data/lib/slow_blink/binary.rb
CHANGED
@@ -1,21 +1,24 @@
|
|
1
|
-
#
|
1
|
+
# @license
|
2
|
+
#
|
3
|
+
# Copyright (c) 2016 Cameron Harper
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
# this software and associated documentation files (the "Software"), to deal in
|
7
|
+
# the Software without restriction, including without limitation the rights to
|
8
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
# subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
2
14
|
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
15
|
-
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
16
|
-
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
17
|
-
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
|
-
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
19
22
|
|
20
23
|
module SlowBlink
|
21
24
|
|
data/lib/slow_blink/boolean.rb
CHANGED
@@ -1,21 +1,24 @@
|
|
1
|
-
#
|
1
|
+
# @license
|
2
|
+
#
|
3
|
+
# Copyright (c) 2016 Cameron Harper
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
# this software and associated documentation files (the "Software"), to deal in
|
7
|
+
# the Software without restriction, including without limitation the rights to
|
8
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
# subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
2
14
|
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
15
|
-
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
16
|
-
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
17
|
-
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
|
-
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
19
22
|
|
20
23
|
module SlowBlink
|
21
24
|
|
data/lib/slow_blink/date.rb
CHANGED
@@ -1,21 +1,24 @@
|
|
1
|
-
#
|
1
|
+
# @license
|
2
|
+
#
|
3
|
+
# Copyright (c) 2016 Cameron Harper
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
# this software and associated documentation files (the "Software"), to deal in
|
7
|
+
# the Software without restriction, including without limitation the rights to
|
8
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
# subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
2
14
|
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
15
|
-
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
16
|
-
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
17
|
-
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
|
-
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
19
22
|
|
20
23
|
module SlowBlink
|
21
24
|
|
data/lib/slow_blink/decimal.rb
CHANGED
@@ -1,21 +1,24 @@
|
|
1
|
-
#
|
1
|
+
# @license
|
2
|
+
#
|
3
|
+
# Copyright (c) 2016 Cameron Harper
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
# this software and associated documentation files (the "Software"), to deal in
|
7
|
+
# the Software without restriction, including without limitation the rights to
|
8
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
# subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
2
14
|
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
11
|
-
# copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
15
|
-
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
16
|
-
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
17
|
-
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
|
-
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
19
22
|
|
20
23
|
module SlowBlink
|
21
24
|
|
@@ -1,22 +1,24 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
1
|
+
# @license
|
2
|
+
#
|
3
|
+
# Copyright (c) 2016 Cameron Harper
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
# this software and associated documentation files (the "Software"), to deal in
|
7
|
+
# the Software without restriction, including without limitation the rights to
|
8
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
# subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
13
14
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
20
22
|
|
21
23
|
module SlowBlink
|
22
24
|
|
@@ -74,7 +76,7 @@ module SlowBlink
|
|
74
76
|
return schema
|
75
77
|
end
|
76
78
|
rescue StopIteration
|
77
|
-
raise
|
79
|
+
raise ParseError.new "#{self.location}: error: invalid cycle detected"
|
78
80
|
end
|
79
81
|
end
|
80
82
|
end
|