gloo 4.6.1 → 5.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.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/gloo.gemspec +22 -11
  4. data/lib/VERSION +1 -1
  5. data/lib/VERSION_NOTES +12 -0
  6. data/lib/gloo/app/engine.rb +8 -1
  7. data/lib/gloo/app/running_app.rb +13 -0
  8. data/lib/gloo/app/settings.rb +5 -1
  9. data/lib/gloo/core/dictionary.rb +15 -2
  10. data/lib/gloo/objs/ctrl/each.rb +2 -2
  11. data/lib/gloo/plugin/base.rb +19 -0
  12. data/lib/gloo/plugin/callback.rb +33 -0
  13. data/lib/gloo/plugin/ext_manager.rb +90 -0
  14. data/lib/gloo/plugin/lib_manager.rb +97 -0
  15. data/lib/gloo/verbs/exists.rb +75 -0
  16. data/lib/gloo/verbs/help.rb +58 -1
  17. data/lib/gloo/verbs/load.rb +49 -5
  18. data/lib/gloo/verbs/redirect.rb +2 -1
  19. metadata +38 -166
  20. data/lib/gloo/objs/cli/colorize.rb +0 -73
  21. data/lib/gloo/objs/cli/confirm.rb +0 -96
  22. data/lib/gloo/objs/cli/menu.rb +0 -370
  23. data/lib/gloo/objs/cli/menu_item.rb +0 -95
  24. data/lib/gloo/objs/cli/prompt.rb +0 -110
  25. data/lib/gloo/objs/cli/select.rb +0 -127
  26. data/lib/gloo/objs/ctrl/each_repo.rb +0 -84
  27. data/lib/gloo/objs/data/markdown.rb +0 -133
  28. data/lib/gloo/objs/data/markdown_ext.rb +0 -260
  29. data/lib/gloo/objs/data/mysql.rb +0 -254
  30. data/lib/gloo/objs/data/pg.rb +0 -216
  31. data/lib/gloo/objs/data/query.rb +0 -269
  32. data/lib/gloo/objs/data/query_result.rb +0 -158
  33. data/lib/gloo/objs/data/sqlite.rb +0 -174
  34. data/lib/gloo/objs/data/table.rb +0 -267
  35. data/lib/gloo/objs/dev/git.rb +0 -140
  36. data/lib/gloo/objs/dev/stats.rb +0 -123
  37. data/lib/gloo/objs/system/ssh_exec.rb +0 -126
  38. data/lib/gloo/objs/web/slack.rb +0 -130
  39. data/lib/gloo/objs/web/teams.rb +0 -117
  40. data/lib/gloo/objs/web_svr/element.rb +0 -254
  41. data/lib/gloo/objs/web_svr/field.rb +0 -429
  42. data/lib/gloo/objs/web_svr/form.rb +0 -271
  43. data/lib/gloo/objs/web_svr/page.rb +0 -562
  44. data/lib/gloo/objs/web_svr/partial.rb +0 -210
  45. data/lib/gloo/objs/web_svr/svr.rb +0 -713
  46. data/lib/gloo/utils/stats.rb +0 -206
  47. data/lib/gloo/verbs/alert.rb +0 -79
  48. data/lib/gloo/verbs/beep.rb +0 -40
  49. data/lib/gloo/web_svr/asset.rb +0 -407
  50. data/lib/gloo/web_svr/asset_info.rb +0 -116
  51. data/lib/gloo/web_svr/config.rb +0 -56
  52. data/lib/gloo/web_svr/embedded_renderer.rb +0 -154
  53. data/lib/gloo/web_svr/handler.rb +0 -154
  54. data/lib/gloo/web_svr/request.rb +0 -143
  55. data/lib/gloo/web_svr/request_params.rb +0 -181
  56. data/lib/gloo/web_svr/response.rb +0 -177
  57. data/lib/gloo/web_svr/response_code.rb +0 -69
  58. data/lib/gloo/web_svr/routing/resource_router.rb +0 -47
  59. data/lib/gloo/web_svr/routing/router.rb +0 -232
  60. data/lib/gloo/web_svr/routing/show_routes.rb +0 -94
  61. data/lib/gloo/web_svr/server.rb +0 -105
  62. data/lib/gloo/web_svr/session.rb +0 -215
  63. data/lib/gloo/web_svr/table_renderer.rb +0 -151
  64. data/lib/gloo/web_svr/web_method.rb +0 -54
  65. /data/lib/gloo/objs/{security → str_utils}/cipher.rb +0 -0
  66. /data/lib/gloo/objs/{security → str_utils}/csrf_token.rb +0 -0
  67. /data/lib/gloo/objs/{security → str_utils}/password.rb +0 -0
  68. /data/lib/gloo/objs/{ror → system}/erb.rb +0 -0
  69. /data/lib/gloo/objs/{ror → system}/eval.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83c998e950da4cdd0f74ce85512de237f9fd73bc9187fe55b49c6bb554e13bc1
