ruby-shell 0.20 → 0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/bin/rsh +27 -17
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c77b8d55aafec665e7fa06f41c9ebd8b865a843dabb1fbb75e332402ea6fb69b
|
4
|
+
data.tar.gz: 6ca4ad8d4f853f2a36c0da2d7717c099aa333089a4372a085de534d7b417171f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b9cdf2c66e91aa4eba9b74f39eb105c4c5640ee8ad2aa49b970f653e49f5356bd4a756276ab4747bc3a0b7dd6b011289fa99f3715925d3975fbd747499f2fd6
|
7
|
+
data.tar.gz: b98f3d5a2b7bac68120cefc2186cdc92e95c26803216b7ffc4ea8dcfa41a107c54058e9a5f625afd2deed29fc1dcca3fce95cac08bbc29309f0fba49ebfe6c38
|
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.22"
|
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!
|
@@ -603,7 +613,7 @@ begin # Load .rshrc and populate @history
|
|
603
613
|
ENV["TERM"] = "rxvt-unicode-256color"
|
604
614
|
ENV["PATH"] ? ENV["PATH"] += ":" : ENV["PATH"] = ""
|
605
615
|
ENV["PATH"] += "/home/#{@user}/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
606
|
-
if File.exist?(@lscolors)
|
616
|
+
if @lscolors and File.exist?(@lscolors)
|
607
617
|
ls = File.read(@lscolors)
|
608
618
|
ls.sub!(/export.*/, '')
|
609
619
|
ls.sub!(/^LS_COLORS=/, 'ENV["LS_COLORS"]=')
|
@@ -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,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.22'
|
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-18 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.
|
15
|
+
0.21: Fixed bug in loading lscolors.'
|
16
16
|
email: g@isene.com
|
17
17
|
executables:
|
18
18
|
- rsh
|