gloo-lang 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.ruby-gemset +1 -0
  4. data/.ruby-version +1 -0
  5. data/lib/VERSION +1 -1
  6. data/lib/gloo_lang/app/engine.rb +1 -12
  7. metadata +4 -81
  8. data/Gemfile.lock +0 -68
  9. data/lib/gloo_lang/app/help.rb +0 -118
  10. data/lib/gloo_lang/help/app/application.txt +0 -22
  11. data/lib/gloo_lang/help/app/configuration.txt +0 -7
  12. data/lib/gloo_lang/help/app/default_help.txt +0 -14
  13. data/lib/gloo_lang/help/app/logging.txt +0 -16
  14. data/lib/gloo_lang/help/core/color.txt +0 -31
  15. data/lib/gloo_lang/help/core/error.txt +0 -33
  16. data/lib/gloo_lang/help/core/events.txt +0 -21
  17. data/lib/gloo_lang/help/core/gloo_system.txt +0 -57
  18. data/lib/gloo_lang/help/core/here.txt +0 -30
  19. data/lib/gloo_lang/help/core/it.txt +0 -23
  20. data/lib/gloo_lang/help/core/ops.txt +0 -16
  21. data/lib/gloo_lang/help/core/pathname.txt +0 -29
  22. data/lib/gloo_lang/help/objs/basic/alias.txt +0 -36
  23. data/lib/gloo_lang/help/objs/basic/boolean.txt +0 -28
  24. data/lib/gloo_lang/help/objs/basic/container.txt +0 -33
  25. data/lib/gloo_lang/help/objs/basic/decimal.txt +0 -28
  26. data/lib/gloo_lang/help/objs/basic/integer.txt +0 -27
  27. data/lib/gloo_lang/help/objs/basic/script.txt +0 -29
  28. data/lib/gloo_lang/help/objs/basic/string.txt +0 -28
  29. data/lib/gloo_lang/help/objs/basic/text.txt +0 -27
  30. data/lib/gloo_lang/help/objs/basic/untyped.txt +0 -22
  31. data/lib/gloo_lang/help/objs/cli/banner.txt +0 -49
  32. data/lib/gloo_lang/help/objs/cli/bar.txt +0 -37
  33. data/lib/gloo_lang/help/objs/cli/colorize.txt +0 -33
  34. data/lib/gloo_lang/help/objs/cli/confirm.txt +0 -26
  35. data/lib/gloo_lang/help/objs/cli/menu.txt +0 -44
  36. data/lib/gloo_lang/help/objs/cli/menu_item.txt +0 -26
  37. data/lib/gloo_lang/help/objs/cli/pastel.txt +0 -43
  38. data/lib/gloo_lang/help/objs/cli/prompt.txt +0 -27
  39. data/lib/gloo_lang/help/objs/cli/select.txt +0 -34
  40. data/lib/gloo_lang/help/objs/ctrl/each.txt +0 -48
  41. data/lib/gloo_lang/help/objs/ctrl/repeat.txt +0 -38
  42. data/lib/gloo_lang/help/objs/data/markdown.txt +0 -25
  43. data/lib/gloo_lang/help/objs/data/mysql.txt +0 -40
  44. data/lib/gloo_lang/help/objs/data/query.txt +0 -37
  45. data/lib/gloo_lang/help/objs/data/sqlite.txt +0 -26
  46. data/lib/gloo_lang/help/objs/data/table.txt +0 -46
  47. data/lib/gloo_lang/help/objs/dev/git_repo.txt +0 -36
  48. data/lib/gloo_lang/help/objs/dev/stats.txt +0 -36
  49. data/lib/gloo_lang/help/objs/dt/date.txt +0 -23
  50. data/lib/gloo_lang/help/objs/dt/datetime.txt +0 -24
  51. data/lib/gloo_lang/help/objs/dt/time.txt +0 -23
  52. data/lib/gloo_lang/help/objs/ror/erb.txt +0 -37
  53. data/lib/gloo_lang/help/objs/ror/eval.txt +0 -24
  54. data/lib/gloo_lang/help/objs/snd/play.txt +0 -23
  55. data/lib/gloo_lang/help/objs/snd/say.txt +0 -28
  56. data/lib/gloo_lang/help/objs/system/file.txt +0 -48
  57. data/lib/gloo_lang/help/objs/system/ssh_exec.txt +0 -30
  58. data/lib/gloo_lang/help/objs/system/system.txt +0 -32
  59. data/lib/gloo_lang/help/objs/web/http_get.txt +0 -35
  60. data/lib/gloo_lang/help/objs/web/http_post.txt +0 -34
  61. data/lib/gloo_lang/help/objs/web/json.txt +0 -34
  62. data/lib/gloo_lang/help/objs/web/slack.txt +0 -33
  63. data/lib/gloo_lang/help/objs/web/teams.txt +0 -30
  64. data/lib/gloo_lang/help/objs/web/uri.txt +0 -38
  65. data/lib/gloo_lang/help/verbs/alert.txt +0 -33
  66. data/lib/gloo_lang/help/verbs/beep.txt +0 -25
  67. data/lib/gloo_lang/help/verbs/cls.txt +0 -24
  68. data/lib/gloo_lang/help/verbs/context.txt +0 -43
  69. data/lib/gloo_lang/help/verbs/create.txt +0 -33
  70. data/lib/gloo_lang/help/verbs/execute.txt +0 -27
  71. data/lib/gloo_lang/help/verbs/help.txt +0 -34
  72. data/lib/gloo_lang/help/verbs/if.txt +0 -37
  73. data/lib/gloo_lang/help/verbs/list.txt +0 -34
  74. data/lib/gloo_lang/help/verbs/load.txt +0 -38
  75. data/lib/gloo_lang/help/verbs/move.txt +0 -42
  76. data/lib/gloo_lang/help/verbs/put.txt +0 -38
  77. data/lib/gloo_lang/help/verbs/quit.txt +0 -25
  78. data/lib/gloo_lang/help/verbs/run.txt +0 -41
  79. data/lib/gloo_lang/help/verbs/save.txt +0 -26
  80. data/lib/gloo_lang/help/verbs/show.txt +0 -30
  81. data/lib/gloo_lang/help/verbs/tell.txt +0 -34
  82. data/lib/gloo_lang/help/verbs/unless.txt +0 -38
  83. data/lib/gloo_lang/help/verbs/version.txt +0 -32
  84. data/lib/gloo_lang/help/verbs/wait.txt +0 -29
  85. data/lib/gloo_lang/verbs/help.rb +0 -264
  86. data/lib/gloo_lang/verbs/version.rb +0 -37
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eaf0cc0e5ed992c2a11536a38506170a840099823bacd260b0e2bf6e4384dd14
4
- data.tar.gz: c07498a7140679627f936db05d0d71b69c2853e4e87fe504cf7182ac47eb38f2
3
+ metadata.gz: b2fef4d21ce7b2ba45d4598fa24282c703581bbe1e40ea07f8e8063bf66a4b1b
4
+ data.tar.gz: dbd1b3b25f998023baa7c93044618f33bdca46de5ff068b2efd2093d156c5393
5
5
  SHA512:
6
- metadata.gz: 5667685e248cd7fba038d9913c766ab3bfe899a7333d07977b517168eacf6d6b5843cb7a8d4e750dd02e94f7faf2c5921775cce2920ad6ac59913ba89bc9b9ee
7
- data.tar.gz: 425a61000ca83a501a656e01c241e927a7de3d909058d1760266a5d026128e103ea69d412443d2a1a78a5247412799bbf68a6ee0ddbe55bfc5eddbc9595220e0
6
+ metadata.gz: 9b859bb73c0b74b901ca5aaf2fba754c70d9b567c8725afa1ed20260f547b68264a9af8e96f391e94edd955a002de01417fbacc154f850309a2134b7f2d6ee81
7
+ data.tar.gz: b5cc88f9740a6766051579ea185b94b308f6628a61e13a1259871bd49350bb90acd9544ee47e3085c53daf33911ed312acc682373b244bd6b361e307b987be75
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
  *.log
11
11
  test/gloo/debug/*
12
12
  .DS_Store
13
+ Gemfile.lock
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ gloo-gem
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-3.0.2
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.1.0
@@ -15,7 +15,7 @@ module GlooLang
15
15
  attr_reader :args, :mode, :running, :platform,
16
16
  :dictionary, :parser, :heap, :factory
17
17
  attr_accessor :last_cmd, :persist_man, :event_manager,
18
- :exec_env, :help, :converter
18
+ :exec_env, :converter
19
19
 
20
20
  #
21
21
  # Set up the engine with basic elements.
@@ -52,7 +52,6 @@ module GlooLang
52
52
  @event_manager = GlooLang::Core::EventManager.new( self )
53
53
 
54
54
  @exec_env = GlooLang::Exec::ExecEnv.new( self )
55
- @help = GlooLang::App::Help.new( self )
56
55
  @converter = GlooLang::Convert::Converter.new( self )
57
56
 
58
57
  @log.debug 'the engine has started'
@@ -107,8 +106,6 @@ module GlooLang
107
106
 
108
107
  if @mode == Mode::VERSION
109
108
  run_version
110
- elsif @mode == Mode::HELP
111
- show_help_and_quit
112
109
  elsif @mode == Mode::SCRIPT
113
110
  run_files
114
111
  elsif @mode == Mode::EMBED
@@ -217,14 +214,6 @@ module GlooLang
217
214
  quit
218
215
  end
219
216
 
220
- #
221
- # Show the help information and then quit.
222
- #
223
- def show_help_and_quit
224
- @help.show_app_help
225
- quit
226
- end
227
-
228
217
  # ---------------------------------------------------------------------
229
218
  # Error Handling
230
219
  # ---------------------------------------------------------------------
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gloo-lang
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Crane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-30 00:00:00.000000000 Z
11
+ date: 2022-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -192,9 +192,10 @@ extensions: []
192
192
  extra_rdoc_files: []
193
193
  files:
194
194
  - ".gitignore"
195
+ - ".ruby-gemset"
196
+ - ".ruby-version"
195
197
  - CODE_OF_CONDUCT.md
196
198
  - Gemfile
197
- - Gemfile.lock
198
199
  - LICENSE.txt
199
200
  - README.md
200
201
  - Rakefile
@@ -207,7 +208,6 @@ files:
207
208
  - lib/gloo_lang/app/args.rb
208
209
  - lib/gloo_lang/app/engine.rb
209
210
  - lib/gloo_lang/app/engine_context.rb
210
- - lib/gloo_lang/app/help.rb
211
211
  - lib/gloo_lang/app/info.rb
212
212
  - lib/gloo_lang/app/log.rb
213
213
  - lib/gloo_lang/app/mode.rb
@@ -249,81 +249,6 @@ files:
249
249
  - lib/gloo_lang/expr/op_minus.rb
250
250
  - lib/gloo_lang/expr/op_mult.rb
251
251
  - lib/gloo_lang/expr/op_plus.rb
252
- - lib/gloo_lang/help/app/application.txt
253
- - lib/gloo_lang/help/app/configuration.txt
254
- - lib/gloo_lang/help/app/default_help.txt
255
- - lib/gloo_lang/help/app/logging.txt
256
- - lib/gloo_lang/help/core/color.txt
257
- - lib/gloo_lang/help/core/error.txt
258
- - lib/gloo_lang/help/core/events.txt
259
- - lib/gloo_lang/help/core/gloo_system.txt
260
- - lib/gloo_lang/help/core/here.txt
261
- - lib/gloo_lang/help/core/it.txt
262
- - lib/gloo_lang/help/core/ops.txt
263
- - lib/gloo_lang/help/core/pathname.txt
264
- - lib/gloo_lang/help/objs/basic/alias.txt
265
- - lib/gloo_lang/help/objs/basic/boolean.txt
266
- - lib/gloo_lang/help/objs/basic/container.txt
267
- - lib/gloo_lang/help/objs/basic/decimal.txt
268
- - lib/gloo_lang/help/objs/basic/integer.txt
269
- - lib/gloo_lang/help/objs/basic/script.txt
270
- - lib/gloo_lang/help/objs/basic/string.txt
271
- - lib/gloo_lang/help/objs/basic/text.txt
272
- - lib/gloo_lang/help/objs/basic/untyped.txt
273
- - lib/gloo_lang/help/objs/cli/banner.txt
274
- - lib/gloo_lang/help/objs/cli/bar.txt
275
- - lib/gloo_lang/help/objs/cli/colorize.txt
276
- - lib/gloo_lang/help/objs/cli/confirm.txt
277
- - lib/gloo_lang/help/objs/cli/menu.txt
278
- - lib/gloo_lang/help/objs/cli/menu_item.txt
279
- - lib/gloo_lang/help/objs/cli/pastel.txt
280
- - lib/gloo_lang/help/objs/cli/prompt.txt
281
- - lib/gloo_lang/help/objs/cli/select.txt
282
- - lib/gloo_lang/help/objs/ctrl/each.txt
283
- - lib/gloo_lang/help/objs/ctrl/repeat.txt
284
- - lib/gloo_lang/help/objs/data/markdown.txt
285
- - lib/gloo_lang/help/objs/data/mysql.txt
286
- - lib/gloo_lang/help/objs/data/query.txt
287
- - lib/gloo_lang/help/objs/data/sqlite.txt
288
- - lib/gloo_lang/help/objs/data/table.txt
289
- - lib/gloo_lang/help/objs/dev/git_repo.txt
290
- - lib/gloo_lang/help/objs/dev/stats.txt
291
- - lib/gloo_lang/help/objs/dt/date.txt
292
- - lib/gloo_lang/help/objs/dt/datetime.txt
293
- - lib/gloo_lang/help/objs/dt/time.txt
294
- - lib/gloo_lang/help/objs/ror/erb.txt
295
- - lib/gloo_lang/help/objs/ror/eval.txt
296
- - lib/gloo_lang/help/objs/snd/play.txt
297
- - lib/gloo_lang/help/objs/snd/say.txt
298
- - lib/gloo_lang/help/objs/system/file.txt
299
- - lib/gloo_lang/help/objs/system/ssh_exec.txt
300
- - lib/gloo_lang/help/objs/system/system.txt
301
- - lib/gloo_lang/help/objs/web/http_get.txt
302
- - lib/gloo_lang/help/objs/web/http_post.txt
303
- - lib/gloo_lang/help/objs/web/json.txt
304
- - lib/gloo_lang/help/objs/web/slack.txt
305
- - lib/gloo_lang/help/objs/web/teams.txt
306
- - lib/gloo_lang/help/objs/web/uri.txt
307
- - lib/gloo_lang/help/verbs/alert.txt
308
- - lib/gloo_lang/help/verbs/beep.txt
309
- - lib/gloo_lang/help/verbs/cls.txt
310
- - lib/gloo_lang/help/verbs/context.txt
311
- - lib/gloo_lang/help/verbs/create.txt
312
- - lib/gloo_lang/help/verbs/execute.txt
313
- - lib/gloo_lang/help/verbs/help.txt
314
- - lib/gloo_lang/help/verbs/if.txt
315
- - lib/gloo_lang/help/verbs/list.txt
316
- - lib/gloo_lang/help/verbs/load.txt
317
- - lib/gloo_lang/help/verbs/move.txt
318
- - lib/gloo_lang/help/verbs/put.txt
319
- - lib/gloo_lang/help/verbs/quit.txt
320
- - lib/gloo_lang/help/verbs/run.txt
321
- - lib/gloo_lang/help/verbs/save.txt
322
- - lib/gloo_lang/help/verbs/show.txt
323
- - lib/gloo_lang/help/verbs/tell.txt
324
- - lib/gloo_lang/help/verbs/unless.txt
325
- - lib/gloo_lang/help/verbs/version.txt
326
- - lib/gloo_lang/help/verbs/wait.txt
327
252
  - lib/gloo_lang/objs/basic/alias.rb
328
253
  - lib/gloo_lang/objs/basic/boolean.rb
329
254
  - lib/gloo_lang/objs/basic/container.rb
@@ -360,7 +285,6 @@ files:
360
285
  - lib/gloo_lang/verbs/context.rb
361
286
  - lib/gloo_lang/verbs/create.rb
362
287
  - lib/gloo_lang/verbs/execute.rb
363
- - lib/gloo_lang/verbs/help.rb
364
288
  - lib/gloo_lang/verbs/if.rb
365
289
  - lib/gloo_lang/verbs/list.rb
366
290
  - lib/gloo_lang/verbs/load.rb
@@ -372,7 +296,6 @@ files:
372
296
  - lib/gloo_lang/verbs/show.rb
373
297
  - lib/gloo_lang/verbs/tell.rb
374
298
  - lib/gloo_lang/verbs/unless.rb
375
- - lib/gloo_lang/verbs/version.rb
376
299
  - lib/gloo_lang/verbs/wait.rb
377
300
  homepage: http://github.com/ecrane/gloo_lang
378
301
  licenses:
data/Gemfile.lock DELETED
@@ -1,68 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- gloo-lang (1.0.1)
5
- activesupport (~> 6.1, >= 6.1.4.6)
6
- chronic (~> 0.10, >= 0.10.2)
7
- json (~> 2.1, >= 2.1.0)
8
- net-ssh (~> 6.1, >= 6.1.0)
9
- openssl (~> 2.1, >= 2.1.0)
10
- tty-platform (~> 0.3, >= 0.3.0)
11
-
12
- GEM
13
- remote: https://rubygems.org/
14
- specs:
15
- activesupport (6.1.5)
16
- concurrent-ruby (~> 1.0, >= 1.0.2)
17
- i18n (>= 1.6, < 2)
18
- minitest (>= 5.1)
19
- tzinfo (~> 2.0)
20
- zeitwerk (~> 2.3)
21
- ast (2.4.2)
22
- chronic (0.10.2)
23
- concurrent-ruby (1.1.10)
24
- i18n (1.10.0)
25
- concurrent-ruby (~> 1.0)
26
- ipaddr (1.2.4)
27
- json (2.6.1)
28
- minitest (5.15.0)
29
- net-ssh (6.1.0)
30
- openssl (2.2.1)
31
- ipaddr
32
- parallel (1.21.0)
33
- parser (3.1.1.0)
34
- ast (~> 2.4.1)
35
- rainbow (3.1.1)
36
- rake (13.0.6)
37
- regexp_parser (2.2.1)
38
- rexml (3.2.5)
39
- rubocop (1.25.1)
40
- parallel (~> 1.10)
41
- parser (>= 3.1.0.0)
42
- rainbow (>= 2.2.2, < 4.0)
43
- regexp_parser (>= 1.8, < 3.0)
44
- rexml
45
- rubocop-ast (>= 1.15.1, < 2.0)
46
- ruby-progressbar (~> 1.7)
47
- unicode-display_width (>= 1.4.0, < 3.0)
48
- rubocop-ast (1.16.0)
49
- parser (>= 3.1.1.0)
50
- ruby-progressbar (1.11.0)
51
- tty-platform (0.3.0)
52
- tzinfo (2.0.4)
53
- concurrent-ruby (~> 1.0)
54
- unicode-display_width (2.1.0)
55
- zeitwerk (2.5.4)
56
-
57
- PLATFORMS
58
- x86_64-darwin-21
59
-
60
- DEPENDENCIES
61
- bundler (~> 2.2.22)
62
- gloo-lang!
63
- minitest (~> 5.1, >= 5.14.2)
64
- rake (~> 13.0, >= 13.0.1)
65
- rubocop
66
-
67
- BUNDLED WITH
68
- 2.2.22
@@ -1,118 +0,0 @@
1
- # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
- # Copyright:: Copyright (c) 2019 Eric Crane. All rights reserved.
3
- #
4
- # Help system.
5
- #
6
-
7
- module GlooLang
8
- module App
9
- class Help
10
-
11
- APPLICATION = 'application'.freeze
12
-
13
- attr_accessor :topics
14
-
15
- #
16
- # Set up the help system.
17
- # We won't load help topics until we know we need them.
18
- #
19
- def initialize( engine )
20
- @engine = engine
21
- @topics = nil
22
- end
23
-
24
- #
25
- # Show application help.
26
- # This is the what is shown when help is run from the CLI.
27
- #
28
- def show_app_help
29
- puts Info.display_title unless @engine.args.quiet?
30
- self.show_topic APPLICATION
31
- end
32
-
33
- #
34
- # Check to see if there is a topic by the given name.
35
- #
36
- def topic?( name )
37
- lazy_load_index
38
-
39
- return @topics.key?( name )
40
- end
41
-
42
- #
43
- # Is the current topic Markdown?
44
- #
45
- def topic_is_md?( name )
46
- lazy_load_index
47
-
48
- topic_file = @topics[ name ]
49
- return topic_file.end_with? '.md'
50
- end
51
-
52
- #
53
- # Show a help topic, optionally paginaged.
54
- # If the content of the help page fits on a single
55
- # screen, it won't paginate.
56
- #
57
- def page_topic( topic )
58
- return if @engine.args.quiet?
59
-
60
- data = self.get_topic_data( topic )
61
- page = data.lines.count > Settings.page_size( @engine )
62
- @engine.platform.show( data, topic_is_md?( topic ), page )
63
- end
64
-
65
- #
66
- # Show a help topic.
67
- #
68
- def show_topic( topic )
69
- return if @engine.args.quiet?
70
-
71
- data = self.get_topic_data( topic )
72
- @engine.platform.show( data, topic_is_md?( topic ), false )
73
- end
74
-
75
- #
76
- # Get topic data.
77
- #
78
- def get_topic_data( topic )
79
- lazy_load_index
80
-
81
- topic_file = @topics[ topic ]
82
- return nil unless topic_file
83
-
84
- File.read topic_file
85
- end
86
-
87
- #
88
- # Lazy load topic index.
89
- # We'll only load the index the first time a help topic
90
- # is requested. After that we'll use the cached index.
91
- #
92
- def lazy_load_index
93
- return if @topics
94
-
95
- @topics = {}
96
- @engine.log.debug 'loading help file index...'
97
-
98
- pn = File.dirname( File.absolute_path( __FILE__ ) )
99
- pn = File.dirname( pn )
100
-
101
- root = File.join( pn, 'help', '**/*.txt' )
102
- Dir.glob( root ).each do |txt_file|
103
- key = File.basename( txt_file, '.txt' )
104
- @topics[ key ] = txt_file
105
- end
106
-
107
- root = File.join( pn, 'help', '**/*.md' )
108
- Dir.glob( root ).each do |md_file|
109
- key = File.basename( md_file, '.md' )
110
- @topics[ key ] = md_file
111
- end
112
-
113
- @engine.log.debug "Found #{@topics.count} help files"
114
- end
115
-
116
- end
117
- end
118
- end
@@ -1,22 +0,0 @@
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
@@ -1,7 +0,0 @@
1
- CONFIGURATION
2
-
3
- DESCRIPTION
4
- TODO: document the application configuration and settings
5
-
6
- SEE ALSO
7
- application, help
@@ -1,14 +0,0 @@
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
@@ -1,16 +0,0 @@
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
@@ -1,31 +0,0 @@
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
@@ -1,33 +0,0 @@
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
-
@@ -1,21 +0,0 @@
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)
@@ -1,57 +0,0 @@
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
- SPECIAL CHARS
36
- gloo.line # A carriage return (line feed) character.
37
-
38
- FILE SYSTEM
39
- gloo.user_home # Get the user's home directory.
40
- gloo.working_dir # Get the working directory.
41
- gloo.gloo_home # Get the gloo home directory
42
- gloo.gloo_config # Get the gloo configuration directory
43
- gloo.gloo_projects # Get the gloo projects directory
44
- gloo.gloo_log # Get the gloo logging directory
45
-
46
- SCREEN
47
- gloo.screen_lines # Get the number of lines on screen.
48
- gloo.screen_cols # Get the number of columns on screen.
49
-
50
- PLATFORM
51
- gloo.platform_cpu # Get the platform CPU
52
- gloo.platform_os # Get the platform Operating System
53
- gloo.platform_version # Get the platform version
54
- gloo.platform_windows? # Is the platform Windows?
55
- gloo.platform_unix? # Is the platform Unix?
56
- gloo.platform_linux? # Is the platform Linux?
57
- gloo.platform_mac? # Is the platform Mac?
@@ -1,30 +0,0 @@
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.
@@ -1,23 +0,0 @@
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.
@@ -1,16 +0,0 @@
1
- OPERATORS
2
-
3
- DESCRIPTION
4
- These are the gloo operators:
5
-
6
- + addition
7
- - subtraction
8
- * multiplication
9
- / division
10
-
11
- EXAMPLE
12
- Here are some examples of expression usage:
13
-
14
- > show 2 + 5
15
- > put 12 / 3 into x
16
- > show 23 * 3 - 6