gloo-lang 1.0.0 → 1.1.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/.gitignore +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/gloo-lang.gemspec +1 -3
- data/lib/VERSION +1 -1
- data/lib/gloo_lang/app/engine.rb +47 -12
- data/lib/gloo_lang/app/log.rb +42 -3
- data/lib/gloo_lang/core/heap.rb +2 -2
- metadata +10 -81
- data/Gemfile.lock +0 -68
- data/lib/gloo_lang/app/help.rb +0 -118
- data/lib/gloo_lang/help/app/application.txt +0 -22
- data/lib/gloo_lang/help/app/configuration.txt +0 -7
- data/lib/gloo_lang/help/app/default_help.txt +0 -14
- data/lib/gloo_lang/help/app/logging.txt +0 -16
- data/lib/gloo_lang/help/core/color.txt +0 -31
- data/lib/gloo_lang/help/core/error.txt +0 -33
- data/lib/gloo_lang/help/core/events.txt +0 -21
- data/lib/gloo_lang/help/core/gloo_system.txt +0 -57
- data/lib/gloo_lang/help/core/here.txt +0 -30
- data/lib/gloo_lang/help/core/it.txt +0 -23
- data/lib/gloo_lang/help/core/ops.txt +0 -16
- data/lib/gloo_lang/help/core/pathname.txt +0 -29
- data/lib/gloo_lang/help/objs/basic/alias.txt +0 -36
- data/lib/gloo_lang/help/objs/basic/boolean.txt +0 -28
- data/lib/gloo_lang/help/objs/basic/container.txt +0 -33
- data/lib/gloo_lang/help/objs/basic/decimal.txt +0 -28
- data/lib/gloo_lang/help/objs/basic/integer.txt +0 -27
- data/lib/gloo_lang/help/objs/basic/script.txt +0 -29
- data/lib/gloo_lang/help/objs/basic/string.txt +0 -28
- data/lib/gloo_lang/help/objs/basic/text.txt +0 -27
- data/lib/gloo_lang/help/objs/basic/untyped.txt +0 -22
- data/lib/gloo_lang/help/objs/cli/banner.txt +0 -49
- data/lib/gloo_lang/help/objs/cli/bar.txt +0 -37
- data/lib/gloo_lang/help/objs/cli/colorize.txt +0 -33
- data/lib/gloo_lang/help/objs/cli/confirm.txt +0 -26
- data/lib/gloo_lang/help/objs/cli/menu.txt +0 -44
- data/lib/gloo_lang/help/objs/cli/menu_item.txt +0 -26
- data/lib/gloo_lang/help/objs/cli/pastel.txt +0 -43
- data/lib/gloo_lang/help/objs/cli/prompt.txt +0 -27
- data/lib/gloo_lang/help/objs/cli/select.txt +0 -34
- data/lib/gloo_lang/help/objs/ctrl/each.txt +0 -48
- data/lib/gloo_lang/help/objs/ctrl/repeat.txt +0 -38
- data/lib/gloo_lang/help/objs/data/markdown.txt +0 -25
- data/lib/gloo_lang/help/objs/data/mysql.txt +0 -40
- data/lib/gloo_lang/help/objs/data/query.txt +0 -37
- data/lib/gloo_lang/help/objs/data/sqlite.txt +0 -26
- data/lib/gloo_lang/help/objs/data/table.txt +0 -46
- data/lib/gloo_lang/help/objs/dev/git_repo.txt +0 -36
- data/lib/gloo_lang/help/objs/dev/stats.txt +0 -36
- data/lib/gloo_lang/help/objs/dt/date.txt +0 -23
- data/lib/gloo_lang/help/objs/dt/datetime.txt +0 -24
- data/lib/gloo_lang/help/objs/dt/time.txt +0 -23
- data/lib/gloo_lang/help/objs/ror/erb.txt +0 -37
- data/lib/gloo_lang/help/objs/ror/eval.txt +0 -24
- data/lib/gloo_lang/help/objs/snd/play.txt +0 -23
- data/lib/gloo_lang/help/objs/snd/say.txt +0 -28
- data/lib/gloo_lang/help/objs/system/file.txt +0 -48
- data/lib/gloo_lang/help/objs/system/ssh_exec.txt +0 -30
- data/lib/gloo_lang/help/objs/system/system.txt +0 -32
- data/lib/gloo_lang/help/objs/web/http_get.txt +0 -35
- data/lib/gloo_lang/help/objs/web/http_post.txt +0 -34
- data/lib/gloo_lang/help/objs/web/json.txt +0 -34
- data/lib/gloo_lang/help/objs/web/slack.txt +0 -33
- data/lib/gloo_lang/help/objs/web/teams.txt +0 -30
- data/lib/gloo_lang/help/objs/web/uri.txt +0 -38
- data/lib/gloo_lang/help/verbs/alert.txt +0 -33
- data/lib/gloo_lang/help/verbs/beep.txt +0 -25
- data/lib/gloo_lang/help/verbs/cls.txt +0 -24
- data/lib/gloo_lang/help/verbs/context.txt +0 -43
- data/lib/gloo_lang/help/verbs/create.txt +0 -33
- data/lib/gloo_lang/help/verbs/execute.txt +0 -27
- data/lib/gloo_lang/help/verbs/help.txt +0 -34
- data/lib/gloo_lang/help/verbs/if.txt +0 -37
- data/lib/gloo_lang/help/verbs/list.txt +0 -34
- data/lib/gloo_lang/help/verbs/load.txt +0 -38
- data/lib/gloo_lang/help/verbs/move.txt +0 -42
- data/lib/gloo_lang/help/verbs/put.txt +0 -38
- data/lib/gloo_lang/help/verbs/quit.txt +0 -25
- data/lib/gloo_lang/help/verbs/run.txt +0 -41
- data/lib/gloo_lang/help/verbs/save.txt +0 -26
- data/lib/gloo_lang/help/verbs/show.txt +0 -30
- data/lib/gloo_lang/help/verbs/tell.txt +0 -34
- data/lib/gloo_lang/help/verbs/unless.txt +0 -38
- data/lib/gloo_lang/help/verbs/version.txt +0 -32
- data/lib/gloo_lang/help/verbs/wait.txt +0 -29
- data/lib/gloo_lang/verbs/help.rb +0 -264
- data/lib/gloo_lang/verbs/version.rb +0 -37
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b2fef4d21ce7b2ba45d4598fa24282c703581bbe1e40ea07f8e8063bf66a4b1b
|
|
4
|
+
data.tar.gz: dbd1b3b25f998023baa7c93044618f33bdca46de5ff068b2efd2093d156c5393
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9b859bb73c0b74b901ca5aaf2fba754c70d9b567c8725afa1ed20260f547b68264a9af8e96f391e94edd955a002de01417fbacc154f850309a2134b7f2d6ee81
|
|
7
|
+
data.tar.gz: b5cc88f9740a6766051579ea185b94b308f6628a61e13a1259871bd49350bb90acd9544ee47e3085c53daf33911ed312acc682373b244bd6b361e307b987be75
|
data/.gitignore
CHANGED
data/.ruby-gemset
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gloo-gem
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby-3.0.2
|
data/gloo-lang.gemspec
CHANGED
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
spec.require_paths = ['lib']
|
|
25
25
|
|
|
26
26
|
spec.add_development_dependency 'bundler', '~> 2.2.22'
|
|
27
|
-
spec.add_development_dependency 'minitest', '~> 5.1'
|
|
27
|
+
spec.add_development_dependency 'minitest', '~> 5.1', '>= 5.14.2'
|
|
28
28
|
spec.add_development_dependency "rake", '~> 13.0', '>= 13.0.1'
|
|
29
29
|
|
|
30
30
|
spec.add_dependency "activesupport", '~> 6.1', ">= 6.1.4.6"
|
|
@@ -33,6 +33,4 @@ Gem::Specification.new do |spec|
|
|
|
33
33
|
spec.add_dependency 'openssl', '~> 2.1', '>= 2.1.0'
|
|
34
34
|
spec.add_dependency 'net-ssh', '~> 6.1', '>= 6.1.0'
|
|
35
35
|
spec.add_dependency 'tty-platform', '~> 0.3', '>= 0.3.0'
|
|
36
|
-
# spec.add_dependency 'mysql2', '~> 0.5', '>= 0.5.3'
|
|
37
|
-
# spec.add_dependency 'sqlite3', '~> 1.4', '>= 1.4.2'
|
|
38
36
|
end
|
data/lib/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.1.0
|
data/lib/gloo_lang/app/engine.rb
CHANGED
|
@@ -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, :
|
|
18
|
+
:exec_env, :converter
|
|
19
19
|
|
|
20
20
|
#
|
|
21
21
|
# Set up the engine with basic elements.
|
|
@@ -52,13 +52,48 @@ 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'
|
|
59
58
|
run_mode
|
|
60
59
|
end
|
|
61
60
|
|
|
61
|
+
# ---------------------------------------------------------------------
|
|
62
|
+
# Serialization
|
|
63
|
+
# ---------------------------------------------------------------------
|
|
64
|
+
|
|
65
|
+
#
|
|
66
|
+
# Prepare for serialization by removing any file references.
|
|
67
|
+
# Without this, the engine cannot be serialized.
|
|
68
|
+
#
|
|
69
|
+
def prep_serialize
|
|
70
|
+
@log.prep_serialize
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
#
|
|
74
|
+
# Get the serialized version of this Engine.
|
|
75
|
+
#
|
|
76
|
+
def serialize
|
|
77
|
+
prep_serialize
|
|
78
|
+
Marshal::dump( self )
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
#
|
|
82
|
+
# Deserialize the Engine data.
|
|
83
|
+
#
|
|
84
|
+
def self.deserialize data
|
|
85
|
+
e = Marshal::load( data )
|
|
86
|
+
e.restore_after_deserialization
|
|
87
|
+
return e
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
#
|
|
91
|
+
# Restore the engine after deserialization.
|
|
92
|
+
#
|
|
93
|
+
def restore_after_deserialization
|
|
94
|
+
@log.restore_after_deserialization
|
|
95
|
+
end
|
|
96
|
+
|
|
62
97
|
# ---------------------------------------------------------------------
|
|
63
98
|
# Run
|
|
64
99
|
# ---------------------------------------------------------------------
|
|
@@ -71,10 +106,10 @@ module GlooLang
|
|
|
71
106
|
|
|
72
107
|
if @mode == Mode::VERSION
|
|
73
108
|
run_version
|
|
74
|
-
elsif @mode == Mode::HELP
|
|
75
|
-
show_help_and_quit
|
|
76
109
|
elsif @mode == Mode::SCRIPT
|
|
77
110
|
run_files
|
|
111
|
+
elsif @mode == Mode::EMBED
|
|
112
|
+
run_keep_alive
|
|
78
113
|
else
|
|
79
114
|
run
|
|
80
115
|
end
|
|
@@ -105,6 +140,14 @@ module GlooLang
|
|
|
105
140
|
quit
|
|
106
141
|
end
|
|
107
142
|
|
|
143
|
+
#
|
|
144
|
+
# Run in Embedded mode, which means we'll
|
|
145
|
+
# start the engine, but wait for external inputs.
|
|
146
|
+
#
|
|
147
|
+
def run_keep_alive
|
|
148
|
+
@log.debug 'Running in Embedded mode...'
|
|
149
|
+
end
|
|
150
|
+
|
|
108
151
|
#
|
|
109
152
|
# Get the setting for the start_with file and open it.
|
|
110
153
|
#
|
|
@@ -171,14 +214,6 @@ module GlooLang
|
|
|
171
214
|
quit
|
|
172
215
|
end
|
|
173
216
|
|
|
174
|
-
#
|
|
175
|
-
# Show the help information and then quit.
|
|
176
|
-
#
|
|
177
|
-
def show_help_and_quit
|
|
178
|
-
@help.show_app_help
|
|
179
|
-
quit
|
|
180
|
-
end
|
|
181
|
-
|
|
182
217
|
# ---------------------------------------------------------------------
|
|
183
218
|
# Error Handling
|
|
184
219
|
# ---------------------------------------------------------------------
|
data/lib/gloo_lang/app/log.rb
CHANGED
|
@@ -12,6 +12,10 @@ module GlooLang
|
|
|
12
12
|
attr_accessor :quiet
|
|
13
13
|
attr_reader :logger
|
|
14
14
|
|
|
15
|
+
# ---------------------------------------------------------------------
|
|
16
|
+
# Initialization
|
|
17
|
+
# ---------------------------------------------------------------------
|
|
18
|
+
|
|
15
19
|
#
|
|
16
20
|
# Set up a logger.
|
|
17
21
|
# If quiet is true, then message are written to the log
|
|
@@ -19,14 +23,26 @@ module GlooLang
|
|
|
19
23
|
#
|
|
20
24
|
def initialize( engine, quiet=true )
|
|
21
25
|
@engine = engine
|
|
22
|
-
f = File.join( @engine.settings.log_path, 'gloo.log' )
|
|
23
|
-
@logger = Logger.new( f )
|
|
24
|
-
@logger.level = Logger::DEBUG
|
|
25
26
|
@quite = quiet
|
|
26
27
|
|
|
28
|
+
create_logger
|
|
29
|
+
|
|
27
30
|
debug 'log intialized...'
|
|
28
31
|
end
|
|
29
32
|
|
|
33
|
+
#
|
|
34
|
+
# Create the default [file] logger.
|
|
35
|
+
#
|
|
36
|
+
def create_logger
|
|
37
|
+
f = File.join( @engine.settings.log_path, 'gloo.log' )
|
|
38
|
+
@logger = Logger.new( f )
|
|
39
|
+
@logger.level = Logger::DEBUG
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# ---------------------------------------------------------------------
|
|
43
|
+
# Standard Output
|
|
44
|
+
# ---------------------------------------------------------------------
|
|
45
|
+
|
|
30
46
|
#
|
|
31
47
|
# Show a message unless we're in quite mode.
|
|
32
48
|
#
|
|
@@ -34,6 +50,10 @@ module GlooLang
|
|
|
34
50
|
puts msg unless @quiet
|
|
35
51
|
end
|
|
36
52
|
|
|
53
|
+
# ---------------------------------------------------------------------
|
|
54
|
+
# Logging functions
|
|
55
|
+
# ---------------------------------------------------------------------
|
|
56
|
+
|
|
37
57
|
#
|
|
38
58
|
# Write a debug message to the log.
|
|
39
59
|
#
|
|
@@ -78,6 +98,25 @@ module GlooLang
|
|
|
78
98
|
end
|
|
79
99
|
end
|
|
80
100
|
|
|
101
|
+
# ---------------------------------------------------------------------
|
|
102
|
+
# Serialization
|
|
103
|
+
# ---------------------------------------------------------------------
|
|
104
|
+
|
|
105
|
+
#
|
|
106
|
+
# Prepare for serialization by removing the file reference.
|
|
107
|
+
# Without this, the engine cannot be serialized.
|
|
108
|
+
#
|
|
109
|
+
def prep_serialize
|
|
110
|
+
@logger = nil
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
#
|
|
114
|
+
# Restore the logger after deserialization.
|
|
115
|
+
#
|
|
116
|
+
def restore_after_deserialization
|
|
117
|
+
create_logger
|
|
118
|
+
end
|
|
119
|
+
|
|
81
120
|
end
|
|
82
121
|
end
|
|
83
122
|
end
|
data/lib/gloo_lang/core/heap.rb
CHANGED
|
@@ -23,10 +23,10 @@ module GlooLang
|
|
|
23
23
|
@engine = engine
|
|
24
24
|
@engine.log.debug 'object heap intialized...'
|
|
25
25
|
|
|
26
|
-
@root = GlooLang::Objs::Container.new( @engine)
|
|
26
|
+
@root = GlooLang::Objs::Container.new( @engine )
|
|
27
27
|
@root.name = 'root'
|
|
28
28
|
|
|
29
|
-
@context = Pn.root engine
|
|
29
|
+
@context = Pn.root @engine
|
|
30
30
|
@it = It.new
|
|
31
31
|
@error = Error.new
|
|
32
32
|
end
|
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.
|
|
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-
|
|
11
|
+
date: 2022-07-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -31,6 +31,9 @@ dependencies:
|
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '5.1'
|
|
34
|
+
- - ">="
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: 5.14.2
|
|
34
37
|
type: :development
|
|
35
38
|
prerelease: false
|
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -38,6 +41,9 @@ dependencies:
|
|
|
38
41
|
- - "~>"
|
|
39
42
|
- !ruby/object:Gem::Version
|
|
40
43
|
version: '5.1'
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: 5.14.2
|
|
41
47
|
- !ruby/object:Gem::Dependency
|
|
42
48
|
name: rake
|
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -186,9 +192,10 @@ extensions: []
|
|
|
186
192
|
extra_rdoc_files: []
|
|
187
193
|
files:
|
|
188
194
|
- ".gitignore"
|
|
195
|
+
- ".ruby-gemset"
|
|
196
|
+
- ".ruby-version"
|
|
189
197
|
- CODE_OF_CONDUCT.md
|
|
190
198
|
- Gemfile
|
|
191
|
-
- Gemfile.lock
|
|
192
199
|
- LICENSE.txt
|
|
193
200
|
- README.md
|
|
194
201
|
- Rakefile
|
|
@@ -201,7 +208,6 @@ files:
|
|
|
201
208
|
- lib/gloo_lang/app/args.rb
|
|
202
209
|
- lib/gloo_lang/app/engine.rb
|
|
203
210
|
- lib/gloo_lang/app/engine_context.rb
|
|
204
|
-
- lib/gloo_lang/app/help.rb
|
|
205
211
|
- lib/gloo_lang/app/info.rb
|
|
206
212
|
- lib/gloo_lang/app/log.rb
|
|
207
213
|
- lib/gloo_lang/app/mode.rb
|
|
@@ -243,81 +249,6 @@ files:
|
|
|
243
249
|
- lib/gloo_lang/expr/op_minus.rb
|
|
244
250
|
- lib/gloo_lang/expr/op_mult.rb
|
|
245
251
|
- lib/gloo_lang/expr/op_plus.rb
|
|
246
|
-
- lib/gloo_lang/help/app/application.txt
|
|
247
|
-
- lib/gloo_lang/help/app/configuration.txt
|
|
248
|
-
- lib/gloo_lang/help/app/default_help.txt
|
|
249
|
-
- lib/gloo_lang/help/app/logging.txt
|
|
250
|
-
- lib/gloo_lang/help/core/color.txt
|
|
251
|
-
- lib/gloo_lang/help/core/error.txt
|
|
252
|
-
- lib/gloo_lang/help/core/events.txt
|
|
253
|
-
- lib/gloo_lang/help/core/gloo_system.txt
|
|
254
|
-
- lib/gloo_lang/help/core/here.txt
|
|
255
|
-
- lib/gloo_lang/help/core/it.txt
|
|
256
|
-
- lib/gloo_lang/help/core/ops.txt
|
|
257
|
-
- lib/gloo_lang/help/core/pathname.txt
|
|
258
|
-
- lib/gloo_lang/help/objs/basic/alias.txt
|
|
259
|
-
- lib/gloo_lang/help/objs/basic/boolean.txt
|
|
260
|
-
- lib/gloo_lang/help/objs/basic/container.txt
|
|
261
|
-
- lib/gloo_lang/help/objs/basic/decimal.txt
|
|
262
|
-
- lib/gloo_lang/help/objs/basic/integer.txt
|
|
263
|
-
- lib/gloo_lang/help/objs/basic/script.txt
|
|
264
|
-
- lib/gloo_lang/help/objs/basic/string.txt
|
|
265
|
-
- lib/gloo_lang/help/objs/basic/text.txt
|
|
266
|
-
- lib/gloo_lang/help/objs/basic/untyped.txt
|
|
267
|
-
- lib/gloo_lang/help/objs/cli/banner.txt
|
|
268
|
-
- lib/gloo_lang/help/objs/cli/bar.txt
|
|
269
|
-
- lib/gloo_lang/help/objs/cli/colorize.txt
|
|
270
|
-
- lib/gloo_lang/help/objs/cli/confirm.txt
|
|
271
|
-
- lib/gloo_lang/help/objs/cli/menu.txt
|
|
272
|
-
- lib/gloo_lang/help/objs/cli/menu_item.txt
|
|
273
|
-
- lib/gloo_lang/help/objs/cli/pastel.txt
|
|
274
|
-
- lib/gloo_lang/help/objs/cli/prompt.txt
|
|
275
|
-
- lib/gloo_lang/help/objs/cli/select.txt
|
|
276
|
-
- lib/gloo_lang/help/objs/ctrl/each.txt
|
|
277
|
-
- lib/gloo_lang/help/objs/ctrl/repeat.txt
|
|
278
|
-
- lib/gloo_lang/help/objs/data/markdown.txt
|
|
279
|
-
- lib/gloo_lang/help/objs/data/mysql.txt
|
|
280
|
-
- lib/gloo_lang/help/objs/data/query.txt
|
|
281
|
-
- lib/gloo_lang/help/objs/data/sqlite.txt
|
|
282
|
-
- lib/gloo_lang/help/objs/data/table.txt
|
|
283
|
-
- lib/gloo_lang/help/objs/dev/git_repo.txt
|
|
284
|
-
- lib/gloo_lang/help/objs/dev/stats.txt
|
|
285
|
-
- lib/gloo_lang/help/objs/dt/date.txt
|
|
286
|
-
- lib/gloo_lang/help/objs/dt/datetime.txt
|
|
287
|
-
- lib/gloo_lang/help/objs/dt/time.txt
|
|
288
|
-
- lib/gloo_lang/help/objs/ror/erb.txt
|
|
289
|
-
- lib/gloo_lang/help/objs/ror/eval.txt
|
|
290
|
-
- lib/gloo_lang/help/objs/snd/play.txt
|
|
291
|
-
- lib/gloo_lang/help/objs/snd/say.txt
|
|
292
|
-
- lib/gloo_lang/help/objs/system/file.txt
|
|
293
|
-
- lib/gloo_lang/help/objs/system/ssh_exec.txt
|
|
294
|
-
- lib/gloo_lang/help/objs/system/system.txt
|
|
295
|
-
- lib/gloo_lang/help/objs/web/http_get.txt
|
|
296
|
-
- lib/gloo_lang/help/objs/web/http_post.txt
|
|
297
|
-
- lib/gloo_lang/help/objs/web/json.txt
|
|
298
|
-
- lib/gloo_lang/help/objs/web/slack.txt
|
|
299
|
-
- lib/gloo_lang/help/objs/web/teams.txt
|
|
300
|
-
- lib/gloo_lang/help/objs/web/uri.txt
|
|
301
|
-
- lib/gloo_lang/help/verbs/alert.txt
|
|
302
|
-
- lib/gloo_lang/help/verbs/beep.txt
|
|
303
|
-
- lib/gloo_lang/help/verbs/cls.txt
|
|
304
|
-
- lib/gloo_lang/help/verbs/context.txt
|
|
305
|
-
- lib/gloo_lang/help/verbs/create.txt
|
|
306
|
-
- lib/gloo_lang/help/verbs/execute.txt
|
|
307
|
-
- lib/gloo_lang/help/verbs/help.txt
|
|
308
|
-
- lib/gloo_lang/help/verbs/if.txt
|
|
309
|
-
- lib/gloo_lang/help/verbs/list.txt
|
|
310
|
-
- lib/gloo_lang/help/verbs/load.txt
|
|
311
|
-
- lib/gloo_lang/help/verbs/move.txt
|
|
312
|
-
- lib/gloo_lang/help/verbs/put.txt
|
|
313
|
-
- lib/gloo_lang/help/verbs/quit.txt
|
|
314
|
-
- lib/gloo_lang/help/verbs/run.txt
|
|
315
|
-
- lib/gloo_lang/help/verbs/save.txt
|
|
316
|
-
- lib/gloo_lang/help/verbs/show.txt
|
|
317
|
-
- lib/gloo_lang/help/verbs/tell.txt
|
|
318
|
-
- lib/gloo_lang/help/verbs/unless.txt
|
|
319
|
-
- lib/gloo_lang/help/verbs/version.txt
|
|
320
|
-
- lib/gloo_lang/help/verbs/wait.txt
|
|
321
252
|
- lib/gloo_lang/objs/basic/alias.rb
|
|
322
253
|
- lib/gloo_lang/objs/basic/boolean.rb
|
|
323
254
|
- lib/gloo_lang/objs/basic/container.rb
|
|
@@ -354,7 +285,6 @@ files:
|
|
|
354
285
|
- lib/gloo_lang/verbs/context.rb
|
|
355
286
|
- lib/gloo_lang/verbs/create.rb
|
|
356
287
|
- lib/gloo_lang/verbs/execute.rb
|
|
357
|
-
- lib/gloo_lang/verbs/help.rb
|
|
358
288
|
- lib/gloo_lang/verbs/if.rb
|
|
359
289
|
- lib/gloo_lang/verbs/list.rb
|
|
360
290
|
- lib/gloo_lang/verbs/load.rb
|
|
@@ -366,7 +296,6 @@ files:
|
|
|
366
296
|
- lib/gloo_lang/verbs/show.rb
|
|
367
297
|
- lib/gloo_lang/verbs/tell.rb
|
|
368
298
|
- lib/gloo_lang/verbs/unless.rb
|
|
369
|
-
- lib/gloo_lang/verbs/version.rb
|
|
370
299
|
- lib/gloo_lang/verbs/wait.rb
|
|
371
300
|
homepage: http://github.com/ecrane/gloo_lang
|
|
372
301
|
licenses:
|
data/Gemfile.lock
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
gloo-lang (0.9.11)
|
|
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)
|
|
64
|
-
rake (~> 13.0, >= 13.0.1)
|
|
65
|
-
rubocop
|
|
66
|
-
|
|
67
|
-
BUNDLED WITH
|
|
68
|
-
2.2.22
|
data/lib/gloo_lang/app/help.rb
DELETED
|
@@ -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,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
|