4
- data.tar.gz: 07e00df49aea7385673b27c5cb31cc6e5d4f926cebabe7f14d754a04e3eae949
3
+ metadata.gz: 124d817789d21c4e9899f12195b66ae06cb26a8cba150a03a3b97ec63a524160
4
+ data.tar.gz: 3694e28d17ff419835889026b25ef96bc7316e13cc3c8c51e42dcde215ccaca1
5
5
  SHA512:
6
- metadata.gz: a0ed6794423d73bb4adaf913662cf28dd9095ea07b1885feb422384cd394acbafbd362da0b60d4384a04f44ca49b1a1c4a3a9d4f84f9caa8fb48b5bbf74e0380
7
- data.tar.gz: 6cd54ec494fff41b92e9fb8788ae0e6c76b412ae2eba2a0ae8fe466ecfc45936743bf3d08d37e2a9cf02bf8d4905cc3ba8d60dd7d11d2fec7bbe8ac520c7861b
6
+ metadata.gz: 729f3041b377589a22186b4fbe42b9971e3376f4404a2b5f1bc21b312d92b490b90dc40edcf5e651ba41799371f4594c8c9c1a17170c1c36e2d2488972d3a8b8
7
+ data.tar.gz: 6e8162b00779c17012b2ac0177686a98928729a34e46390bf742df663c61266ae8024f5dfbd32a2c75a2db1949f766add6b218282620160ec59e325673569261
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2022 Eric Crane
3
+ Copyright (c) 2026 Eric Crane
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/gloo.gemspec CHANGED
@@ -27,27 +27,38 @@ Gem::Specification.new do |spec|
27
27
  spec.executables << 'o'
28
28
  spec.executables << 'gloo'
29
29
 
30
+ #
31
+ # Development Dependencies
32
+ #
30
33
  spec.add_development_dependency 'bundler'
31
34
  spec.add_development_dependency 'minitest', '~> 5.1', '>= 5.14.2'
32
35
  spec.add_development_dependency "rake", '~> 13.0', '>= 13.0.1'
33
36
  spec.add_development_dependency 'concurrent-ruby', '1.3.4'
34
37
 
38
+ # Used by many objects
35
39
  spec.add_dependency "activesupport", '~> 6.1', ">= 6.1.5"
40
+
41
+ # Used by date and time tools
36
42
  spec.add_dependency 'chronic', '~> 0.10', '>= 0.10.2'
37
43
 
44
+ # Used by json tools
45
+ spec.add_dependency 'json', '~> 2.1', '>= 2.1.0'
46
+
47
+ # Used by cipher string tool
48
+ spec.add_dependency 'openssl'
49
+
50
+ # Used by password generation
51
+ spec.add_dependency 'bcrypt', '~> 3.1.20'
52
+
53
+ # Used by gloo system
54
+ spec.add_dependency 'os', '~> 1.1', '>= 1.1.4'
55
+
56
+ #
57
+ # App UI libs
58
+ #
38
59
  spec.add_dependency 'colorize', '~> 1.1.0', '>= 1.1.0'
39
60
  spec.add_dependency 'inquirer'
