gloo 0.6.1 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/gloo/app/args.rb +48 -6
- data/lib/gloo/app/engine.rb +58 -39
- data/lib/gloo/app/help.rb +126 -25
- data/lib/gloo/app/info.rb +3 -1
- data/lib/gloo/app/log.rb +23 -0
- data/lib/gloo/app/mode.rb +2 -0
- data/lib/gloo/app/settings.rb +75 -68
- data/lib/gloo/convert/converter.rb +35 -0
- data/lib/gloo/convert/string_to_datetime.rb +1 -1
- data/lib/gloo/convert/string_to_decimal.rb +1 -1
- data/lib/gloo/convert/string_to_integer.rb +1 -1
- data/lib/gloo/core/dictionary.rb +99 -22
- data/lib/gloo/core/error.rb +19 -8
- data/lib/gloo/core/event_manager.rb +4 -0
- data/lib/gloo/core/factory.rb +11 -0
- data/lib/gloo/core/gloo_system.rb +1 -1
- data/lib/gloo/core/heap.rb +11 -3
- data/lib/gloo/core/it.rb +6 -0
- data/lib/gloo/core/literal.rb +5 -0
- data/lib/gloo/core/obj.rb +14 -0
- data/lib/gloo/core/op.rb +7 -0
- data/lib/gloo/core/parser.rb +6 -0
- data/lib/gloo/core/pn.rb +36 -0
- data/lib/gloo/core/tokens.rb +66 -22
- data/lib/gloo/core/verb.rb +4 -0
- data/lib/gloo/exec/exec_env.rb +13 -1
- data/lib/gloo/expr/expression.rb +26 -4
- data/lib/gloo/expr/l_boolean.rb +6 -0
- data/lib/gloo/expr/l_decimal.rb +5 -0
- data/lib/gloo/expr/l_integer.rb +7 -0
- data/lib/gloo/expr/l_string.rb +7 -0
- data/lib/gloo/expr/op_div.rb +2 -0
- data/lib/gloo/expr/op_minus.rb +2 -0
- data/lib/gloo/expr/op_mult.rb +2 -0
- data/lib/gloo/expr/op_plus.rb +2 -0
- data/lib/gloo/help/app/application.txt +22 -0
- data/lib/gloo/help/app/configuration.txt +7 -0
- data/lib/gloo/help/app/default_help.txt +14 -0
- data/lib/gloo/help/app/logging.txt +16 -0
- data/lib/gloo/help/core/color.txt +31 -0
- data/lib/gloo/help/core/error.txt +33 -0
- data/lib/gloo/help/core/events.txt +21 -0
- data/lib/gloo/help/core/gloo_system.txt +54 -0
- data/lib/gloo/help/core/here.txt +30 -0
- data/lib/gloo/help/core/it.txt +23 -0
- data/lib/gloo/help/core/ops.txt +16 -0
- data/lib/gloo/help/core/pathname.txt +29 -0
- data/lib/gloo/help/objs/basic/alias.txt +36 -0
- data/lib/gloo/help/objs/basic/boolean.txt +28 -0
- data/lib/gloo/help/objs/basic/container.txt +33 -0
- data/lib/gloo/help/objs/basic/decimal.txt +28 -0
- data/lib/gloo/help/objs/basic/integer.txt +27 -0
- data/lib/gloo/help/objs/basic/script.txt +29 -0
- data/lib/gloo/help/objs/basic/string.txt +28 -0
- data/lib/gloo/help/objs/basic/text.txt +27 -0
- data/lib/gloo/help/objs/basic/untyped.txt +22 -0
- data/lib/gloo/help/objs/cli/banner.txt +49 -0
- data/lib/gloo/help/objs/cli/bar.txt +34 -0
- data/lib/gloo/help/objs/cli/colorize.txt +33 -0
- data/lib/gloo/help/objs/cli/confirm.txt +26 -0
- data/lib/gloo/help/objs/cli/menu.txt +44 -0
- data/lib/gloo/help/objs/cli/menu_item.txt +26 -0
- data/lib/gloo/help/objs/cli/pastel.txt +43 -0
- data/lib/gloo/help/objs/cli/prompt.txt +27 -0
- data/lib/gloo/help/objs/cli/select.txt +34 -0
- data/lib/gloo/help/objs/ctrl/each.txt +48 -0
- data/lib/gloo/help/objs/ctrl/repeat.txt +38 -0
- data/lib/gloo/help/objs/data/markdown.txt +25 -0
- data/lib/gloo/help/objs/data/table.txt +46 -0
- data/lib/gloo/help/objs/dev/git_repo.txt +35 -0
- data/lib/gloo/help/objs/dt/date.txt +23 -0
- data/lib/gloo/help/objs/dt/datetime.txt +24 -0
- data/lib/gloo/help/objs/dt/time.txt +23 -0
- data/lib/gloo/help/objs/ror/erb.txt +37 -0
- data/lib/gloo/help/objs/ror/eval.txt +24 -0
- data/lib/gloo/help/objs/snd/play.txt +23 -0
- data/lib/gloo/help/objs/snd/say.txt +28 -0
- data/lib/gloo/help/objs/system/file.txt +48 -0
- data/lib/gloo/help/objs/system/system.txt +32 -0
- data/lib/gloo/help/objs/web/http_get.txt +35 -0
- data/lib/gloo/help/objs/web/http_post.txt +32 -0
- data/lib/gloo/help/objs/web/json.txt +34 -0
- data/lib/gloo/help/objs/web/slack.txt +33 -0
- data/lib/gloo/help/objs/web/teams.txt +30 -0
- data/lib/gloo/help/objs/web/uri.txt +37 -0
- data/lib/gloo/help/verbs/alert.txt +33 -0
- data/lib/gloo/help/verbs/beep.txt +25 -0
- data/lib/gloo/help/verbs/cls.txt +24 -0
- data/lib/gloo/help/verbs/context.txt +43 -0
- data/lib/gloo/help/verbs/create.txt +33 -0
- data/lib/gloo/help/verbs/execute.txt +27 -0
- data/lib/gloo/help/verbs/help.txt +34 -0
- data/lib/gloo/help/verbs/if.txt +37 -0
- data/lib/gloo/help/verbs/list.txt +34 -0
- data/lib/gloo/help/verbs/load.txt +38 -0
- data/lib/gloo/help/verbs/move.txt +42 -0
- data/lib/gloo/help/verbs/put.txt +38 -0
- data/lib/gloo/help/verbs/quit.txt +25 -0
- data/lib/gloo/help/verbs/run.txt +41 -0
- data/lib/gloo/help/verbs/save.txt +26 -0
- data/lib/gloo/help/verbs/show.txt +30 -0
- data/lib/gloo/help/verbs/tell.txt +34 -0
- data/lib/gloo/help/verbs/unless.txt +38 -0
- data/lib/gloo/help/verbs/version.txt +32 -0
- data/lib/gloo/help/verbs/wait.txt +29 -0
- data/lib/gloo/objs/basic/alias.rb +0 -33
- data/lib/gloo/objs/basic/boolean.rb +6 -27
- data/lib/gloo/objs/basic/container.rb +0 -33
- data/lib/gloo/objs/basic/decimal.rb +8 -28
- data/lib/gloo/objs/basic/integer.rb +5 -26
- data/lib/gloo/objs/basic/script.rb +0 -26
- data/lib/gloo/objs/basic/string.rb +6 -26
- data/lib/gloo/objs/basic/text.rb +0 -25
- data/lib/gloo/objs/basic/untyped.rb +0 -26
- data/lib/gloo/objs/cli/banner.rb +0 -29
- data/lib/gloo/objs/cli/bar.rb +0 -29
- data/lib/gloo/objs/cli/colorize.rb +4 -34
- data/lib/gloo/objs/cli/confirm.rb +6 -36
- data/lib/gloo/objs/cli/menu.rb +4 -34
- data/lib/gloo/objs/cli/menu_item.rb +0 -33
- data/lib/gloo/objs/cli/pastel.rb +4 -27
- data/lib/gloo/objs/cli/prompt.rb +4 -28
- data/lib/gloo/objs/cli/select.rb +4 -31
- data/lib/gloo/objs/ctrl/each.rb +33 -33
- data/lib/gloo/objs/ctrl/repeat.rb +8 -29
- data/lib/gloo/objs/data/markdown.rb +0 -25
- data/lib/gloo/objs/data/table.rb +4 -32
- data/lib/gloo/objs/dev/git.rb +12 -30
- data/lib/gloo/objs/dt/date.rb +3 -25
- data/lib/gloo/objs/dt/datetime.rb +4 -26
- data/lib/gloo/objs/dt/time.rb +3 -25
- data/lib/gloo/objs/ror/erb.rb +11 -45
- data/lib/gloo/objs/ror/eval.rb +11 -38
- data/lib/gloo/objs/snd/play.rb +2 -25
- data/lib/gloo/objs/snd/say.rb +9 -31
- data/lib/gloo/objs/system/file_handle.rb +7 -36
- data/lib/gloo/objs/system/system.rb +16 -46
- data/lib/gloo/objs/web/http_get.rb +57 -83
- data/lib/gloo/objs/web/http_post.rb +8 -31
- data/lib/gloo/objs/web/json.rb +11 -31
- data/lib/gloo/objs/web/slack.rb +7 -34
- data/lib/gloo/objs/web/teams.rb +13 -48
- data/lib/gloo/objs/web/uri.rb +0 -29
- data/lib/gloo/persist/file_loader.rb +8 -0
- data/lib/gloo/persist/file_saver.rb +6 -0
- data/lib/gloo/persist/file_storage.rb +2 -0
- data/lib/gloo/persist/line_splitter.rb +2 -0
- data/lib/gloo/persist/persist_man.rb +6 -0
- data/lib/gloo/verbs/alert.rb +30 -44
- data/lib/gloo/verbs/beep.rb +0 -30
- data/lib/gloo/verbs/cls.rb +0 -30
- data/lib/gloo/verbs/context.rb +9 -39
- data/lib/gloo/verbs/create.rb +17 -32
- data/lib/gloo/verbs/execute.rb +56 -0
- data/lib/gloo/verbs/help.rb +151 -115
- data/lib/gloo/verbs/if.rb +46 -44
- data/lib/gloo/verbs/list.rb +36 -54
- data/lib/gloo/verbs/load.rb +8 -37
- data/lib/gloo/verbs/move.rb +12 -51
- data/lib/gloo/verbs/put.rb +28 -52
- data/lib/gloo/verbs/quit.rb +0 -31
- data/lib/gloo/verbs/run.rb +23 -39
- data/lib/gloo/verbs/save.rb +0 -33
- data/lib/gloo/verbs/show.rb +6 -31
- data/lib/gloo/verbs/tell.rb +31 -31
- data/lib/gloo/verbs/unless.rb +47 -46
- data/lib/gloo/verbs/version.rb +0 -30
- data/lib/gloo/verbs/wait.rb +0 -31
- metadata +74 -3
- data/lib/gloo/help/help.md +0 -16
data/lib/gloo/expr/op_plus.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
GLOO APPLICATION
|
2
|
+
|
3
|
+
DESCRIPTION
|
4
|
+
Gloo scripting language. A scripting language built on ruby.
|
5
|
+
More information coming soon.
|
6
|
+
|
7
|
+
SYNOPSIS
|
8
|
+
gloo [global option] [file]
|
9
|
+
|
10
|
+
GLOBAL OPTIONS
|
11
|
+
--cli - Run in CLI mode
|
12
|
+
- If no options are specified, this is the default.
|
13
|
+
--version - Show application version
|
14
|
+
--help - Show this help page
|
15
|
+
|
16
|
+
FILE
|
17
|
+
TODO: document running a gloo script
|
18
|
+
how to reference files by relative path in gloo folder
|
19
|
+
and also by absolute path
|
20
|
+
|
21
|
+
SEE ALSO
|
22
|
+
application, configuration
|
@@ -0,0 +1,14 @@
|
|
1
|
+
GLOO HELP
|
2
|
+
|
3
|
+
TODO: write this article
|
4
|
+
|
5
|
+
LISTS
|
6
|
+
Show options for object and verb lists
|
7
|
+
|
8
|
+
DETAIL
|
9
|
+
How to get help detail for verbs and objects
|
10
|
+
How to see a help pages
|
11
|
+
How to see a list of help pages (topics)
|
12
|
+
|
13
|
+
SEE ALSO
|
14
|
+
application, configuration
|
@@ -0,0 +1,16 @@
|
|
1
|
+
GLOO APPLICATION LOGGING
|
2
|
+
|
3
|
+
DESCRIPTION
|
4
|
+
Gloo writes to the gloo.log as well as to the console.
|
5
|
+
Debug messages are written to the log only, but other messages
|
6
|
+
are also written to the console unless the application is
|
7
|
+
running in quiet mode.
|
8
|
+
|
9
|
+
CONFIGURATION
|
10
|
+
The application logs folder is in the gloo folder.
|
11
|
+
When gloo is run, the gloo.log file will be written to.
|
12
|
+
|
13
|
+
TAIL
|
14
|
+
Example tail command to watch the gloo log:
|
15
|
+
|
16
|
+
tail -f ~/gloo/logs/gloo.log
|
@@ -0,0 +1,31 @@
|
|
1
|
+
COLOR
|
2
|
+
|
3
|
+
DESCRIPTION
|
4
|
+
The following colors can be used by the show verb to display
|
5
|
+
colored text:
|
6
|
+
|
7
|
+
red
|
8
|
+
blue
|
9
|
+
green
|
10
|
+
white
|
11
|
+
black
|
12
|
+
yellow
|
13
|
+
|
14
|
+
The color names are considered as virtual objects but may
|
15
|
+
also be referenced in variables. See the example below.
|
16
|
+
|
17
|
+
EXAMPLE
|
18
|
+
Here are some examples of expression usage:
|
19
|
+
|
20
|
+
#
|
21
|
+
# Show multiple messages in color
|
22
|
+
#
|
23
|
+
colors [can] :
|
24
|
+
var [string] : red
|
25
|
+
on_load [script] :
|
26
|
+
show "red" (colors.var)
|
27
|
+
show "blue" (blue)
|
28
|
+
show "green" (green)
|
29
|
+
|
30
|
+
SEE ALSO
|
31
|
+
show
|
@@ -0,0 +1,33 @@
|
|
1
|
+
ERROR
|
2
|
+
|
3
|
+
DESCRIPTION
|
4
|
+
Gloo has a special 'error' variable that's not part of the normal
|
5
|
+
object heap. The error will be empty most of the time, but
|
6
|
+
if a command results in an error, this variable will hold the
|
7
|
+
error message until the next command is executed. The error
|
8
|
+
is a string and can be accessed by simply referring to the
|
9
|
+
path-name 'error'.
|
10
|
+
|
11
|
+
EXAMPLE
|
12
|
+
To see the last error:
|
13
|
+
|
14
|
+
> show error
|
15
|
+
|
16
|
+
To run a command that generates an error:
|
17
|
+
|
18
|
+
> put 3 into
|
19
|
+
'put' must include 'into' target
|
20
|
+
|
21
|
+
Then, showing the error
|
22
|
+
|
23
|
+
> show error
|
24
|
+
'put' must include 'into' target
|
25
|
+
|
26
|
+
But, as mentioned, the next command will clear out the last error.
|
27
|
+
If you need to keep track of the result of a command, you should
|
28
|
+
put the error into another object.
|
29
|
+
|
30
|
+
> create err as string
|
31
|
+
> put 3 into
|
32
|
+
> put error into err
|
33
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
EVENTS
|
2
|
+
|
3
|
+
DESCRIPTION
|
4
|
+
Scripts can be written to be triggered by events. The current list is as
|
5
|
+
follows, but it is expected that the list of events will grow.
|
6
|
+
|
7
|
+
on_load - run when a script loads
|
8
|
+
on_unload - run when an object receives an unload message
|
9
|
+
|
10
|
+
TODO: add event types.
|
11
|
+
|
12
|
+
EXAMPLE
|
13
|
+
Show a message when a file is loaded:
|
14
|
+
|
15
|
+
start [container] :
|
16
|
+
on_load [script] : show "Welcome back!" (white)
|
17
|
+
|
18
|
+
Show a message when a file unloaded:
|
19
|
+
|
20
|
+
done [container] :
|
21
|
+
on_unload [script] : show "See ya soon!" (white)
|
@@ -0,0 +1,54 @@
|
|
1
|
+
GLOO SYSTEM OBJECTS
|
2
|
+
|
3
|
+
DESCRIPTION
|
4
|
+
The gloo system objects are virtual objects. That is that they
|
5
|
+
can be accessed like other objects. But the values are set by
|
6
|
+
the system. The values cannot be updated. The other difference
|
7
|
+
is that the virtual objects do not show up in the object heap.
|
8
|
+
|
9
|
+
ACCESS
|
10
|
+
The gloo objects can be accessed through the 'gloo' root level
|
11
|
+
virtual object designation. There is also a shortcut for the virtual
|
12
|
+
object path: '$'. For example, to see the current user:
|
13
|
+
|
14
|
+
> show gloo.user
|
15
|
+
|
16
|
+
Or:
|
17
|
+
|
18
|
+
> show $.user
|
19
|
+
|
20
|
+
Some objects include an '_' to separate words. As an alternative,
|
21
|
+
a '.' can be used instead. The following commands are treated as
|
22
|
+
identical:
|
23
|
+
|
24
|
+
> show gloo.working_dir
|
25
|
+
> show gloo.working.dir
|
26
|
+
> show $.working_dir
|
27
|
+
> show $.working.dir
|
28
|
+
|
29
|
+
OBJECTS
|
30
|
+
|
31
|
+
IDENTITY
|
32
|
+
gloo.hostname # Get the system hostname.
|
33
|
+
gloo.user # Get the logged in User.
|
34
|
+
|
35
|
+
FILE SYSTEM
|
36
|
+
gloo.user_home # Get the user's home directory.
|
37
|
+
gloo.working_dir # Get the working directory.
|
38
|
+
gloo.gloo_home # Get the gloo home directory
|
39
|
+
gloo.gloo_config # Get the gloo configuration directory
|
40
|
+
gloo.gloo_projects # Get the gloo projects directory
|
41
|
+
gloo.gloo_log # Get the gloo logging directory
|
42
|
+
|
43
|
+
SCREEN
|
44
|
+
gloo.screen_lines # Get the number of lines on screen.
|
45
|
+
gloo.screen_cols # Get the number of columns on screen.
|
46
|
+
|
47
|
+
PLATFORM
|
48
|
+
gloo.platform_cpu # Get the platform CPU
|
49
|
+
gloo.platform_os # Get the platform Operating System
|
50
|
+
gloo.platform_version # Get the platform version
|
51
|
+
gloo.platform_windows? # Is the platform Windows?
|
52
|
+
gloo.platform_unix? # Is the platform Unix?
|
53
|
+
gloo.platform_linux? # Is the platform Linux?
|
54
|
+
gloo.platform_mac? # Is the platform Mac?
|
@@ -0,0 +1,30 @@
|
|
1
|
+
HERE
|
2
|
+
|
3
|
+
DESCRIPTION
|
4
|
+
Gloo scripts can use relative referencing to access objects
|
5
|
+
without specifying the full path. This relative referencing is
|
6
|
+
referred to with the 'here' operator: ^
|
7
|
+
|
8
|
+
EXAMPLE
|
9
|
+
In the following script, the here reference is used several times:
|
10
|
+
|
11
|
+
#
|
12
|
+
# Use here reference.
|
13
|
+
#
|
14
|
+
here [can] :
|
15
|
+
s [str] : local string
|
16
|
+
on_load [script] : show ^.s
|
17
|
+
a [can] :
|
18
|
+
s [str] : A string
|
19
|
+
b [can] :
|
20
|
+
s [str] : B string
|
21
|
+
on_load [script] :
|
22
|
+
show ^.s
|
23
|
+
show ^^.s
|
24
|
+
|
25
|
+
A single use of '^' means: refer to an object at the same level
|
26
|
+
as the running script. It tells the interpreter to 'look here'
|
27
|
+
for the object.
|
28
|
+
|
29
|
+
Use of two ^^ here references means to go up a level, and
|
30
|
+
so forth.
|
@@ -0,0 +1,23 @@
|
|
1
|
+
IT
|
2
|
+
|
3
|
+
DESCRIPTION
|
4
|
+
'It' is a special virtual object. 'It' contains the value of
|
5
|
+
the last expression or command run. Not all commands result in
|
6
|
+
a change to the value of it.
|
7
|
+
|
8
|
+
EXAMPLE
|
9
|
+
Get the value of an expression and store it somewhere for later use:
|
10
|
+
|
11
|
+
#
|
12
|
+
# Example of usage of 'it'.
|
13
|
+
#
|
14
|
+
it_example [can] :
|
15
|
+
result [int] :
|
16
|
+
on_load [script] :
|
17
|
+
show 3 + 4
|
18
|
+
put it into ^.result
|
19
|
+
show ^.result
|
20
|
+
|
21
|
+
Running this script will show 7 twice. The first time will be the
|
22
|
+
result of the addition. The second time will be showing the
|
23
|
+
result object.
|
@@ -0,0 +1,29 @@
|
|
1
|
+
PATHNAME
|
2
|
+
|
3
|
+
DESCRIPTION
|
4
|
+
All gloo object data and scripts are stored in a heap of objects or
|
5
|
+
just "the heap". The heap is hierarchical, with some objects having
|
6
|
+
children objects. To reference an object, we use a "pathname". The
|
7
|
+
pathname starts with the root level object then has a period, ".",
|
8
|
+
then the child object name, and so forth. "a.b.c" refers to the "c"
|
9
|
+
object in the "b" container, which is in the "a" container.
|
10
|
+
|
11
|
+
ROOT
|
12
|
+
The word "root" is not needed when referring to objects. In some
|
13
|
+
special cases, "root" can be used to point to the first level of
|
14
|
+
the object heap. One such use would be with the "context" verb.
|
15
|
+
|
16
|
+
EXAMPLE
|
17
|
+
Here is an example of objects and a pathname reference to an
|
18
|
+
object within the hierarchy:
|
19
|
+
|
20
|
+
#
|
21
|
+
# Hierarchical containers.
|
22
|
+
#
|
23
|
+
a [can] :
|
24
|
+
b [can] :
|
25
|
+
c [string] : Hello World
|
26
|
+
on_load [script] : show a.b.c
|
27
|
+
|
28
|
+
SEE ALSO
|
29
|
+
context
|
@@ -0,0 +1,36 @@
|
|
1
|
+
ALIAS OBJECT TYPE
|
2
|
+
NAME: alias
|
3
|
+
SHORTCUT: ln
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
A pointer to another object.
|
7
|
+
Normal path-name references will refere to the aliased object.
|
8
|
+
To refer to the alias itself, add an * at the end of the path-name.
|
9
|
+
This is neeed, for example, to set the value of the alias.
|
10
|
+
The value of the alias is merely the path-name of the
|
11
|
+
referenced object.
|
12
|
+
|
13
|
+
CHILDREN
|
14
|
+
None
|
15
|
+
|
16
|
+
MESSAGES
|
17
|
+
The alias will reflect the mesages of the object to which
|
18
|
+
it points.
|
19
|
+
The alias itself can receive the following message:
|
20
|
+
resolve - Check to see if the object referenced exists.
|
21
|
+
Sets it to true or false.
|
22
|
+
|
23
|
+
EXAMPLE
|
24
|
+
|
25
|
+
a [can] :
|
26
|
+
s [string] : a string
|
27
|
+
i [integer] : 13
|
28
|
+
ln [alias] : a.s
|
29
|
+
on_load [script] :
|
30
|
+
show a.ln
|
31
|
+
show a.ln*
|
32
|
+
put 'a.i' into a.ln*
|
33
|
+
put 7 into a.ln
|
34
|
+
show a.ln
|
35
|
+
|
36
|
+
SEE ALSO
|
@@ -0,0 +1,28 @@
|
|
1
|
+
BOOLEAN OBJECT TYPE
|
2
|
+
NAME: boolean
|
3
|
+
SHORTCUT: bool
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
A boolean value.
|
7
|
+
Value will be either true or false.
|
8
|
+
|
9
|
+
CHILDREN
|
10
|
+
None
|
11
|
+
|
12
|
+
MESSAGES
|
13
|
+
not - Set the boolean to the opposite of what it is now.
|
14
|
+
true - Set the boolean to true.
|
15
|
+
false - Set the boolean to false.
|
16
|
+
|
17
|
+
EXAMPLE
|
18
|
+
|
19
|
+
b [can] :
|
20
|
+
flag [boolean] : true
|
21
|
+
on_load [script] :
|
22
|
+
show b.flag
|
23
|
+
put false into b.flag
|
24
|
+
show b.flag
|
25
|
+
tell b.flag to not
|
26
|
+
show b.flag
|
27
|
+
|
28
|
+
SEE ALSO
|
@@ -0,0 +1,33 @@
|
|
1
|
+
CONTAINER OBJECT TYPE
|
2
|
+
NAME: container
|
3
|
+
SHORTCUT: can
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
A container of other objects.
|
7
|
+
A container is similar to a folder in a file system.
|
8
|
+
It can contain any number of objects including other containers.
|
9
|
+
The container structure provides direct access to any object
|
10
|
+
within it through the object.object.object path-name structure.
|
11
|
+
|
12
|
+
CHILDREN
|
13
|
+
None by default. But any container can have any number of
|
14
|
+
objects added to it.
|
15
|
+
|
16
|
+
MESSAGES
|
17
|
+
count - Count the number of children objects in the container.
|
18
|
+
The result is put in <it>.
|
19
|
+
delete_children - Delete all children objects from the container.
|
20
|
+
show_key_value_tbl - Show a table with key (name) and values
|
21
|
+
for all children in the container.
|
22
|
+
|
23
|
+
EXAMPLE
|
24
|
+
|
25
|
+
can [can] :
|
26
|
+
data [can] :
|
27
|
+
1 : one
|
28
|
+
2 : two
|
29
|
+
3 : three
|
30
|
+
on_load [script] :
|
31
|
+
tell can.data to show_key_value_table
|
32
|
+
|
33
|
+
SEE ALSO
|
@@ -0,0 +1,28 @@
|
|
1
|
+
DECIMAL OBJECT TYPE
|
2
|
+
NAME: decimal
|
3
|
+
SHORTCUT: num
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
A decimal (numeric) value.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
None
|
10
|
+
|
11
|
+
MESSAGES
|
12
|
+
round - Round to the nearest whole value.
|
13
|
+
If an optional parameter is included, round to the
|
14
|
+
precision specified.
|
15
|
+
|
16
|
+
EXAMPLE
|
17
|
+
|
18
|
+
d [can] :
|
19
|
+
x [decimal] : 100
|
20
|
+
on_load [script] :
|
21
|
+
show d.x
|
22
|
+
put d.x / 3 into d.x
|
23
|
+
show d.x
|
24
|
+
tell d.x to round (1)
|
25
|
+
show d.x
|
26
|
+
|
27
|
+
SEE ALSO
|
28
|
+
integer
|