gloo 6.7.0 → 6.7.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7bec0a2a7c9eb15015734a7610359cc6b7c18abbc9abbb239131f9fad9927fcf
4
- data.tar.gz: a9d8810c5581416608f4913d1cd7f1b24e385fb4b1d47b74eb5e1dcd8aaafd47
3
+ metadata.gz: 30bb705151c6aba2341b5abed1367dcc82472c47067a38005cb02908355484dd
4
+ data.tar.gz: 07ba7e0152a9eb12aa6cecb465a3130797aef94440c4ce28215ae9a8a6f3b94e
5
5
  SHA512:
6
- metadata.gz: 17694e6f6a9019c0071248eb4c59ab80ffba8c352b7aa5341eeca150d0503e5176eabc0e00a0214d8a99c24e98fa045138dfb7783bb55c1c30198f0704235cec
7
- data.tar.gz: 6cff2396f6bdc2debed6ab6f03a43e5932a1fa4c5a54a07c40b0e5d18f3686721ca9ae90e05d60ea26fc416c93f66e1acb05de9141e9777afec78406c17181a6
6
+ metadata.gz: 296049f34bc49e69f35e2d448f86e9e57b11d288b68812b11603968fad73afdcd5d3a28379e0cbe9fb44b5f15ec8d8aae057c789724e566b2654ed0ea0f8c470
7
+ data.tar.gz: d1cf25192c7b36ababa30363a8fa61abf55976124c5a0532a7c7611607bf24bcc55988bec14f9f4f9bffdfec0aab82115993c4e64d60b828b2357e440a1d009e
data/docs/application.md CHANGED
@@ -61,6 +61,11 @@ When specifying a file there are a couple ways to reference the gloo file to ope
61
61
  - By default gloo will look for a start.gloo file in the
62
62
  root level of the project. That start.gloo file should load other files
63
63
  and run the app.
64
+ - Any further parameter(s) after the project path are not loaded by
65
+ gloo as files - they're passed through as a single command for the
66
+ app's own command handling (e.g. a [shell] object, from the cli core
67
+ library, runs it once via its execute_once) and gloo exits once that
68
+ command completes, instead of starting an interactive session.
64
69
  --script - Run in Script mode
65
70
  - Run the script in the file parameter and then quit.
66
71
  - If a file is provided as a parameter this option does not need to be specified.
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 6.7.0
1
+ 6.7.1
data/lib/VERSION_NOTES CHANGED
@@ -1,3 +1,7 @@
1
+ 6.7.1 - 2026.09.14
2
+ - Fix issue with running shell in single command mode.
3
+
4
+
1
5
  6.7.0 - 2026.09.13
2
6
  - Adds alternative secondary keywords for conditional verbs.
3
7
  - Adds option to save an object subtree into its own file.
data/lib/gloo/app/args.rb CHANGED
@@ -14,7 +14,7 @@ module Gloo
14
14
  QUIET = 'quiet'.freeze
15
15
  GLOO_ENV = 'GLOO_ENV'.freeze
16
16
 
17
- attr_reader :switches, :files, :app_path
17
+ attr_reader :switches, :files, :app_path, :command_tokens
18
18
 
19
19
  #
20
20
  # Create arguments and setup.
@@ -24,6 +24,7 @@ module Gloo
24
24
  @switches = []
25
25
  @files = []
26
26
  @app_path = nil
27
+ @command_tokens = []
27
28
 
28
29
  params.each { |o| process_one_arg( o ) }
29
30
  ARGV.each { |o| process_one_arg( o ) }
@@ -99,6 +100,16 @@ module Gloo
99
100
  @switches.include?( Gloo::App::Mode::TEST.to_s )
100
101
  end
101
102
 
103
+ #
104
+ # Were there CLI tokens after the app path, in App mode?
105
+ # When true, those tokens are meant for the app's own command
106
+ # handling (e.g. a [shell] object's one-shot command) - they are
107
+ # not files for gloo itself to load.
108
+ #
109
+ def single_command?
110
+ return @command_tokens.any?
111
+ end
112
+
102
113
  #
103
114
  # Detect the mode to be run in.
104
115
  # Start by seeing if a mode is specified.
@@ -141,11 +152,19 @@ module Gloo
141
152
  #
142
153
  # Process one argument or parameter.
143
154
  #
155
+ # In App mode, only the first non-switch token is the app path.
156
+ # Anything after that is a command token for the app's own
157
+ # handling, not a file for gloo to load - keeping it out of
158
+ # @files is what keeps load_files from also trying (and failing)
159
+ # to open it as a file.
160
+ #
144
161
  def process_one_arg( arg )
145
162
  if arg.start_with? '--'
146
163
  switches << arg[ 2..-1 ]
147
- elsif app? && ( @app_path.nil? )
164
+ elsif app? && @app_path.nil?
148
165
  @app_path = arg
166
+ elsif app?
167
+ command_tokens << arg
149
168
  else
150
169
  files << arg
151
170
  end
@@ -179,7 +179,7 @@ module Gloo
179
179
  # Open any files specifed in args
180
180
  load_files
181
181
 
182
- unless @mode == Mode::SCRIPT || @args.quiet?
182
+ unless @mode == Mode::SCRIPT || @args.quiet? || @args.single_command?
183
183
  self.loop
184
184
  end
185
185
 
@@ -40,7 +40,11 @@ module Gloo
40
40
  # subclasses' command methods to query (dictionary, heap, etc).
41
41
  # @param opts [Hash] :prompt, :on_error, :on_unknown_command,
42
42
  # :on_empty_command, :before_action, :after_action - all Procs
43
- # except :prompt (String) and :include_quit (Boolean).
43
+ # except :prompt (String), :include_quit (Boolean), and
44
+ # :command (Array<String>).
45
+ # @option opts :command [Array<String>] Tokens for a single
46
+ # command to run once, instead of entering the interactive
47
+ # REPL - see #single_command?.
44
48
  #
45
49
  def initialize( engine, opts = {} )
46
50
  @engine = engine
@@ -51,6 +55,7 @@ module Gloo
51
55
  @before_action = opts[ :before_action ]
52
56
  @after_action = opts[ :after_action ]
53
57
  @include_quit = opts[ :include_quit ] || false
58
+ @command = opts[ :command ]
54
59
 
55
60
  @context = Gloo::Shell::Context.new
56
61
  @root = Gloo::Shell::CommandNode.new( nil )
@@ -63,10 +68,24 @@ module Gloo
63
68
  # ---------------------------------------------------------------------
64
69
 
65
70
  #
66
- # Start the shell.
71
+ # Were command tokens supplied at construction? When true, #start
72
+ # runs that one command via #execute_once and returns instead of
73
+ # entering the REPL.
74
+ #
75
+ def single_command?
76
+ return !( @command.nil? || @command.empty? )
77
+ end
78
+
79
+ #
80
+ # Start the shell: run the single supplied command and return,
81
+ # or enter the interactive REPL if none was supplied.
67
82
  #
68
83
  def start
69
- repl
84
+ if single_command?
85
+ execute_once( @command )
86
+ else
87
+ repl
88
+ end
70
89
  end
71
90
 
72
91
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gloo
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.7.0
4
+ version: 6.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Crane
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-09-13 00:00:00.000000000 Z
11
+ date: 2026-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler