ruby-shell 0.20 → 0.21
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/README.md +1 -0
- data/bin/rsh +26 -16
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8d28ba94f7b6a6e05496bccb94efe444ba34871ab036b448fb0d074dcadf59d
|
4
|
+
data.tar.gz: 041e37fe2d4876a59b097d74eddd846be9de62915ee857943c4c86b2e4080a50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a681b059f27359fa185cc6f1092ac3bf2b8e9084a79ee5650f154b906b25ec84a20eb4920961576a945787cb6d925c6f16cab915383ea9b07ba3a2ed58bc634d
|
7
|
+
data.tar.gz: 04bde7676375ce81782b2ba15abda281a650de049d79734eb23b0db4b67987f089db1b2fd4bf3be52bc5dc6730f900d95acc2ade046fe70097272cf09730673e
|
data/README.md
CHANGED
@@ -23,6 +23,7 @@ Or simply `gem install ruby-shell`.
|
|
23
23
|
* Tab completions for nicks, system commands, command switches and dirs/files
|
24
24
|
* Tab completion presents matches in a list to pick from
|
25
25
|
* When you start to write a command, rsh will suggest the first match in the history and present that in "toned down" letters - press the arrow right key to accept the suggestion.
|
26
|
+
* Writing a partial command and pressing `UP` will search history for matches. Go down/up in the list and press `TAB` or `ENTER` to accept or `Ctrl-G` to discard
|
26
27
|
* History with editing, search and repeat a history command (with `!`)
|
27
28
|
* Config file (.rshrc) updates on exit (with Ctrl-d) or not (with Ctrl-c)
|
28
29
|
* Set of simple rsh specific commands like nick, nick?, history and rmhistory
|
data/bin/rsh
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
# for any damages resulting from its use. Further, I am under no
|
15
15
|
# obligation to maintain or extend this software. It is provided
|
16
16
|
# on an 'as is' basis without any expressed or implied warranty.
|
17
|
-
@version = "0.
|
17
|
+
@version = "0.21"
|
18
18
|
|
19
19
|
# MODULES, CLASSES AND EXTENSIONS
|
20
20
|
class String # Add coloring to strings (with escaping for Readline)
|
@@ -145,8 +145,10 @@ end
|
|
145
145
|
* Tab completions for nicks, system commands, command switches and dirs/files
|
146
146
|
* Tab completion presents matches in a list to pick from
|
147
147
|
* When you start to write a command, rsh will suggest the first match in the history and
|
148
|
-
present that in "toned down" letters - press the arrow right key to accept the suggestion
|
149
|
-
*
|
148
|
+
present that in "toned down" letters - press the arrow right key to accept the suggestion
|
149
|
+
* Writing a partial command and pressing `UP` will search history for matches.
|
150
|
+
Go down/up in the list and press `TAB` or `ENTER` to accept or `Ctrl-G` to discard
|
151
|
+
* History with editing, search and repeat a history command (with `!`)
|
150
152
|
* Config file (.rshrc) updates on exit (with Ctrl-d) or not (with Ctrl-c)
|
151
153
|
* Set of simple rsh specific commands like nick, nick?, history and rmhistory
|
152
154
|
* rsh specific commands and full set of Ruby commands available via :<command>
|
@@ -278,17 +280,22 @@ def getstr # A custom Readline-like function
|
|
278
280
|
@c.row(1)
|
279
281
|
@c.clear_screen_down
|
280
282
|
when 'UP' # Go up in history
|
281
|
-
if
|
282
|
-
@history
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
283
|
+
if @stk == 0 and @history[0].length > 0
|
284
|
+
@tabsearch = @history[0]
|
285
|
+
tabbing("hist")
|
286
|
+
else
|
287
|
+
if lift
|
288
|
+
@history.unshift("")
|
289
|
+
@history[0] = @history[@stk].dup
|
290
|
+
@stk += 1
|
291
|
+
end
|
292
|
+
unless @stk >= @history.length - 1
|
293
|
+
@stk += 1
|
294
|
+
@history[0] = @history[@stk].dup
|
295
|
+
@pos = @history[0].length
|
296
|
+
end
|
297
|
+
lift = false
|
290
298
|
end
|
291
|
-
lift = false
|
292
299
|
when 'DOWN' # Go down in history
|
293
300
|
if lift
|
294
301
|
@history.unshift("")
|
@@ -434,8 +441,11 @@ def tab_hist(str)
|
|
434
441
|
sel = @history.select {|el| el =~ /#{str}/}
|
435
442
|
sel.delete("")
|
436
443
|
hist = tabselect(sel, true)
|
437
|
-
|
438
|
-
|
444
|
+
if hist
|
445
|
+
@tabsearch = hist
|
446
|
+
@tabstr = ""
|
447
|
+
@pos = @tabsearch.length
|
448
|
+
end
|
439
449
|
end
|
440
450
|
def tabselect(ary, hist=false) # Let user select from the incoming array
|
441
451
|
ary.uniq!
|
@@ -690,7 +700,7 @@ loop do
|
|
690
700
|
end
|
691
701
|
end
|
692
702
|
elsif system(@cmd) # Try execute the command
|
693
|
-
else puts "No such command: #{@cmd}"
|
703
|
+
else puts "No such command or nick: #{@cmd}"
|
694
704
|
end
|
695
705
|
end
|
696
706
|
end
|
metadata
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.21'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'A shell written in Ruby with extensive tab completions, aliases/nicks,
|
14
14
|
history, syntax highlighting, theming and more. In continual development. New in
|
15
|
-
0.20:
|
15
|
+
0.20: Better history search - write a partial command and press UP to get matches
|
16
|
+
in history.'
|
16
17
|
email: g@isene.com
|
17
18
|
executables:
|
18
19
|
- rsh
|