40
61
  spec.add_dependency 'reline'
41
62
  spec.add_dependency 'terminal-table'
42
-
43
- spec.add_dependency 'json', '~> 2.1', '>= 2.1.0'
44
- spec.add_dependency 'openssl'
45
- spec.add_dependency 'net-ssh', '~> 6.1', '>= 6.1.0'
46
- spec.add_dependency 'mysql2', '~> 0.5', '>= 0.5.3'
47
- spec.add_dependency 'sqlite3', '~> 1.4', '>= 1.4.2'
48
- spec.add_dependency 'os', '~> 1.1', '>= 1.1.4'
49
- # spec.add_dependency 'pg', '~> 1.5.4'
50
- spec.add_dependency 'thin', '~> 1.8.2'
51
- spec.add_dependency 'redcarpet', '~> 3.6.0'
52
- spec.add_dependency 'bcrypt', '~> 3.1.20'
63
+
53
64
  end
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 4.6.1
1
+ 5.0
data/lib/VERSION_NOTES CHANGED
@@ -1,3 +1,15 @@
1
+ 5.0 - 2026.02.07
2
+ - Adds plugin systems for extensions and core libraries
3
+ - Adds exists? verb
4
+ - Updates help to show extensions and libraries
5
+ - Moves a number of objects into the new core libraries structure
6
+
7
+
8
+ 4.7.0 - 2026.01.18
9
+ - Adds the Extension Manager.
10
+ - Moves alert, beep, slack, teams out of gloo into extensions.
11
+
12
+
1
13
  4.6.1 - 2025.09.25
2
14
  - Adds container support to object to JSON conversion.
3
15
 
@@ -13,7 +13,8 @@ module Gloo
13
13
 
14
14
  attr_reader :settings, :log, :running_app
15
15
  attr_reader :args, :mode, :running, :platform,
16
- :dictionary, :parser, :heap, :factory
16
+ :dictionary, :parser, :heap, :factory,
17
+ :ext_manager, :lib_manager
17
18
  attr_accessor :last_cmd, :persist_man, :event_manager,
18
19
  :exec_env, :converter
19
20
 
@@ -50,6 +51,8 @@ module Gloo
50
51
  @factory = Gloo::Core::Factory.new( self )
51
52
  @persist_man = Gloo::Persist::PersistMan.new( self )
52
53
  @event_manager = Gloo::Core::EventManager.new( self )
54
+ @ext_manager = Gloo::Plugin::ExtManager.new( self )
55
+ @lib_manager = Gloo::Plugin::LibManager.new( self )
53
56
 
54
57
  @exec_env = Gloo::Exec::ExecEnv.new( self )
55
58
  @converter = Gloo::Convert::Converter.new( self )
@@ -58,6 +61,7 @@ module Gloo
58
61
  run_mode
59
62
  end
60
63
 
64
+
61
65
  # ---------------------------------------------------------------------
62
66
  # Serialization
63
67
  # ---------------------------------------------------------------------
@@ -94,6 +98,7 @@ module Gloo
94
98
  @log.restore_after_deserialization
95
99
  end
96
100
 
101
+
97
102
  # ---------------------------------------------------------------------
98
103
  # Run
99
104
  # ---------------------------------------------------------------------
@@ -227,6 +232,7 @@ module Gloo
227
232
  @log.info 'Gloo engine is quitting...'
228
233
  end
229
234
 
235
+
230
236
  # ---------------------------------------------------------------------
231
237
  # Running app within gloo
232
238
  # ---------------------------------------------------------------------
@@ -267,6 +273,7 @@ module Gloo
267
273
  quit
268
274
  end
269
275
 
276
+
270
277
  # ---------------------------------------------------------------------
271
278
  # Error Handling
272
279
  # ---------------------------------------------------------------------
@@ -77,6 +77,19 @@ module Gloo
77
77
  return @db_clients[ obj.pn ]
78
78
  end
79
79
 
