gloo 6.2.1 → 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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.mailmap +1 -0
  3. data/docs/language_syntax.md +18 -2
  4. data/docs/objects.md +4 -0
  5. data/docs/plugins.md +12 -4
  6. data/docs/verbs.md +8 -0
  7. data/lib/VERSION +1 -1
  8. data/lib/VERSION_NOTES +4 -0
  9. data/lib/gloo/objs/basic/untyped.rb +14 -2
  10. data/lib/gloo/persist/file_loader.rb +27 -1
  11. data/lib/gloo/verbs/check.rb +16 -4
  12. data/lib/gloo/verbs/create.rb +8 -3
  13. data/lib/gloo/verbs/eval.rb +16 -2
  14. data/lib/gloo/verbs/tell.rb +15 -3
  15. data/lib/gloo/verbs/throw.rb +29 -1
  16. data/test.gloo/lang/continuation.test.gloo +39 -0
  17. data/test.gloo/lang/convert.test.gloo +70 -0
  18. data/test.gloo/lang/here.test.gloo +41 -0
  19. data/test.gloo/lang/it.test.gloo +41 -0
  20. data/test.gloo/lang/literal.test.gloo +61 -0
  21. data/test.gloo/lang/load_lib_directive.test.gloo +33 -0
  22. data/test.gloo/lang/naming.test.gloo +44 -0
  23. data/test.gloo/objs/cipher.test.gloo +45 -0
  24. data/test.gloo/objs/erb.test.gloo +18 -0
  25. data/test.gloo/objs/file.test.gloo +77 -0
  26. data/test.gloo/objs/function.test.gloo +54 -0
  27. data/test.gloo/objs/json.test.gloo +70 -0
  28. data/test.gloo/objs/outline.test.gloo +72 -0
  29. data/test.gloo/objs/password.test.gloo +40 -0
  30. data/test.gloo/objs/repeat.test.gloo +48 -0
  31. data/test.gloo/objs/untyped.test.gloo +20 -2
  32. data/test.gloo/objs/uri.test.gloo +43 -0
  33. data/test.gloo/verbs/context.test.gloo +19 -0
  34. data/test.gloo/verbs/list.test.gloo +34 -0
  35. data/test.gloo/verbs/load.test.gloo +32 -0
  36. data/test.gloo/verbs/show.test.gloo +37 -0
  37. data/test.gloo/verbs/throw.test.gloo +44 -0
  38. data/test.gloo/verbs/unload.test.gloo +21 -0
  39. metadata +23 -1
@@ -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.2.1
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