gloo 6.2.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.mailmap +1 -0
- data/README.md +6 -0
- data/docs/language_syntax.md +18 -2
- data/docs/objects.md +4 -0
- data/docs/plugins.md +12 -4
- data/docs/verbs.md +8 -0
- data/lib/VERSION +1 -1
- data/lib/VERSION_NOTES +8 -0
- data/lib/gloo/app/engine.rb +8 -0
- data/lib/gloo/objs/basic/untyped.rb +14 -2
- data/lib/gloo/persist/file_loader.rb +27 -1
- data/lib/gloo/verbs/check.rb +16 -4
- data/lib/gloo/verbs/create.rb +8 -3
- data/lib/gloo/verbs/eval.rb +16 -2
- data/lib/gloo/verbs/tell.rb +15 -3
- data/lib/gloo/verbs/throw.rb +29 -1
- data/test.gloo/lang/continuation.test.gloo +39 -0
- data/test.gloo/lang/convert.test.gloo +70 -0
- data/test.gloo/lang/here.test.gloo +41 -0
- data/test.gloo/lang/it.test.gloo +41 -0
- data/test.gloo/lang/literal.test.gloo +61 -0
- data/test.gloo/lang/load_lib_directive.test.gloo +33 -0
- data/test.gloo/lang/naming.test.gloo +44 -0
- data/test.gloo/objs/cipher.test.gloo +45 -0
- data/test.gloo/objs/erb.test.gloo +18 -0
- data/test.gloo/objs/file.test.gloo +77 -0
- data/test.gloo/objs/function.test.gloo +54 -0
- data/test.gloo/objs/json.test.gloo +70 -0
- data/test.gloo/objs/outline.test.gloo +72 -0
- data/test.gloo/objs/password.test.gloo +40 -0
- data/test.gloo/objs/repeat.test.gloo +48 -0
- data/test.gloo/objs/untyped.test.gloo +20 -2
- data/test.gloo/objs/uri.test.gloo +43 -0
- data/test.gloo/verbs/context.test.gloo +19 -0
- data/test.gloo/verbs/list.test.gloo +34 -0
- data/test.gloo/verbs/load.test.gloo +32 -0
- data/test.gloo/verbs/show.test.gloo +37 -0
- data/test.gloo/verbs/throw.test.gloo +44 -0
- data/test.gloo/verbs/unload.test.gloo +21 -0
- metadata +23 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#
|
|
2
|
+
# List verb tests
|
|
3
|
+
#
|
|
4
|
+
# 'list' only writes to the console, so these tests check its error
|
|
5
|
+
# behaviour rather than its output.
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
tests [can] :
|
|
9
|
+
verbs [can] :
|
|
10
|
+
list [can] :
|
|
11
|
+
|
|
12
|
+
data [can] :
|
|
13
|
+
a [string] : A
|
|
14
|
+
b [string] : B
|
|
15
|
+
|
|
16
|
+
err_fired [bool] : false
|
|
17
|
+
on_error [script] :
|
|
18
|
+
put true into ^.err_fired
|
|
19
|
+
|
|
20
|
+
list_real_container [test] :
|
|
21
|
+
description [string] : listing a real container does not fire on_error.
|
|
22
|
+
on_test [script] :
|
|
23
|
+
put false into ^^.err_fired
|
|
24
|
+
list tests.verbs.list.data
|
|
25
|
+
eval ^^.err_fired = false
|
|
26
|
+
assert "listing a real container should not fire on_error"
|
|
27
|
+
|
|
28
|
+
list_missing_target [test] :
|
|
29
|
+
description [string] : listing a missing target fires on_error.
|
|
30
|
+
on_test [script] :
|
|
31
|
+
put false into ^^.err_fired
|
|
32
|
+
list tests.verbs.list.no_such_thing
|
|
33
|
+
eval ^^.err_fired = true
|
|
34
|
+
assert "listing a missing target should fire on_error"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Load verb tests
|
|
3
|
+
#
|
|
4
|
+
# Uses 'load lib' because it is self-contained (no fixture files) and
|
|
5
|
+
# its effect is observable through 'exists?'.
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
tests [can] :
|
|
9
|
+
verbs [can] :
|
|
10
|
+
load [can] :
|
|
11
|
+
|
|
12
|
+
err_fired [bool] : false
|
|
13
|
+
on_error [script] :
|
|
14
|
+
put true into ^.err_fired
|
|
15
|
+
|
|
16
|
+
load_lib_registers_type [test] :
|
|
17
|
+
description [string] : load lib registers that library's object types.
|
|
18
|
+
on_test [script] :
|
|
19
|
+
exists? object markdown
|
|
20
|
+
refute "markdown type should not be registered before load"
|
|
21
|
+
|
|
22
|
+
load lib md
|
|
23
|
+
exists? object markdown
|
|
24
|
+
assert "expected the markdown type to be registered after 'load lib md'"
|
|
25
|
+
|
|
26
|
+
load_no_args_errors [test] :
|
|
27
|
+
description [string] : load with no arguments fires on_error.
|
|
28
|
+
on_test [script] :
|
|
29
|
+
put false into ^^.err_fired
|
|
30
|
+
load
|
|
31
|
+
eval ^^.err_fired = true
|
|
32
|
+
assert "expected 'load' with no arguments to fire on_error"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Show verb tests
|
|
3
|
+
#
|
|
4
|
+
|
|
5
|
+
tests [can] :
|
|
6
|
+
verbs [can] :
|
|
7
|
+
show [can] :
|
|
8
|
+
|
|
9
|
+
msg [string] : hello
|
|
10
|
+
|
|
11
|
+
show_literal [test] :
|
|
12
|
+
description [string] : Show a literal sets it to that literal.
|
|
13
|
+
on_test [script] :
|
|
14
|
+
show 'hello'
|
|
15
|
+
eval it = 'hello'
|
|
16
|
+
assert "expected it to be 'hello'"
|
|
17
|
+
|
|
18
|
+
show_object [test] :
|
|
19
|
+
description [string] : Show an object sets it to the object's value.
|
|
20
|
+
on_test [script] :
|
|
21
|
+
show ^^.msg
|
|
22
|
+
eval it = 'hello'
|
|
23
|
+
assert "expected it to be the value of msg"
|
|
24
|
+
|
|
25
|
+
show_expression [test] :
|
|
26
|
+
description [string] : Show evaluates an expression before showing it.
|
|
27
|
+
on_test [script] :
|
|
28
|
+
show 3 + 4
|
|
29
|
+
eval it = 7
|
|
30
|
+
assert "expected it to be 7"
|
|
31
|
+
|
|
32
|
+
show_concat [test] :
|
|
33
|
+
description [string] : Show evaluates a string concatenation.
|
|
34
|
+
on_test [script] :
|
|
35
|
+
show 'a' + 'b'
|
|
36
|
+
eval it = 'ab'
|
|
37
|
+
assert "expected it to be 'ab'"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Throw verb tests
|
|
3
|
+
#
|
|
4
|
+
# The on_error / on_exception routing is covered in
|
|
5
|
+
# lang/exceptions.test.gloo. These tests cover the verb itself:
|
|
6
|
+
# its message handling and that execution continues afterward.
|
|
7
|
+
#
|
|
8
|
+
# Running these logs the thrown exception (message + backtrace) to
|
|
9
|
+
# the console by design.
|
|
10
|
+
#
|
|
11
|
+
|
|
12
|
+
tests [can] :
|
|
13
|
+
verbs [can] :
|
|
14
|
+
throw [can] :
|
|
15
|
+
|
|
16
|
+
on_exception [script] :
|
|
17
|
+
put ^.exception_data.message into ^.caught
|
|
18
|
+
|
|
19
|
+
exception_data [can] :
|
|
20
|
+
message [string] :
|
|
21
|
+
backtrace [string] :
|
|
22
|
+
|
|
23
|
+
caught [string] :
|
|
24
|
+
|
|
25
|
+
default_message [test] :
|
|
26
|
+
description [string] : bare throw uses the default message and execution continues.
|
|
27
|
+
on_test [script] :
|
|
28
|
+
put '' into tests.verbs.throw.caught
|
|
29
|
+
eval false
|
|
30
|
+
|
|
31
|
+
throw
|
|
32
|
+
eval true
|
|
33
|
+
assert "expected execution to continue after a bare throw"
|
|
34
|
+
|
|
35
|
+
eval tests.verbs.throw.caught = 'Thrown by throw verb'
|
|
36
|
+
assert "expected the default thrown message"
|
|
37
|
+
|
|
38
|
+
custom_message [test] :
|
|
39
|
+
description [string] : throw evaluates its argument as the message.
|
|
40
|
+
on_test [script] :
|
|
41
|
+
put '' into tests.verbs.throw.caught
|
|
42
|
+
throw 'boom ' + '42'
|
|
43
|
+
eval tests.verbs.throw.caught = 'boom 42'
|
|
44
|
+
assert "expected the evaluated custom message"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Unload verb / message tests
|
|
3
|
+
#
|
|
4
|
+
# The bare 'unload' verb unloads every loaded file (covered by the
|
|
5
|
+
# unit tests). Per-object unload is the 'unload' message, tested here.
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
tests [can] :
|
|
9
|
+
verbs [can] :
|
|
10
|
+
unload [can] :
|
|
11
|
+
|
|
12
|
+
unload_removes_object [test] :
|
|
13
|
+
description [string] : sending 'unload' to an object removes it from the tree.
|
|
14
|
+
on_test [script] :
|
|
15
|
+
create tests.verbs.unload.temp as string : 'x'
|
|
16
|
+
exists? instance tests.verbs.unload.temp
|
|
17
|
+
assert "temp should exist after create"
|
|
18
|
+
|
|
19
|
+
tell tests.verbs.unload.temp to unload
|
|
20
|
+
exists? instance tests.verbs.unload.temp
|
|
21
|
+
refute "temp should be gone after unload"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gloo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.
|
|
4
|
+
version: 6.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eric Crane
|
|
@@ -251,6 +251,7 @@ extensions: []
|
|
|
251
251
|
extra_rdoc_files: []
|
|
252
252
|
files:
|
|
253
253
|
- ".gitignore"
|
|
254
|
+
- ".mailmap"
|
|
254
255
|
- ".rubocop.yml"
|
|
255
256
|
- ".ruby-gemset"
|
|
256
257
|
- ".ruby-version"
|
|
@@ -431,9 +432,16 @@ files:
|
|
|
431
432
|
- test.gloo/dt/date.test.gloo
|
|
432
433
|
- test.gloo/dt/datetime.test.gloo
|
|
433
434
|
- test.gloo/dt/time.test.gloo
|
|
435
|
+
- test.gloo/lang/continuation.test.gloo
|
|
436
|
+
- test.gloo/lang/convert.test.gloo
|
|
434
437
|
- test.gloo/lang/dt_comparisons.test.gloo
|
|
435
438
|
- test.gloo/lang/exceptions.test.gloo
|
|
436
439
|
- test.gloo/lang/gloo_sys.test.gloo
|
|
440
|
+
- test.gloo/lang/here.test.gloo
|
|
441
|
+
- test.gloo/lang/it.test.gloo
|
|
442
|
+
- test.gloo/lang/literal.test.gloo
|
|
443
|
+
- test.gloo/lang/load_lib_directive.test.gloo
|
|
444
|
+
- test.gloo/lang/naming.test.gloo
|
|
437
445
|
- test.gloo/lang/ops.test.gloo
|
|
438
446
|
- test.gloo/math/add.test.gloo
|
|
439
447
|
- test.gloo/math/div.test.gloo
|
|
@@ -442,29 +450,43 @@ files:
|
|
|
442
450
|
- test.gloo/objs/alias.test.gloo
|
|
443
451
|
- test.gloo/objs/bool.test.gloo
|
|
444
452
|
- test.gloo/objs/can.test.gloo
|
|
453
|
+
- test.gloo/objs/cipher.test.gloo
|
|
445
454
|
- test.gloo/objs/decimal.test.gloo
|
|
446
455
|
- test.gloo/objs/erb.test.gloo
|
|
456
|
+
- test.gloo/objs/file.test.gloo
|
|
457
|
+
- test.gloo/objs/function.test.gloo
|
|
447
458
|
- test.gloo/objs/int.test.gloo
|
|
459
|
+
- test.gloo/objs/json.test.gloo
|
|
448
460
|
- test.gloo/objs/obj.test.gloo
|
|
461
|
+
- test.gloo/objs/outline.test.gloo
|
|
462
|
+
- test.gloo/objs/password.test.gloo
|
|
463
|
+
- test.gloo/objs/repeat.test.gloo
|
|
449
464
|
- test.gloo/objs/script.test.gloo
|
|
450
465
|
- test.gloo/objs/string.test.gloo
|
|
451
466
|
- test.gloo/objs/text.test.gloo
|
|
452
467
|
- test.gloo/objs/untyped.test.gloo
|
|
468
|
+
- test.gloo/objs/uri.test.gloo
|
|
453
469
|
- test.gloo/string/str.test.gloo
|
|
454
470
|
- test.gloo/string/str_gen.test.gloo
|
|
455
471
|
- test.gloo/verbs/break.test.gloo
|
|
456
472
|
- test.gloo/verbs/check.test.gloo
|
|
473
|
+
- test.gloo/verbs/context.test.gloo
|
|
457
474
|
- test.gloo/verbs/create.test.gloo
|
|
458
475
|
- test.gloo/verbs/eval.test.gloo
|
|
459
476
|
- test.gloo/verbs/exists.test.gloo
|
|
460
477
|
- test.gloo/verbs/if.test.gloo
|
|
461
478
|
- test.gloo/verbs/invoke.test.gloo
|
|
479
|
+
- test.gloo/verbs/list.test.gloo
|
|
480
|
+
- test.gloo/verbs/load.test.gloo
|
|
462
481
|
- test.gloo/verbs/log.test.gloo
|
|
463
482
|
- test.gloo/verbs/move.test.gloo
|
|
464
483
|
- test.gloo/verbs/put.test.gloo
|
|
465
484
|
- test.gloo/verbs/run.test.gloo
|
|
485
|
+
- test.gloo/verbs/show.test.gloo
|
|
466
486
|
- test.gloo/verbs/tell.test.gloo
|
|
487
|
+
- test.gloo/verbs/throw.test.gloo
|
|
467
488
|
- test.gloo/verbs/unless.test.gloo
|
|
489
|
+
- test.gloo/verbs/unload.test.gloo
|
|
468
490
|
homepage: https://github.com/ecrane/gloo
|
|
469
491
|
licenses:
|
|
470
492
|
- MIT
|