gloo-lang 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/VERSION +1 -1
- data/lib/dependencies.rb +2 -2
- data/lib/gloo-lang.rb +1 -5
- data/lib/gloo_lang/app/args.rb +112 -0
- data/lib/gloo_lang/app/engine.rb +230 -0
- data/lib/gloo_lang/app/help.rb +156 -0
- data/lib/gloo_lang/app/log.rb +81 -0
- data/lib/gloo_lang/app/mode.rb +27 -0
- data/lib/gloo_lang/app/settings.rb +186 -0
- data/lib/gloo_lang/convert/converter.rb +35 -0
- data/lib/gloo_lang/convert/string_to_datetime.rb +21 -0
- data/lib/gloo_lang/convert/string_to_decimal.rb +20 -0
- data/lib/gloo_lang/convert/string_to_integer.rb +20 -0
- data/lib/gloo_lang/core/baseo.rb +30 -0
- data/lib/gloo_lang/core/dictionary.rb +181 -0
- data/lib/gloo_lang/core/error.rb +61 -0
- data/lib/gloo_lang/core/event_manager.rb +44 -0
- data/lib/gloo_lang/core/factory.rb +210 -0
- data/lib/gloo_lang/core/gloo_system.rb +266 -0
- data/lib/gloo_lang/core/heap.rb +52 -0
- data/lib/gloo_lang/core/here.rb +36 -0
- data/lib/gloo_lang/core/it.rb +36 -0
- data/lib/gloo_lang/core/literal.rb +30 -0
- data/lib/gloo_lang/core/obj.rb +303 -0
- data/lib/gloo_lang/core/obj_finder.rb +30 -0
- data/lib/gloo_lang/core/op.rb +40 -0
- data/lib/gloo_lang/core/parser.rb +59 -0
- data/lib/gloo_lang/core/pn.rb +188 -0
- data/lib/gloo_lang/core/tokens.rb +165 -0
- data/lib/gloo_lang/core/verb.rb +86 -0
- data/lib/gloo_lang/exec/action.rb +48 -0
- data/lib/gloo_lang/exec/dispatch.rb +40 -0
- data/lib/gloo_lang/exec/exec_env.rb +74 -0
- data/lib/gloo_lang/exec/runner.rb +45 -0
- data/lib/gloo_lang/exec/script.rb +49 -0
- data/lib/gloo_lang/exec/stack.rb +78 -0
- data/lib/gloo_lang/expr/expression.rb +118 -0
- data/lib/gloo_lang/expr/l_boolean.rb +36 -0
- data/lib/gloo_lang/expr/l_decimal.rb +39 -0
- data/lib/gloo_lang/expr/l_integer.rb +37 -0
- data/lib/gloo_lang/expr/l_string.rb +58 -0
- data/lib/gloo_lang/expr/op_div.rb +22 -0
- data/lib/gloo_lang/expr/op_minus.rb +22 -0
- data/lib/gloo_lang/expr/op_mult.rb +22 -0
- data/lib/gloo_lang/expr/op_plus.rb +24 -0
- data/lib/gloo_lang/help/app/application.txt +22 -0
- data/lib/gloo_lang/help/app/configuration.txt +7 -0
- data/lib/gloo_lang/help/app/default_help.txt +14 -0
- data/lib/gloo_lang/help/app/logging.txt +16 -0
- data/lib/gloo_lang/help/core/color.txt +31 -0
- data/lib/gloo_lang/help/core/error.txt +33 -0
- data/lib/gloo_lang/help/core/events.txt +21 -0
- data/lib/gloo_lang/help/core/gloo_system.txt +57 -0
- data/lib/gloo_lang/help/core/here.txt +30 -0
- data/lib/gloo_lang/help/core/it.txt +23 -0
- data/lib/gloo_lang/help/core/ops.txt +16 -0
- data/lib/gloo_lang/help/core/pathname.txt +29 -0
- data/lib/gloo_lang/help/objs/basic/alias.txt +36 -0
- data/lib/gloo_lang/help/objs/basic/boolean.txt +28 -0
- data/lib/gloo_lang/help/objs/basic/container.txt +33 -0
- data/lib/gloo_lang/help/objs/basic/decimal.txt +28 -0
- data/lib/gloo_lang/help/objs/basic/integer.txt +27 -0
- data/lib/gloo_lang/help/objs/basic/script.txt +29 -0
- data/lib/gloo_lang/help/objs/basic/string.txt +28 -0
- data/lib/gloo_lang/help/objs/basic/text.txt +27 -0
- data/lib/gloo_lang/help/objs/basic/untyped.txt +22 -0
- data/lib/gloo_lang/help/objs/cli/banner.txt +49 -0
- data/lib/gloo_lang/help/objs/cli/bar.txt +37 -0
- data/lib/gloo_lang/help/objs/cli/colorize.txt +33 -0
- data/lib/gloo_lang/help/objs/cli/confirm.txt +26 -0
- data/lib/gloo_lang/help/objs/cli/menu.txt +44 -0
- data/lib/gloo_lang/help/objs/cli/menu_item.txt +26 -0
- data/lib/gloo_lang/help/objs/cli/pastel.txt +43 -0
- data/lib/gloo_lang/help/objs/cli/prompt.txt +27 -0
- data/lib/gloo_lang/help/objs/cli/select.txt +34 -0
- data/lib/gloo_lang/help/objs/ctrl/each.txt +48 -0
- data/lib/gloo_lang/help/objs/ctrl/repeat.txt +38 -0
- data/lib/gloo_lang/help/objs/data/markdown.txt +25 -0
- data/lib/gloo_lang/help/objs/data/mysql.txt +40 -0
- data/lib/gloo_lang/help/objs/data/query.txt +37 -0
- data/lib/gloo_lang/help/objs/data/sqlite.txt +26 -0
- data/lib/gloo_lang/help/objs/data/table.txt +46 -0
- data/lib/gloo_lang/help/objs/dev/git_repo.txt +36 -0
- data/lib/gloo_lang/help/objs/dev/stats.txt +36 -0
- data/lib/gloo_lang/help/objs/dt/date.txt +23 -0
- data/lib/gloo_lang/help/objs/dt/datetime.txt +24 -0
- data/lib/gloo_lang/help/objs/dt/time.txt +23 -0
- data/lib/gloo_lang/help/objs/ror/erb.txt +37 -0
- data/lib/gloo_lang/help/objs/ror/eval.txt +24 -0
- data/lib/gloo_lang/help/objs/snd/play.txt +23 -0
- data/lib/gloo_lang/help/objs/snd/say.txt +28 -0
- data/lib/gloo_lang/help/objs/system/file.txt +48 -0
- data/lib/gloo_lang/help/objs/system/ssh_exec.txt +30 -0
- data/lib/gloo_lang/help/objs/system/system.txt +32 -0
- data/lib/gloo_lang/help/objs/web/http_get.txt +35 -0
- data/lib/gloo_lang/help/objs/web/http_post.txt +34 -0
- data/lib/gloo_lang/help/objs/web/json.txt +34 -0
- data/lib/gloo_lang/help/objs/web/slack.txt +33 -0
- data/lib/gloo_lang/help/objs/web/teams.txt +30 -0
- data/lib/gloo_lang/help/objs/web/uri.txt +38 -0
- data/lib/gloo_lang/help/verbs/alert.txt +33 -0
- data/lib/gloo_lang/help/verbs/beep.txt +25 -0
- data/lib/gloo_lang/help/verbs/cls.txt +24 -0
- data/lib/gloo_lang/help/verbs/context.txt +43 -0
- data/lib/gloo_lang/help/verbs/create.txt +33 -0
- data/lib/gloo_lang/help/verbs/execute.txt +27 -0
- data/lib/gloo_lang/help/verbs/help.txt +34 -0
- data/lib/gloo_lang/help/verbs/if.txt +37 -0
- data/lib/gloo_lang/help/verbs/list.txt +34 -0
- data/lib/gloo_lang/help/verbs/load.txt +38 -0
- data/lib/gloo_lang/help/verbs/move.txt +42 -0
- data/lib/gloo_lang/help/verbs/put.txt +38 -0
- data/lib/gloo_lang/help/verbs/quit.txt +25 -0
- data/lib/gloo_lang/help/verbs/run.txt +41 -0
- data/lib/gloo_lang/help/verbs/save.txt +26 -0
- data/lib/gloo_lang/help/verbs/show.txt +30 -0
- data/lib/gloo_lang/help/verbs/tell.txt +34 -0
- data/lib/gloo_lang/help/verbs/unless.txt +38 -0
- data/lib/gloo_lang/help/verbs/version.txt +32 -0
- data/lib/gloo_lang/help/verbs/wait.txt +29 -0
- data/lib/gloo_lang/objs/basic/alias.rb +78 -0
- data/lib/gloo_lang/objs/basic/boolean.rb +120 -0
- data/lib/gloo_lang/objs/basic/container.rb +76 -0
- data/lib/gloo_lang/objs/basic/decimal.rb +76 -0
- data/lib/gloo_lang/objs/basic/integer.rb +73 -0
- data/lib/gloo_lang/objs/basic/script.rb +99 -0
- data/lib/gloo_lang/objs/basic/string.rb +77 -0
- data/lib/gloo_lang/objs/basic/text.rb +87 -0
- data/lib/gloo_lang/objs/basic/untyped.rb +41 -0
- data/lib/gloo_lang/objs/cli/banner.rb +108 -0
- data/lib/gloo_lang/objs/cli/bar.rb +133 -0
- data/lib/gloo_lang/objs/cli/colorize.rb +73 -0
- data/lib/gloo_lang/objs/cli/confirm.rb +96 -0
- data/lib/gloo_lang/objs/cli/menu.rb +206 -0
- data/lib/gloo_lang/objs/cli/menu_item.rb +95 -0
- data/lib/gloo_lang/objs/cli/pastel.rb +97 -0
- data/lib/gloo_lang/objs/cli/prompt.rb +110 -0
- data/lib/gloo_lang/objs/cli/select.rb +126 -0
- data/lib/gloo_lang/objs/ctrl/each.rb +279 -0
- data/lib/gloo_lang/objs/ctrl/repeat.rb +108 -0
- data/lib/gloo_lang/objs/data/markdown.rb +84 -0
- data/lib/gloo_lang/objs/data/mysql.rb +192 -0
- data/lib/gloo_lang/objs/data/query.rb +176 -0
- data/lib/gloo_lang/objs/data/sqlite.rb +159 -0
- data/lib/gloo_lang/objs/data/table.rb +140 -0
- data/lib/gloo_lang/objs/dev/git.rb +140 -0
- data/lib/gloo_lang/objs/dev/stats.rb +120 -0
- data/lib/gloo_lang/objs/dt/date.rb +50 -0
- data/lib/gloo_lang/objs/dt/datetime.rb +62 -0
- data/lib/gloo_lang/objs/dt/time.rb +50 -0
- data/lib/gloo_lang/objs/ror/erb.rb +116 -0
- data/lib/gloo_lang/objs/ror/eval.rb +107 -0
- data/lib/gloo_lang/objs/snd/play.rb +48 -0
- data/lib/gloo_lang/objs/snd/say.rb +98 -0
- data/lib/gloo_lang/objs/system/file_handle.rb +138 -0
- data/lib/gloo_lang/objs/system/ssh_exec.rb +126 -0
- data/lib/gloo_lang/objs/system/system.rb +136 -0
- data/lib/gloo_lang/objs/web/http_get.rb +159 -0
- data/lib/gloo_lang/objs/web/http_post.rb +183 -0
- data/lib/gloo_lang/objs/web/json.rb +135 -0
- data/lib/gloo_lang/objs/web/slack.rb +130 -0
- data/lib/gloo_lang/objs/web/teams.rb +117 -0
- data/lib/gloo_lang/objs/web/uri.rb +148 -0
- data/lib/gloo_lang/persist/file_loader.rb +191 -0
- data/lib/gloo_lang/persist/file_saver.rb +49 -0
- data/lib/gloo_lang/persist/file_storage.rb +45 -0
- data/lib/gloo_lang/persist/line_splitter.rb +81 -0
- data/lib/gloo_lang/persist/persist_man.rb +120 -0
- data/lib/gloo_lang/utils/format.rb +21 -0
- data/lib/gloo_lang/utils/stats.rb +205 -0
- data/lib/gloo_lang/utils/words.rb +19 -0
- data/lib/gloo_lang/verbs/alert.rb +79 -0
- data/lib/gloo_lang/verbs/beep.rb +40 -0
- data/lib/gloo_lang/verbs/cls.rb +37 -0
- data/lib/gloo_lang/verbs/context.rb +62 -0
- data/lib/gloo_lang/verbs/create.rb +68 -0
- data/lib/gloo_lang/verbs/execute.rb +56 -0
- data/lib/gloo_lang/verbs/help.rb +264 -0
- data/lib/gloo_lang/verbs/if.rb +92 -0
- data/lib/gloo_lang/verbs/list.rb +98 -0
- data/lib/gloo_lang/verbs/load.rb +45 -0
- data/lib/gloo_lang/verbs/move.rb +89 -0
- data/lib/gloo_lang/verbs/put.rb +94 -0
- data/lib/gloo_lang/verbs/quit.rb +40 -0
- data/lib/gloo_lang/verbs/run.rb +75 -0
- data/lib/gloo_lang/verbs/save.rb +39 -0
- data/lib/gloo_lang/verbs/show.rb +64 -0
- data/lib/gloo_lang/verbs/tell.rb +79 -0
- data/lib/gloo_lang/verbs/unless.rb +92 -0
- data/lib/gloo_lang/verbs/version.rb +37 -0
- data/lib/gloo_lang/verbs/wait.rb +42 -0
- metadata +190 -2
@@ -0,0 +1,26 @@
|
|
1
|
+
SYSTEM OBJECT TYPE
|
2
|
+
NAME: sqlite
|
3
|
+
SHORTCUT: sqlite
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
A Sqlite3 database connection.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
database - string - 'test.db'
|
10
|
+
The path to the database file.
|
11
|
+
|
12
|
+
MESSAGES
|
13
|
+
verify - Verify that the database connection can be established.
|
14
|
+
|
15
|
+
EXAMPLE
|
16
|
+
|
17
|
+
sqlite [can] :
|
18
|
+
on_load [script] : run sqlite.sql
|
19
|
+
db [sqlite] :
|
20
|
+
database : test.db
|
21
|
+
sql [query] :
|
22
|
+
database [alias] : sqlite.db
|
23
|
+
sql : SELECT id, key, value FROM key_values
|
24
|
+
|
25
|
+
SEE ALSO
|
26
|
+
query, mysql
|
@@ -0,0 +1,46 @@
|
|
1
|
+
TABLE OBJECT TYPE
|
2
|
+
NAME: table
|
3
|
+
SHORTCUT: tbl
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
A data table.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
headers - container
|
10
|
+
A list of headers.
|
11
|
+
The name of the header object needs to be the same as the
|
12
|
+
name of the object in the data container.
|
13
|
+
The value of the header is what will be displayed.
|
14
|
+
data - container
|
15
|
+
The table's data.
|
16
|
+
The data container will have one or more containers, each
|
17
|
+
of which represents one row of data.
|
18
|
+
|
19
|
+
MESSAGES
|
20
|
+
show - Show the contents of the table in the CLI.
|
21
|
+
|
22
|
+
EXAMPLE
|
23
|
+
|
24
|
+
t [tbl] :
|
25
|
+
on_load [script] :
|
26
|
+
tell t to show
|
27
|
+
headers [can] :
|
28
|
+
name : Name
|
29
|
+
phone : Tel
|
30
|
+
notes : Notes
|
31
|
+
data [alias] : table_data
|
32
|
+
table_data [can] :
|
33
|
+
1 [can] :
|
34
|
+
name : Joe
|
35
|
+
phone : 312-555-1212
|
36
|
+
notes : Play golf with Joe
|
37
|
+
2 [can] :
|
38
|
+
name : Sally
|
39
|
+
phone : 708-555-1212
|
40
|
+
notes : met Sally at the meetup last week
|
41
|
+
3 [can] :
|
42
|
+
name : Frank
|
43
|
+
phone : 312-555-1213
|
44
|
+
notes : Frank Lee Speaking
|
45
|
+
|
46
|
+
SEE ALSO
|
@@ -0,0 +1,36 @@
|
|
1
|
+
GIT OBJECT TYPE
|
2
|
+
NAME: git_repo
|
3
|
+
SHORTCUT: git
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Reference to a git repository in the file system.
|
7
|
+
The value of the git_repo object is a string.
|
8
|
+
There are no children needed.
|
9
|
+
|
10
|
+
CHILDREN
|
11
|
+
None
|
12
|
+
|
13
|
+
MESSAGES
|
14
|
+
validate - Validate that this is a git repo.
|
15
|
+
check_changes - Check to see if there are any pending changes.
|
16
|
+
get_changes - Get the list of pending changes.
|
17
|
+
commit - Commit changes.
|
18
|
+
get_branch - Get the current branch.
|
19
|
+
review - Review pending changes.
|
20
|
+
|
21
|
+
EXAMPLE
|
22
|
+
|
23
|
+
changes [can] :
|
24
|
+
on_load [script] :
|
25
|
+
show "Finding repos with local changes..."
|
26
|
+
put $.user.home + "/dev" into changes.for.in
|
27
|
+
run changes.for
|
28
|
+
show "Done."
|
29
|
+
for [each] :
|
30
|
+
repo [git] :
|
31
|
+
in [string] :
|
32
|
+
do [script] :
|
33
|
+
tell changes.for.repo to check_changes
|
34
|
+
if it then show changes.for.repo
|
35
|
+
|
36
|
+
SEE ALSO
|
@@ -0,0 +1,36 @@
|
|
1
|
+
GIT OBJECT TYPE
|
2
|
+
NAME: stats
|
3
|
+
SHORTCUT: stats
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Development project statistics.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
folder - file
|
10
|
+
The project's root folder.
|
11
|
+
types - string
|
12
|
+
The list of code file types.
|
13
|
+
We'll use this to count lines of code and to find the
|
14
|
+
longest files.
|
15
|
+
The list is a string of space-delimited file extensions.
|
16
|
+
For example: rb erb js
|
17
|
+
skip - string
|
18
|
+
List of files or folders we'll skip while building stats.
|
19
|
+
For example: .git tmp
|
20
|
+
|
21
|
+
MESSAGES
|
22
|
+
show_all - Show all project statistics
|
23
|
+
show_busy_folders - Show a list of folders with the most files
|
24
|
+
show_types - Show file types and counts
|
25
|
+
|
26
|
+
EXAMPLE
|
27
|
+
|
28
|
+
main [can] :
|
29
|
+
stats [stats] :
|
30
|
+
folder [file] : /Users/me/dev/project
|
31
|
+
types [string] : rb erb js
|
32
|
+
skip [string] : .git tmp
|
33
|
+
on_load [script] :
|
34
|
+
tell main.stats to show_all
|
35
|
+
|
36
|
+
SEE ALSO
|
@@ -0,0 +1,23 @@
|
|
1
|
+
DATE OBJECT TYPE
|
2
|
+
NAME: date
|
3
|
+
SHORTCUT: date
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
A reference to a date, but without time.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
None
|
10
|
+
|
11
|
+
MESSAGES
|
12
|
+
now - Set to the current system date.
|
13
|
+
|
14
|
+
EXAMPLE
|
15
|
+
|
16
|
+
time [can] :
|
17
|
+
t [time] :
|
18
|
+
on_load [script] :
|
19
|
+
tell time.t to now
|
20
|
+
show time.t
|
21
|
+
|
22
|
+
SEE ALSO
|
23
|
+
datetime, time
|
@@ -0,0 +1,24 @@
|
|
1
|
+
DATETIME OBJECT TYPE
|
2
|
+
NAME: datetime
|
3
|
+
SHORTCUT: dt
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
A reference to a date and time.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
None
|
10
|
+
|
11
|
+
MESSAGES
|
12
|
+
now - Set to the current system date and time.
|
13
|
+
|
14
|
+
EXAMPLE
|
15
|
+
|
16
|
+
dt [can] :
|
17
|
+
d [datetime] :
|
18
|
+
on_load [script] :
|
19
|
+
tell dt.d to now
|
20
|
+
show dt.d
|
21
|
+
next [script] : put '1 week from now' into dt.d
|
22
|
+
|
23
|
+
SEE ALSO
|
24
|
+
date, time
|
@@ -0,0 +1,23 @@
|
|
1
|
+
TIME OBJECT TYPE
|
2
|
+
NAME: time
|
3
|
+
SHORTCUT: time
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
A reference to a time, but without a date.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
None
|
10
|
+
|
11
|
+
MESSAGES
|
12
|
+
now - Set to the current system time.
|
13
|
+
|
14
|
+
EXAMPLE
|
15
|
+
|
16
|
+
date [can] :
|
17
|
+
d [date] :
|
18
|
+
on_load [script] :
|
19
|
+
tell date.d to now
|
20
|
+
show date.d
|
21
|
+
|
22
|
+
SEE ALSO
|
23
|
+
date, datetime
|
@@ -0,0 +1,37 @@
|
|
1
|
+
ERB OBJECT TYPE
|
2
|
+
NAME: erb
|
3
|
+
SHORTCUT: erb
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Use the ERB templating system to generate content.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
template - text
|
10
|
+
The template that will be used the the ERB object is run.
|
11
|
+
params - container
|
12
|
+
The collection of children values that will be used
|
13
|
+
when the template object is rendered.
|
14
|
+
result - text
|
15
|
+
The result of the template rendering.
|
16
|
+
|
17
|
+
MESSAGES
|
18
|
+
run - Render the result based on the template and the
|
19
|
+
parameter values.
|
20
|
+
|
21
|
+
EXAMPLE
|
22
|
+
|
23
|
+
e [can] :
|
24
|
+
erb [erb] :
|
25
|
+
template [text] : BEGIN
|
26
|
+
Hello <%= first %> <%= last %>!
|
27
|
+
END
|
28
|
+
params [container] :
|
29
|
+
first [string] : Eric
|
30
|
+
last [string] : Crane
|
31
|
+
result [text] :
|
32
|
+
on_load [script] :
|
33
|
+
run e.erb
|
34
|
+
show e.erb.result
|
35
|
+
|
36
|
+
SEE ALSO
|
37
|
+
eval, system, execute
|
@@ -0,0 +1,24 @@
|
|
1
|
+
EVAL OBJECT TYPE
|
2
|
+
NAME: eval
|
3
|
+
SHORTCUT: ruby
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Execute a ruby expression.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
command - string
|
10
|
+
The ruby expression or command that will be run.
|
11
|
+
result - string
|
12
|
+
The result of the command or expression after it is run.
|
13
|
+
|
14
|
+
MESSAGES
|
15
|
+
run - Execute the ruby command and update the result.
|
16
|
+
|
17
|
+
EXAMPLE
|
18
|
+
|
19
|
+
eval [ruby] :
|
20
|
+
command [string] : 3 * 7
|
21
|
+
result [string] : 21
|
22
|
+
|
23
|
+
SEE ALSO
|
24
|
+
system, erb, execute
|
@@ -0,0 +1,23 @@
|
|
1
|
+
PLAY OBJECT TYPE
|
2
|
+
NAME: play
|
3
|
+
SHORTCUT: play
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Play an audio file, an MP3 for example.
|
7
|
+
The value of the play object is the path to the audio file.
|
8
|
+
|
9
|
+
CHILDREN
|
10
|
+
None.
|
11
|
+
|
12
|
+
MESSAGES
|
13
|
+
run - Play the audio file.
|
14
|
+
|
15
|
+
EXAMPLE
|
16
|
+
|
17
|
+
play [can] :
|
18
|
+
snd [play] : ~/path/to/snd.mp3
|
19
|
+
on_load [script] :
|
20
|
+
run play.snd
|
21
|
+
|
22
|
+
SEE ALSO
|
23
|
+
say, beep
|
@@ -0,0 +1,28 @@
|
|
1
|
+
SAY OBJECT TYPE
|
2
|
+
NAME: say
|
3
|
+
SHORTCUT: say
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Use the Mac text to speech function to convert text to audio.
|
7
|
+
From the Mac CLI, run this to get a list of voices:
|
8
|
+
say -v '?'
|
9
|
+
|
10
|
+
CHILDREN
|
11
|
+
voice - string
|
12
|
+
The Voice to use. If left blank, the default voice will be used.
|
13
|
+
message - string - 'talk to me'
|
14
|
+
The message to speak.
|
15
|
+
|
16
|
+
MESSAGES
|
17
|
+
run - Speak the message, optionally in the voice specified.
|
18
|
+
|
19
|
+
EXAMPLE
|
20
|
+
|
21
|
+
say [say] :
|
22
|
+
voice [string] : Moira
|
23
|
+
message [string] : So long, and thanks for all the fish!
|
24
|
+
on_load [script] :
|
25
|
+
tell say to run
|
26
|
+
|
27
|
+
SEE ALSO
|
28
|
+
play, beep
|
@@ -0,0 +1,48 @@
|
|
1
|
+
FILE OBJECT TYPE
|
2
|
+
NAME: file
|
3
|
+
SHORTCUT: dir
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Reference to a file or folder (directory) on disk.
|
7
|
+
The string value of the file object is the path and name
|
8
|
+
of the file.
|
9
|
+
|
10
|
+
CHILDREN
|
11
|
+
None.
|
12
|
+
|
13
|
+
MESSAGES
|
14
|
+
read <into.obj> - Read file and put data in the specified object.
|
15
|
+
If the <into.obj> is not specified, the data will be in <it>.
|
16
|
+
write <from.obj> - Write the data in the <from.object> into
|
17
|
+
the file.
|
18
|
+
show - Show the contents of the file.
|
19
|
+
page - Show the contents of the file, paginated
|
20
|
+
open - Open the file with the default application for the type.
|
21
|
+
check_exists - Check to see if the file exists.
|
22
|
+
<It> will be true or false.
|
23
|
+
check_is_file - Check to see if the file specified is a
|
24
|
+
regular file. <It> will be true or false.
|
25
|
+
check_is_dir - Check to see if the file specified is a
|
26
|
+
diretory. <It> will be true or false.
|
27
|
+
find_match - Look for the existence of a file matching
|
28
|
+
the file's pattern. <It> will be true or false.
|
29
|
+
|
30
|
+
EXAMPLE
|
31
|
+
|
32
|
+
exists [can] :
|
33
|
+
f [file] : /Users/me/tmp
|
34
|
+
on_load [script] :
|
35
|
+
show "Checking to see if file exists: " + exists.f
|
36
|
+
tell exists.f to check_exists
|
37
|
+
show it
|
38
|
+
tell exists.f to check_is_dir
|
39
|
+
show "is a directory? " + it
|
40
|
+
tell exists.f to check_is_file
|
41
|
+
show "is a file? " + it
|
42
|
+
|
43
|
+
f [file] : /Users/me/gloo/*.gemspec
|
44
|
+
pattern [script] :
|
45
|
+
tell f to find_match
|
46
|
+
show it
|
47
|
+
|
48
|
+
SEE ALSO
|
@@ -0,0 +1,30 @@
|
|
1
|
+
SYSTEM OBJECT TYPE
|
2
|
+
NAME: ssh_exec
|
3
|
+
SHORTCUT: ssh
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Open an SSH session to host and execute a system command.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
host - string - 'localhost'
|
10
|
+
The remote host to which to open a connection.
|
11
|
+
The object assumes that the user has password-less SSH
|
12
|
+
set up to the remote host.
|
13
|
+
cmd - string
|
14
|
+
The command to execute on the remote system.
|
15
|
+
result - string
|
16
|
+
The result of running the command.
|
17
|
+
|
18
|
+
MESSAGES
|
19
|
+
run - Open the connection and execute the command.
|
20
|
+
Set the result value to the output of the command.
|
21
|
+
|
22
|
+
EXAMPLE
|
23
|
+
|
24
|
+
remote [ssh_exec] :
|
25
|
+
host [string] : localhost
|
26
|
+
cmd [string] : hostname
|
27
|
+
result [string] :
|
28
|
+
|
29
|
+
SEE ALSO
|
30
|
+
execute, system
|
@@ -0,0 +1,32 @@
|
|
1
|
+
SYSTEM OBJECT TYPE
|
2
|
+
NAME: system
|
3
|
+
SHORTCUT: sys
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Execute a system command.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
command - string - 'date'
|
10
|
+
The command that will be sent to the system.
|
11
|
+
get_output - boolean - true
|
12
|
+
Should executing the command get the output and put it
|
13
|
+
in the result object?
|
14
|
+
result - string
|
15
|
+
The result of running the command.
|
16
|
+
The result will only be set if the 'get_output' child
|
17
|
+
is set to true.
|
18
|
+
|
19
|
+
MESSAGES
|
20
|
+
run - Run the system level command.
|
21
|
+
Set the result value to the output of the command if the
|
22
|
+
'get_output' child is marked as true.
|
23
|
+
|
24
|
+
EXAMPLE
|
25
|
+
|
26
|
+
date [system] :
|
27
|
+
command [string] : date
|
28
|
+
get_output [bool] : true
|
29
|
+
result [string] :
|
30
|
+
|
31
|
+
SEE ALSO
|
32
|
+
execute, eval, erb
|
@@ -0,0 +1,35 @@
|
|
1
|
+
HTTP_GET OBJECT TYPE
|
2
|
+
NAME: http_get
|
3
|
+
SHORTCUT: get
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Perform an HTTP Get.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
uri - string - 'https://web.site/'
|
10
|
+
The URI for the HTTP Get request.
|
11
|
+
params - container
|
12
|
+
Collection of parameters for the HTTP Get.
|
13
|
+
result - string
|
14
|
+
The result of the request. Whatever was returned from
|
15
|
+
the HTTP Get call.
|
16
|
+
skip_ssl_verify - boolean (optional)
|
17
|
+
Skip the SSL verification as part of the request.
|
18
|
+
|
19
|
+
MESSAGES
|
20
|
+
run - Run the HTTP Get and update the result.
|
21
|
+
|
22
|
+
EXAMPLE
|
23
|
+
|
24
|
+
g [http_get] :
|
25
|
+
uri [string] : http://api.sunrise-sunset.org/json
|
26
|
+
params [container] :
|
27
|
+
lat [string] : 36.7201600
|
28
|
+
lng [string] : -4.4203400
|
29
|
+
date [string] : today
|
30
|
+
result [string] :
|
31
|
+
|
32
|
+
> run g
|
33
|
+
|
34
|
+
SEE ALSO
|
35
|
+
http_post, json, uri
|
@@ -0,0 +1,34 @@
|
|
1
|
+
HTTP_POST OBJECT TYPE
|
2
|
+
NAME: http_post
|
3
|
+
SHORTCUT: post
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Perform an HTTP Post.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
uri - string - 'https://web.site/'
|
10
|
+
The URI for the HTTP Post.
|
11
|
+
body - container
|
12
|
+
Collection of parameters for the HTTP Post.
|
13
|
+
result - string - Optional parameter
|
14
|
+
The result of the request. Whatever was returned in the body
|
15
|
+
of the HTTP POST.
|
16
|
+
skip_ssl_verify - boolean (optional)
|
17
|
+
Skip the SSL verification as part of the request.
|
18
|
+
|
19
|
+
MESSAGES
|
20
|
+
run - Run the HTTP Post sending the body data to the
|
21
|
+
endpoint specified in the URI.
|
22
|
+
|
23
|
+
EXAMPLE
|
24
|
+
|
25
|
+
post [post] :
|
26
|
+
txt [str] : Message from gloo!
|
27
|
+
uri [str] : https://my.service.com/my-long-token
|
28
|
+
body [can] :
|
29
|
+
text [alias] : post.txt
|
30
|
+
username [str] : me
|
31
|
+
on_load [script] : run post
|
32
|
+
|
33
|
+
SEE ALSO
|
34
|
+
http_get, json, uri
|
@@ -0,0 +1,34 @@
|
|
1
|
+
JSON OBJECT TYPE
|
2
|
+
NAME: json
|
3
|
+
SHORTCUT: json
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
JSON data in a text string.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
None
|
10
|
+
|
11
|
+
MESSAGES
|
12
|
+
get - get a value from the JSON data
|
13
|
+
Example: tell myjson to get ("title")
|
14
|
+
The additional parameter is the path to the value.
|
15
|
+
parse - parse the JSON data and put values in the
|
16
|
+
object specified by the additional parameter
|
17
|
+
Example: tell myjson to parse ("path.to.objects")
|
18
|
+
pretty - make the JSON format pretty
|
19
|
+
|
20
|
+
EXAMPLE
|
21
|
+
|
22
|
+
json [can] :
|
23
|
+
on_load [script] :
|
24
|
+
list json.objs
|
25
|
+
show json.j
|
26
|
+
tell json.j to parse (json.objs)
|
27
|
+
list json.objs
|
28
|
+
j [json] : {"title":"Brute Force","quotation":"When in doubt, use brute force.","author":"Eric Steven Raymond","source":"The Art of Unix Programming"}
|
29
|
+
objs [can] :
|
30
|
+
title [string] :
|
31
|
+
quotation [string] :
|
32
|
+
|
33
|
+
SEE ALSO
|
34
|
+
http_get, http_post, uri
|
@@ -0,0 +1,33 @@
|
|
1
|
+
SLACK OBJECT TYPE
|
2
|
+
NAME: slack
|
3
|
+
SHORTCUT: slack
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Send message to channel in Slack.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
uri - string - 'https://hooks.slack.com/services/...'
|
10
|
+
The URI with access to the Slack channel.
|
11
|
+
message - string - 'textual message'
|
12
|
+
Message to send to Slack.
|
13
|
+
username - string - 'Slack Bot'
|
14
|
+
Attribute the message to this user.
|
15
|
+
channel - string - 'general'
|
16
|
+
The name of the channel for the post.
|
17
|
+
icon_emoji - string - ':ghost:'
|
18
|
+
The emoji to use for the attribution.
|
19
|
+
|
20
|
+
MESSAGES
|
21
|
+
run - Post the message to Slack.
|
22
|
+
|
23
|
+
EXAMPLE
|
24
|
+
|
25
|
+
slack [slack] :
|
26
|
+
uri [string] : https://hooks.slack.com/services/MYTOKEN
|
27
|
+
message [string] : Slackbot is here to help!
|
28
|
+
username [string] : SlackBot
|
29
|
+
channel [string] : general
|
30
|
+
icon_emoji [string] : :ghost:
|
31
|
+
|
32
|
+
SEE ALSO
|
33
|
+
http_get, http_post, json, uri
|
@@ -0,0 +1,30 @@
|
|
1
|
+
TEAMS OBJECT TYPE
|
2
|
+
NAME: teams
|
3
|
+
SHORTCUT: team
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Send message to channel in Teams.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
uri - string - 'https://outlook.office.com/webhook/...'
|
10
|
+
The URI with access to the Teams channel.
|
11
|
+
title - string
|
12
|
+
Message title; header.
|
13
|
+
color - string - '008000'
|
14
|
+
Color theme for the message.
|
15
|
+
message - string
|
16
|
+
The message to post in Teams.
|
17
|
+
|
18
|
+
MESSAGES
|
19
|
+
run - Post the message to Teams.
|
20
|
+
|
21
|
+
EXAMPLE
|
22
|
+
|
23
|
+
team [teams] :
|
24
|
+
uri [string] : https://outlook.office.com/webhook/MYTOKEN/IncomingWebhook/MYTOKEN
|
25
|
+
title [string] : Success
|
26
|
+
color [string] : 008000
|
27
|
+
message [string] : This worked!
|
28
|
+
|
29
|
+
SEE ALSO
|
30
|
+
http_get, http_post, json, uri
|
@@ -0,0 +1,38 @@
|
|
1
|
+
URI OBJECT TYPE
|
2
|
+
NAME: uri
|
3
|
+
SHORTCUT: url
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
A URI or URL.
|
7
|
+
|
8
|
+
CHILDREN
|
9
|
+
None
|
10
|
+
|
11
|
+
MESSAGES
|
12
|
+
open - open the URL in the default browser
|
13
|
+
get_scheme - get the URI scheme; example: http
|
14
|
+
get_host - get the URI host; example: google.com
|
15
|
+
get_path - get the URI resource path; example: /post
|
16
|
+
get_query - get the URI query parameters; example: id=121
|
17
|
+
get_fragment - get the URI fragment
|
18
|
+
get_cert_expires - get the web site's certificate expiration date
|
19
|
+
|
20
|
+
EXAMPLE
|
21
|
+
|
22
|
+
url [can] :
|
23
|
+
on_load [script] :
|
24
|
+
tell url.u to get_scheme
|
25
|
+
show "scheme: " + it
|
26
|
+
|
27
|
+
tell url.u to get_host
|
28
|
+
show "host: " + it
|
29
|
+
|
30
|
+
tell url.u to get_path
|
31
|
+
show "path: " + it
|
32
|
+
|
33
|
+
show "opening URL: " + url.u
|
34
|
+
tell url.u to open
|
35
|
+
u [uri] : https://my.url/path/1234
|
36
|
+
|
37
|
+
SEE ALSO
|
38
|
+
http_get, http_post, json
|
@@ -0,0 +1,33 @@
|
|
1
|
+
ALERT VERB
|
2
|
+
NAME: alert
|
3
|
+
SHORTCUT: !
|
4
|
+
|
5
|
+
DESCRIPTION
|
6
|
+
Show a pop-up notification.
|
7
|
+
This has only been implemented for the Mac OS X as of yet.
|
8
|
+
|
9
|
+
SYNTAX
|
10
|
+
alert <messsage>
|
11
|
+
|
12
|
+
PARAMETERS
|
13
|
+
messsage - The message that will be displayed in the alert.
|
14
|
+
|
15
|
+
RESULT
|
16
|
+
On the Mac, a notification will popup on screen.
|
17
|
+
<it> will be set to the message.
|
18
|
+
|
19
|
+
ERRORS
|
20
|
+
Missing Expression!
|
21
|
+
- No expression is provided as parameter to the verb.
|
22
|
+
Expression evaluated with no result!
|
23
|
+
- Expression is provided but evaluates to nil.
|
24
|
+
|
25
|
+
EXAMPLE
|
26
|
+
|
27
|
+
> create s as string : "boo"
|
28
|
+
> alert s
|
29
|
+
|
30
|
+
> alert "important message!"
|
31
|
+
|
32
|
+
SEE ALSO
|
33
|
+
show
|