80
+
81
+ # ---------------------------------------------------------------------
82
+ # Running app helpers
83
+ # ---------------------------------------------------------------------
84
+
85
+ #
86
+ # Create a table renderer if the web server core lib is loaded.
87
+ #
88
+ def create_table_renderer
89
+ # if exists
90
+ return WebSvr::TableRenderer.new( @engine )
91
+ end
92
+
80
93
  end
81
94
  end
82
95
  end
@@ -11,7 +11,7 @@ module Gloo
11
11
  class Settings
12
12
 
13
13
  attr_reader :user_root, :log_path,
14
- :config_path, :project_path,
14
+ :config_path, :project_path, :ext_path,
15
15
  :start_with, :list_indent, :list_levels, :tmp_path,
16
16
  :debug_path, :debug
17
17
 
@@ -50,6 +50,7 @@ module Gloo
50
50
  puts "\n Application Paths:".blue
51
51
  puts ' User Root Path is here: '.yellow + @user_root.white
52
52
  puts ' Projects Path: '.yellow + @project_path.white
53
+ puts ' Extensions Path: '.yellow + @ext_path.white
53
54
  puts ' Tmp Path: '.yellow + @tmp_path.white
54
55
  puts ' Debug Path: '.yellow + @debug_path.white
55
56
  puts "\n"
@@ -131,6 +132,9 @@ module Gloo
131
132
  @config_path = File.join( @user_root, 'config' )
132
133
  Dir.mkdir( @config_path ) unless File.exist?( @config_path )
133
134
 
135
+ @ext_path = File.join( @user_root, 'extensions' )
136
+ Dir.mkdir( @ext_path ) unless File.exist?( @ext_path )
137
+
134
138
  @tmp_path = File.join( @user_root, 'tmp' )
135
139
  Dir.mkdir( @tmp_path ) unless File.exist?( @tmp_path )
136
140
 
@@ -138,6 +138,7 @@ module Gloo
138
138
  end
139
139
  end
140
140
 
141
+
141
142
  # ---------------------------------------------------------------------
142
143
  # Register after start up
143
144
  # ---------------------------------------------------------------------
@@ -178,6 +179,7 @@ module Gloo
178
179
  @keywords.delete( obj_class.short_typename )
179
180
  end
180
181
 
182
+
181
183
  # ---------------------------------------------------------------------
182
184
  # Private
183
185
  # ---------------------------------------------------------------------
@@ -221,7 +223,12 @@ module Gloo
221
223
  # Add an object to the dictionary
222
224
  #
223
225
  def add_object o
224
- # @engine.log.debug o
226
+ # Make sure it hasn't already been registered
227
+ if ( @objs.key?(o.typename) || @objs.key?(o.short_typename) )
228
+ @engine.err "duplicate object type '#{o.typename}' or '#{o.short_typename}'"
229
+ return
230
+ end
231
+
225
232
  @objs[ o.typename ] = o
226
233
  @objs[ o.short_typename ] = o
227
234
  add_key o.typename
@@ -232,7 +239,13 @@ module Gloo
232
239
  # Add a verb to the dictionary
233
240
  #
234
241
  def add_verb v
235
- # @engine.log.debug v
242
+ # Make sure it hasn't already been registered
243
+ if ( verb?( v.keyword ) || verb?( v.keyword_shortcut ))
244
+ puts "duplicate verb keyword '#{v.keyword}' or '#{v.keyword_shortcut}'"
245
+ @engine.err "duplicate verb keyword '#{v.keyword}' or '#{v.keyword_shortcut}'"
246
+ return
247
+ end
248
+
236
249
  @verbs[ v.keyword ] = v
237
250
  @verbs[ v.keyword_shortcut ] = v
238
251
  # v.send( :new ).run
@@ -100,8 +100,8 @@ module Gloo
100
100
  EachLine.new( @engine, self ).run
101
101
  elsif EachFile.use_for?( self )
102
102
  EachFile.new( @engine, self ).run
103
- elsif EachRepo.use_for?( self )
104
- EachRepo.new( @engine, self ).run
103
+ # elsif EachRepo.use_for?( self )
104
+ # EachRepo.new( @engine, self ).run
105
105
  else
