gloo-cli 1.6 → 1.8

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/menu.rb +11 -5
  3. data/lib/shell_runner.rb +5 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7954b2c20f1f5a6cfeba8603a9578e92c439f2890420966a61f502a0af4be0fa
4
- data.tar.gz: e97bb3a1cc62b6934a1e24c65004ee015723cde0db1b9693f5958a85b7b5b6b9
3
+ metadata.gz: c20054e5d495fde4abf0d067fd09015b02af2de350075834b2f58914f54be0d1
4
+ data.tar.gz: e363c1996f92d4718b75ed1176ea640a4484efb08cc91737337f8fdd80e65ec0
5
5
  SHA512:
6
- metadata.gz: 9f4ff97d30afe5771e50e485f5a00eb75a07675e746a28bd4c6cc6ae76ffe51aa1f1c4cbefd858d9705c7ac68870c651ca23278f5dffcf451743d8832cdb7856
7
- data.tar.gz: fc892775cffe97cc74b7f0f4a8f8187c12afbd9dff580d141f6d5dba396737fd8c6c50c41c5594ff6fdd3d8d1e328e8c4563d0ddd97d990c8f80120dd84c33d3
6
+ metadata.gz: 90750e252eb055d6378177d2b22cdaac0eb57c1171128f341c37f40b603f7e5231a11cbe4463b9bf145d8a2fecc37a929ef7dcad788cfeee06772ee089e4ab47
7
+ data.tar.gz: 0d0ddc595fdd62f09ce591e7167df8542ee22eb3dbb97990ed5c3e556c99f52d360f935ae96489744feb906d02f1ba5e51ce32c44cc9d613c8f1722590edd1a9
data/lib/menu.rb CHANGED
@@ -231,7 +231,8 @@ class Menu < Gloo::Core::Obj
231
231
  dt = DateTime.now
232
232
  d = dt.strftime( '%Y.%m.%d' )
233
233
  t = dt.strftime( '%I:%M:%S' )
234
- cmd = @engine.platform.prompt.ask( "#{d.yellow} #{t.white} >" )
234
+ theme = @engine.theme
235
+ cmd = @engine.platform.prompt.ask( "#{theme.accent( d )} #{theme.emphasis( t )} >" )
235
236
  else
236
237
  cmd = @engine.platform.prompt.ask( prompt_value )
237
238
  end
@@ -311,15 +312,20 @@ class Menu < Gloo::Core::Obj
311
312
  end
312
313
  end
313
314
 
314
- #
315
+ #
315
316
  # There is a title, so show it.
316
- #
317
+ #
318
+ # Deliberately left uncolored, same reasoning as
319
+ # Gloo::App::Table#show: box-drawing borders and text read fine
320
+ # against the terminal's own default colors, and forcing a fixed
321
+ # foreground/background fights whatever theme the terminal is
322
+ # actually running.
323
+ #
317
324
  def run_default_title
318
325
  @engine.platform&.clear_screen
319
326
  show_menu_stack
320
327
 
321
- title_text = @engine.platform.table.box( title )
322
- puts title_text.colorize( :color => :white, :background => :black )
328
+ puts @engine.platform.table.box( title )
323
329
  end
324
330
 
325
331
  #
data/lib/shell_runner.rb CHANGED
@@ -238,6 +238,11 @@ class ShellRunner
238
238
 
239
239
  result = traverse( @root, tokens[0..-2] )
240
240
  current = result[:node]
241
+
242
+ # An unrecognized command prefix means there's nothing to complete —
243
+ # fall back to no matches instead of crashing on a nil node.
244
+ next [] unless current
245
+
241
246
  options = current.children( @context ).map( &:name )
242
247
 
243
248
  matches = options.grep(/^#{Regexp.escape(input)}/)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gloo-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.6'
4
+ version: '1.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Crane