gloo 6.7.1 → 7.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/CLAUDE.md +1 -0
- data/docs/application.md +3 -1
- data/docs/iterators.md +39 -3
- data/docs/language_syntax.md +53 -5
- data/docs/objects.md +58 -1
- data/docs/operators.md +16 -0
- data/docs/plugins.md +9 -1
- data/docs/verbs.md +4 -2
- data/lib/VERSION +1 -1
- data/lib/VERSION_NOTES +24 -0
- data/lib/gloo/app/engine.rb +65 -9
- data/lib/gloo/app/log.rb +47 -6
- data/lib/gloo/convert/converter.rb +63 -2
- data/lib/gloo/convert/string_to_date.rb +14 -0
- data/lib/gloo/convert/string_to_datetime.rb +16 -0
- data/lib/gloo/convert/string_to_decimal.rb +13 -0
- data/lib/gloo/convert/string_to_integer.rb +9 -2
- data/lib/gloo/convert/string_to_time.rb +28 -0
- data/lib/gloo/core/dictionary.rb +30 -21
- data/lib/gloo/core/error.rb +11 -2
- data/lib/gloo/core/event_manager.rb +7 -4
- data/lib/gloo/core/factory.rb +16 -11
- data/lib/gloo/core/here.rb +6 -1
- data/lib/gloo/core/invoker.rb +2 -3
- data/lib/gloo/core/not_found.rb +42 -0
- data/lib/gloo/core/obj.rb +28 -2
- data/lib/gloo/core/op.rb +2 -0
- data/lib/gloo/core/parser.rb +1 -1
- data/lib/gloo/core/pn.rb +33 -12
- data/lib/gloo/core/tokens.rb +38 -0
- data/lib/gloo/core/verb.rb +54 -0
- data/lib/gloo/exec/dispatch.rb +5 -6
- data/lib/gloo/exec/exec_env.rb +13 -0
- data/lib/gloo/exec/runner.rb +10 -2
- data/lib/gloo/exec/script.rb +13 -1
- data/lib/gloo/expr/expression.rb +39 -1
- data/lib/gloo/expr/op_plus.rb +3 -0
- data/lib/gloo/objs/basic/boolean.rb +16 -0
- data/lib/gloo/objs/basic/container.rb +154 -6
- data/lib/gloo/objs/basic/decimal.rb +1 -0
- data/lib/gloo/objs/basic/integer.rb +1 -0
- data/lib/gloo/objs/basic/string.rb +0 -1
- data/lib/gloo/objs/basic/string_msgs.rb +68 -32
- data/lib/gloo/objs/ctrl/each.rb +22 -3
- data/lib/gloo/objs/ctrl/each_dir.rb +20 -7
- data/lib/gloo/objs/ctrl/each_file.rb +78 -9
- data/lib/gloo/objs/ctrl/function.rb +6 -5
- data/lib/gloo/objs/dt/date.rb +28 -11
- data/lib/gloo/objs/dt/datetime.rb +72 -21
- data/lib/gloo/objs/dt/dt_tools.rb +46 -2
- data/lib/gloo/objs/dt/time.rb +28 -11
- data/lib/gloo/objs/str_utils/cipher.rb +17 -4
- data/lib/gloo/objs/str_utils/password.rb +6 -2
- data/lib/gloo/objs/system/erb.rb +9 -3
- data/lib/gloo/objs/system/file_handle.rb +57 -21
- data/lib/gloo/objs/system/system.rb +6 -2
- data/lib/gloo/objs/web/http_get.rb +12 -2
- data/lib/gloo/objs/web/http_post.rb +6 -2
- data/lib/gloo/objs/web/json.rb +38 -18
- data/lib/gloo/objs/web/uri.rb +36 -16
- data/lib/gloo/persist/file_loader.rb +72 -11
- data/lib/gloo/persist/file_saver.rb +2 -1
- data/lib/gloo/persist/indent_stack.rb +49 -33
- data/lib/gloo/persist/line_splitter.rb +40 -3
- data/lib/gloo/persist/persist_man.rb +2 -4
- data/lib/gloo/plugin/callback.rb +2 -2
- data/lib/gloo/plugin/ext_manager.rb +6 -9
- data/lib/gloo/plugin/lib_manager.rb +2 -2
- data/lib/gloo/verbs/break.rb +1 -0
- data/lib/gloo/verbs/check.rb +1 -1
- data/lib/gloo/verbs/cls.rb +1 -0
- data/lib/gloo/verbs/create.rb +32 -4
- data/lib/gloo/verbs/execute.rb +1 -1
- data/lib/gloo/verbs/exists.rb +27 -15
- data/lib/gloo/verbs/files.rb +2 -1
- data/lib/gloo/verbs/help.rb +1 -0
- data/lib/gloo/verbs/if.rb +1 -1
- data/lib/gloo/verbs/invoke.rb +1 -1
- data/lib/gloo/verbs/list.rb +4 -3
- data/lib/gloo/verbs/load.rb +3 -3
- data/lib/gloo/verbs/move.rb +10 -8
- data/lib/gloo/verbs/put.rb +20 -8
- data/lib/gloo/verbs/quit.rb +1 -0
- data/lib/gloo/verbs/redirect.rb +8 -2
- data/lib/gloo/verbs/reload.rb +9 -1
- data/lib/gloo/verbs/run.rb +2 -2
- data/lib/gloo/verbs/save.rb +4 -2
- data/lib/gloo/verbs/tell.rb +1 -1
- data/lib/gloo/verbs/unless.rb +1 -1
- data/lib/gloo/verbs/unload.rb +8 -0
- data/test.gloo/ctrl/each.test.gloo +88 -0
- data/test.gloo/lang/declaration.test.gloo +27 -0
- data/test.gloo/lang/exceptions.test.gloo +60 -0
- data/test.gloo/lang/failures.test.gloo +139 -0
- data/test.gloo/lang/it.test.gloo +133 -0
- data/test.gloo/lang/naming.test.gloo +11 -0
- data/test.gloo/lang/ops.test.gloo +30 -0
- data/test.gloo/objs/can.test.gloo +101 -0
- data/test.gloo/objs/string.test.gloo +24 -0
- data/test.gloo/string/str.test.gloo +28 -0
- data/test.gloo/verbs/create.test.gloo +36 -0
- data/test.gloo/verbs/exists.test.gloo +33 -1
- data/test.gloo/verbs/unload.test.gloo +34 -0
- metadata +6 -6
|
@@ -131,3 +131,31 @@ tests [can] :
|
|
|
131
131
|
tell ^^.s to substring? ('lo w')
|
|
132
132
|
assert "expected it to be true that s contains 'lo w'"
|
|
133
133
|
|
|
134
|
+
|
|
135
|
+
#
|
|
136
|
+
# format_for_html: each leading space becomes one (not the
|
|
137
|
+
# plus the space), and it gets the formatted string.
|
|
138
|
+
#
|
|
139
|
+
|
|
140
|
+
tests.string_html [can] :
|
|
141
|
+
|
|
142
|
+
s [string] :
|
|
143
|
+
|
|
144
|
+
leading_spaces_appear_once [test] :
|
|
145
|
+
description [string] : format_for_html turns leading spaces into once, and puts the result in it.
|
|
146
|
+
on_test [script] :
|
|
147
|
+
put ' b' into ^^.s
|
|
148
|
+
tell ^^.s to format_for_html
|
|
149
|
+
eval it = ' b'
|
|
150
|
+
assert "expected it to have the formatted string"
|
|
151
|
+
|
|
152
|
+
eval ^^.s = ' b'
|
|
153
|
+
assert "expected each leading space once, as "
|
|
154
|
+
|
|
155
|
+
inner_spaces_are_kept [test] :
|
|
156
|
+
description [string] : Only leading spaces are converted.
|
|
157
|
+
on_test [script] :
|
|
158
|
+
put ' a b' into ^^.s
|
|
159
|
+
tell ^^.s to format_for_html
|
|
160
|
+
eval ^^.s = ' a b'
|
|
161
|
+
assert "expected the inner space to stay a space"
|
|
@@ -10,3 +10,39 @@ tests.verbs.create [can] :
|
|
|
10
10
|
create cx as string : 'hello'
|
|
11
11
|
eval it = 'hello'
|
|
12
12
|
assert "expected it to equal the created value"
|
|
13
|
+
|
|
14
|
+
tests.verbs.create_names [can] :
|
|
15
|
+
|
|
16
|
+
err_fired [bool] : false
|
|
17
|
+
list [can] :
|
|
18
|
+
n [int] : 3
|
|
19
|
+
before [int] : 0
|
|
20
|
+
slot [alias] :
|
|
21
|
+
|
|
22
|
+
on_error [script] :
|
|
23
|
+
put true into ^.err_fired
|
|
24
|
+
|
|
25
|
+
parenthesised_name_is_an_error [test] :
|
|
26
|
+
description [string] : create doesn't compute a name; a parenthesised one is reported and nothing is created.
|
|
27
|
+
on_test [script] :
|
|
28
|
+
tell ^^.list to count
|
|
29
|
+
put it into ^^.before
|
|
30
|
+
put false into ^^.err_fired
|
|
31
|
+
create ( 'tests.verbs.create_names.list.' + ^^.n ) as string
|
|
32
|
+
eval it = false
|
|
33
|
+
assert "expected it to be false"
|
|
34
|
+
|
|
35
|
+
eval ^^.err_fired = true
|
|
36
|
+
assert "expected a parenthesised name to be an error"
|
|
37
|
+
|
|
38
|
+
tell ^^.list to count
|
|
39
|
+
eval it = ^^.before
|
|
40
|
+
assert "expected nothing to be created"
|
|
41
|
+
|
|
42
|
+
alias_computes_the_name [test] :
|
|
43
|
+
description [string] : The way to create at a computed path: point an alias at it, then create the alias.
|
|
44
|
+
on_test [script] :
|
|
45
|
+
put 'tests.verbs.create_names.list.' + ^^.n into ^^.slot*
|
|
46
|
+
create ^^.slot* as string
|
|
47
|
+
exists? instance tests.verbs.create_names.list.3
|
|
48
|
+
assert "expected the object to be created at the computed path"
|
|
@@ -44,4 +44,36 @@ tests.verbs.exists [can] :
|
|
|
44
44
|
assert "expected instance to exist"
|
|
45
45
|
|
|
46
46
|
exists? instance tests.verbs.exists.instance2
|
|
47
|
-
refute "expected instance to not exist"
|
|
47
|
+
refute "expected instance to not exist"
|
|
48
|
+
any_finds_an_instance [test] :
|
|
49
|
+
description [string] : With no kind, exists? finds an object instance too.
|
|
50
|
+
on_test [script] :
|
|
51
|
+
exists? tests.verbs.exists.instance
|
|
52
|
+
assert "expected exists? with no kind to find the instance"
|
|
53
|
+
|
|
54
|
+
exists? any tests.verbs.exists.instance
|
|
55
|
+
assert "expected exists? any to find the instance"
|
|
56
|
+
|
|
57
|
+
exists? tests.verbs.exists.instance2
|
|
58
|
+
refute "expected a missing instance to not exist"
|
|
59
|
+
|
|
60
|
+
exists? object tests.verbs.exists.instance
|
|
61
|
+
refute "expected object to check for a type, not an instance"
|
|
62
|
+
|
|
63
|
+
tests.verbs.exists_unknown_kind [can] :
|
|
64
|
+
|
|
65
|
+
err_fired [bool] : false
|
|
66
|
+
|
|
67
|
+
on_error [script] :
|
|
68
|
+
put true into ^.err_fired
|
|
69
|
+
|
|
70
|
+
unknown_kind_is_an_error [test] :
|
|
71
|
+
description [string] : A misspelled kind is reported, not answered false.
|
|
72
|
+
on_test [script] :
|
|
73
|
+
put false into ^^.err_fired
|
|
74
|
+
exists? instanse tests.verbs.exists_unknown_kind
|
|
75
|
+
eval it = false
|
|
76
|
+
assert "expected it to be false"
|
|
77
|
+
|
|
78
|
+
eval ^^.err_fired = true
|
|
79
|
+
assert "expected an unknown kind to be an error"
|
|
@@ -17,3 +17,37 @@ tests.verbs.unload [can] :
|
|
|
17
17
|
tell tests.verbs.unload.temp to unload
|
|
18
18
|
exists? instance tests.verbs.unload.temp
|
|
19
19
|
refute "temp should be gone after unload"
|
|
20
|
+
|
|
21
|
+
#
|
|
22
|
+
# The unload verb takes no object: 'unload x' is an error, and nothing
|
|
23
|
+
# is unloaded. (If this ever regressed, it would unload the test run.)
|
|
24
|
+
#
|
|
25
|
+
|
|
26
|
+
tests.verbs.unload_no_object [can] :
|
|
27
|
+
|
|
28
|
+
err_fired [bool] : false
|
|
29
|
+
temp [string] : still here
|
|
30
|
+
|
|
31
|
+
on_error [script] :
|
|
32
|
+
put true into ^.err_fired
|
|
33
|
+
|
|
34
|
+
error_data [can] :
|
|
35
|
+
message [string] :
|
|
36
|
+
backtrace [string] :
|
|
37
|
+
kind [string] :
|
|
38
|
+
location [string] :
|
|
39
|
+
|
|
40
|
+
unload_with_an_object_unloads_nothing [test] :
|
|
41
|
+
description [string] : 'unload x' reports an error, points to 'tell x to unload', and unloads nothing.
|
|
42
|
+
on_test [script] :
|
|
43
|
+
put false into ^^.err_fired
|
|
44
|
+
unload tests.verbs.unload_no_object.temp
|
|
45
|
+
|
|
46
|
+
eval ^^.err_fired = true
|
|
47
|
+
assert "expected unload with an object to be an error"
|
|
48
|
+
|
|
49
|
+
eval ^^.error_data.message = "unload takes no object, so nothing was unloaded; to unload one object, use tell x to unload."
|
|
50
|
+
assert "expected the error to point to tell x to unload"
|
|
51
|
+
|
|
52
|
+
exists? instance tests.verbs.unload_no_object.temp
|
|
53
|
+
assert "expected temp to still be loaded"
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gloo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: '7.0'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eric Crane
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: bundler
|
|
@@ -319,6 +318,7 @@ files:
|
|
|
319
318
|
- lib/gloo/core/invoker.rb
|
|
320
319
|
- lib/gloo/core/it.rb
|
|
321
320
|
- lib/gloo/core/literal.rb
|
|
321
|
+
- lib/gloo/core/not_found.rb
|
|
322
322
|
- lib/gloo/core/obj.rb
|
|
323
323
|
- lib/gloo/core/obj_finder.rb
|
|
324
324
|
- lib/gloo/core/op.rb
|
|
@@ -447,8 +447,10 @@ files:
|
|
|
447
447
|
- test.gloo/dt/time.test.gloo
|
|
448
448
|
- test.gloo/lang/continuation.test.gloo
|
|
449
449
|
- test.gloo/lang/convert.test.gloo
|
|
450
|
+
- test.gloo/lang/declaration.test.gloo
|
|
450
451
|
- test.gloo/lang/dt_comparisons.test.gloo
|
|
451
452
|
- test.gloo/lang/exceptions.test.gloo
|
|
453
|
+
- test.gloo/lang/failures.test.gloo
|
|
452
454
|
- test.gloo/lang/gloo_sys.test.gloo
|
|
453
455
|
- test.gloo/lang/here.test.gloo
|
|
454
456
|
- test.gloo/lang/it.test.gloo
|
|
@@ -508,7 +510,6 @@ licenses:
|
|
|
508
510
|
- MIT
|
|
509
511
|
metadata:
|
|
510
512
|
documentation_uri: https://github.com/ecrane/gloo
|
|
511
|
-
post_install_message:
|
|
512
513
|
rdoc_options: []
|
|
513
514
|
require_paths:
|
|
514
515
|
- lib
|
|
@@ -523,8 +524,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
523
524
|
- !ruby/object:Gem::Version
|
|
524
525
|
version: '0'
|
|
525
526
|
requirements: []
|
|
526
|
-
rubygems_version:
|
|
527
|
-
signing_key:
|
|
527
|
+
rubygems_version: 4.0.17
|
|
528
528
|
specification_version: 4
|
|
529
529
|
summary: Gloo scripting language. A scripting language built on ruby.
|
|
530
530
|
test_files: []
|