106
106
  @engine.err "Not set up to run each for that target."
107
107
  end
@@ -0,0 +1,19 @@
1
+ #
2
+ # A Base class for extensions.
3
+ # Used by extensions to register verbs and objects.
4
+ #
5
+ module Gloo
6
+ module Plugin
7
+ class Base
8
+
9
+ #
10
+ # Register verbs and objects.
11
+ #
12
+ def register( callback )
13
+ raise NotImplementedError, "Extensions must implement register method"
14
+ end
15
+
16
+ end
17
+ end
18
+ end
19
+
@@ -0,0 +1,33 @@
1
+ #
2
+ # A mechanism for registering extension components.
3
+ #
4
+ module Gloo
5
+ module Plugin
6
+ class Callback
7
+
8
+ #
9
+ # Initialize the callback.
10
+ #
11
+ def initialize( engine )
12
+ @engine = engine
13
+ end
14
+
15
+ #
16
+ # Register a verb.
17
+ #
18
+ def register_verb( verb_class )
19
+ @engine.log.debug "Registering verb: #{verb_class} from callbackup helper"
20
+ @engine.dictionary.register_verb_post_start( verb_class )
21
+ end
22
+
23
+ #
24
+ # Register an object.
25
+ #
26
+ def register_obj( object_class )
27
+ @engine.log.debug "Registering object: #{object_class} from callback helper"
28
+ @engine.dictionary.register_obj_post_start( object_class )
29
+ end
30
+
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,90 @@
1
+ # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
+ # Copyright:: Copyright (c) 2026 Eric Crane. All rights reserved.
3
+ #
4
+ # The Extension Manager.
5
+ # Load extensions as needed and register their verbs and objects.
6
+ #
7
+
8
+ module Gloo
9
+ module Plugin
10
+ class ExtManager
11
+
12
+ # Constants for extension management
13
+ EXT_FILE = '_ext.rb'
14
+
15
+ #
16
+ # Set up the extension manager.
17
+ #
18
+ def initialize( engine )
19
+ @engine = engine
20
+ @extensions = {}
21
+ @engine.log.debug 'extension manager intialized...'
22
+ end
23
+
24
+ #
25
+ # Get the loaded extensions.
26
+ #
27
+ def loaded_extensions
28
+ return @extensions
29
+ end
30
+
31
+ #
32
+ # Get the start file for the extension.
33
+ #
34
+ def ext_start_file name
35
+ root = @engine.settings.ext_path
36
+
37
+ unless File.exist?( root )
38
+ @engine.log.error "Extension directory does not exist: #{root}"
39
+ return nil
40
+ end
41
+
42
+ f = File.join( root, name, name + EXT_FILE )
43
+ unless File.exist?( f )
44
+ @engine.log.error "Extension start file does not exist: #{f}"
45
+ return nil
46
+ end
47
+
48
+ return f
49
+ end
50
+
51
+ #
52
+ # Load the extension of the given name.
53
+ # The name will correspond with the name of a directory
54
+ # within the gloo extensions directory.
55
+ #
56
+ def load_ext( name )
57
+ @engine.log.debug "Loading extension: #{name}"
58
+ fn = ext_start_file name
59
+
60
+ unless fn
61
+ @engine.log.error "Extension start file not found for: #{name}"
62
+ return
63
+ end
64
+
65
+ @extensions[name] = fn
66
+ register_extension name, fn
67
+ @engine.log.debug "Extension loaded: #{name}"
68
+ end
69
+
70
+ #
71
+ # Give the extension a chance to register its verbs and objects.
72
+ #
73
+ def register_extension( name, full_path )
74
+ require full_path
75
+
76
+ class_name = name.capitalize + "Ext"
77
+ @engine.log.debug "Looking for extension to register: #{class_name}"
78
+ begin
79
+ plugin_class = Object.const_get( class_name )
80
+ inst = plugin_class.new
81
+ ext_cb = Callback.new( @engine )
82
+ inst.register( ext_cb )
83
+ rescue NameError
84
+ @engine.log.error "Warning: Could not find class #{class_name} in file #{full_path}"
85
+ end
86
+ end
87
+
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,97 @@
1
+ # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
+ # Copyright:: Copyright (c) 2026 Eric Crane. All rights reserved.
3
+ #
4
+ # The Library Manager.
5
+ # Load libraries as needed and register their verbs and objects.
6
+ #
7
+
8
+ module Gloo
9
+ module Plugin
10
+ class LibManager
11
+
12
+ # Constants for library management
13
+ GEM_PREFIX = 'gloo-'
14
+ INIT_CLASS_SUFFIX = 'Init'
15
+
16
+ #
17
+ # Set up the library manager.
18
+ #
19
+ def initialize( engine )
20
+ @engine = engine
21
+ @libraries = {}
22
+ @engine.log.debug 'library manager intialized...'
23
+ end
24
+
25
+ #
26
+ # Get the loaded libraries.
27
+ #
28
+ def loaded_libraries
29
+ return @libraries
30
+ end
31
+
32
+ #
33
+ # Get the start file for the gem core library.
34
+ #
35
+ def core_lib_name name
36
+ return GEM_PREFIX + name
37
+ end
38
+
39
+ #
40
+ # Get the library initialization class name.
41
+ #
42
+ def init_class_name name
43
+ return name.camelize + INIT_CLASS_SUFFIX
44
+ end
45
+
46
+ #
47
+ # Load the library of the given name.
48
+ # The name will correspond with the name of a directory
49
+ # within the gloo libraries directory.
50
+ #
51
+ def load_lib( name )
52
+ @engine.log.debug "Loading core library: #{name}"
53
+ gem_name = core_lib_name name
54
+
55
+ @libraries[name] = gem_name
56
+ register_library name, gem_name
57
+ @engine.log.debug "Core library loaded: #{name}"
58
+ end
59
+
60
+ #
61
+ # Require a gem by name, installing it if it's not available.
62
+ #
63
+ def require_gem gem_name
64
+ @engine.log.debug "Going to require gem: #{gem_name}"
65
+ begin
66
+ gem gem_name
67
+ rescue Gem::LoadError
68
+ @engine.log.info "Gem not found, attempting to install: #{gem_name}"
69
+ system("gem install #{gem_name}")
70
+ Gem.clear_paths
71
+ gem gem_name
72
+ end
73
+
74
+ require gem_name
75
+ end
76
+
77
+ #
78
+ # Give the library a chance to register its verbs and objects.
79
+ #
80
+ def register_library( name, gem_name )
81
+ require_gem gem_name
82
+
83
+ class_name = init_class_name name
84
+ @engine.log.debug "Looking for library entry point class to register: #{class_name}"
85
+ begin
86
+ plugin_class = Object.const_get( class_name )
87
+ inst = plugin_class.new
88
+ lib_cb = Callback.new( @engine )
89
+ inst.register( lib_cb )
90
+ rescue NameError
91
+ @engine.log.error "Warning: Could not find class #{class_name}"
92
+ end
93
+ end
94
+
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,75 @@
1
+ # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
+ # Copyright:: Copyright (c) 2026 Eric Crane. All rights reserved.
3
+ #
4
+ # Check to see if a verb or object type has been defined (or loaded).
5
+ #
6
+
7
+ module Gloo
8
+ module Verbs
9
+ class Exists < Gloo::Core::Verb
10
+
11
+ KEYWORD = 'exists?'.freeze
12
+ KEYWORD_SHORT = 'exist'.freeze
13
+ VERB_TYPE = 'verb'.freeze
14
+ OBJ_TYPE = 'object'.freeze
15
+ ANY_TYPE = 'any'.freeze
16
+ MISSING_EXPR_ERR = 'Missing Expression!'.freeze
17
+ WRONG_NUM_ARGS_ERR = 'Wrong number of arguments! 2 or 3 expected.'.freeze
18
+
19
+ #
20
+ # Run the verb.
21
+ #
22
+ def run
23
+ if @tokens.token_count == 3
24
+ type = @tokens.second.strip.downcase
25
+ keyword = @tokens.last
26
+ elsif @tokens.token_count == 2
27
+ type = ANY_TYPE
28
+ keyword = @tokens.second
29
+ else
30
+ @engine.err WRONG_NUM_ARGS_ERR
31
+ return
32
+ end
33
+
34
+ @engine.heap.it.set_to lookup_keyword(keyword, type)
35
+ end
36
+
37
+ #
38
+ # Get the Verb's keyword.
39
+ #
40
+ def self.keyword
41
+ return KEYWORD
42
+ end
43
+
44
+ #
45
+ # Get the Verb's keyword shortcut.
46
+ #
47
+ def self.keyword_shortcut
48
+ return KEYWORD_SHORT
49
+ end
50
+
51
+
52
+ # ---------------------------------------------------------------------
53
+ # Private functions
54
+ # ---------------------------------------------------------------------
55
+
56
+ private
57
+
58
+ #
59
+ # Lookup a keyword in the dictionary.
60
+ #
61
+ def lookup_keyword( keyword, type )
62
+ if type == VERB_TYPE
63
+ return @engine.dictionary.verb?(keyword)
64
+ elsif type == OBJ_TYPE
65
+ return @engine.dictionary.obj?(keyword)
66
+ elsif type == ANY_TYPE
67
+ return @engine.dictionary.verb?(keyword) || @engine.dictionary.obj?(keyword)
68
+ end
69
+
70
+ return false
71
+ end
72
+
73
+ end
74
+ end
75
+ end
@@ -22,7 +22,15 @@ module Gloo
22
22
  o: 'show_objs',
23
23
  obj: 'show_objs',
24
24
  object: 'show_objs',
25
- objects: 'show_objs'
25
+ objects: 'show_objs',
26
+ e: 'show_ext',
27
+ ext: 'show_ext',
28
+ l: 'show_lib',
29
+ lib: 'show_lib',
30
+ library: 'show_lib',
31
+ libraries: 'show_lib',
32
+ extension: 'show_ext',
33
+ extensions: 'show_ext'
26
34
  }.freeze
27
35
 
28
36
  #
@@ -91,6 +99,8 @@ module Gloo
91
99
  data << " Help Options:\n"
92
100
  data << " ? objects (obj, o) \n"
93
101
  data << " ? verbs (v) \n"
102
+ data << " ? ext (e) \n"
103
+ data << " ? lib (l) \n"
94
104
  data << " ? settings (s) \n"
95
105
  data << "\n For detailed documentation use the gloo website. \n"
96
106
  data << "\n https://gloo.ecrane.us/doc/. \n\n"
@@ -181,6 +191,53 @@ module Gloo
181
191
  return str
182
192
  end
183
193
 
194
+ #
195
+ # List the extensions
196
+ #
197
+ def show_ext
198
+ data = "\n"
199
+ data << " Extensions\n".blue
200
+ data << "#{get_extensions}\n\n"
201
+ @engine.log.show data
202
+ end
203
+
204
+ #
205
+ # Get the text for the list of extensions.
206
+ #
207
+ def get_extensions
208
+ str = ''
209
+ exts = @engine.ext_manager.loaded_extensions.sort
210
+ exts.each do |name, ext|
211
+ str << " #{name.white} \n"
212
+ end
213
+
214
+ return str
215
+ end
216
+
217
+ #
218
+ # List the libraries
219
+ #
220
+ def show_lib
221
+ data = "\n"
222
+ data << " Libraries\n".blue
223
+ data << "#{get_libraries}\n\n"
224
+ @engine.log.show data
225
+ end
226
+
227
+ #
228
+ # Get the text for the list of libraries.
229
+ #
230
+ def get_libraries
231
+ str = ''
232
+ libs = @engine.lib_manager.loaded_libraries.sort
233
+ libs.each do |name, lib|
234
+ str << " #{name.white} \n"
235
+ end
236
+
237
+ return str
238
+ end
239
+
240
+
184
241
  end
185
242
  end
186
243
  end