ruby-shell 2.9.0 → 2.9.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 +4 -4
- data/bin/rsh +9 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ceae5891b4b0deebdf2e2876232999e8c64374f4730ab4d5e8ef09ff2dc3835
|
4
|
+
data.tar.gz: bee38e735fb5f9eb1b4b133471ea649faec9531c7138ef035c6c9a089db87f06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e586a0d583b1d3c33f441ce1dcabf001dc1a12d3a375581ad2337db8cab2822850455cf599b5a5e7ba21a31d750f2133c10b0a71c3e9bdc6ff62454c98296ee
|
7
|
+
data.tar.gz: 8b7ae87743f8fe9f0414dda5ae607f632ece3f8289131519d21d8ebc20d54d13d7d7361364b8eeef7d9c68d6af9006731790decbee4eb0862a159997af0f306c
|
data/bin/rsh
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
# Web_site: http://isene.com/
|
9
9
|
# Github: https://github.com/isene/rsh
|
10
10
|
# License: Public domain
|
11
|
-
@version = "2.9.
|
11
|
+
@version = "2.9.1" # Bug fix: Improved command coloring for local executables and after ENTER
|
12
12
|
|
13
13
|
# MODULES, CLASSES AND EXTENSIONS
|
14
14
|
class String # Add coloring to strings (with escaping for Readline)
|
@@ -555,20 +555,24 @@ def hist_clean # Clean up @history
|
|
555
555
|
end
|
556
556
|
def cmd_check(str) # Check if each element on the readline matches commands, nicks, paths; color them
|
557
557
|
return if str.nil?
|
558
|
-
|
558
|
+
|
559
559
|
# Special handling for @ and @@ commands
|
560
560
|
if str =~ /^(@@?)\s+(.*)$/
|
561
561
|
prefix = $1
|
562
562
|
rest = $2
|
563
563
|
return prefix.c(4) + " " + rest # Color @ or @@ in blue (4), rest uncolored
|
564
564
|
end
|
565
|
-
|
565
|
+
|
566
566
|
str.gsub(/(?:\S'[^']*'|[^ '])+/) do |el|
|
567
|
+
clean_el = el.gsub("'", "")
|
567
568
|
if @exe.include?(el)
|
568
569
|
el.c(@c_cmd)
|
569
570
|
elsif el == "cd"
|
570
571
|
el.c(@c_cmd)
|
571
|
-
elsif File.exist?(
|
572
|
+
elsif clean_el =~ /^\.\/(.+)/ && File.exist?(clean_el) && File.executable?(clean_el)
|
573
|
+
# Color local executables starting with ./
|
574
|
+
el.c(@c_cmd)
|
575
|
+
elsif File.exist?(clean_el)
|
572
576
|
el.c(@c_path)
|
573
577
|
elsif @nick.include?(el)
|
574
578
|
el.c(@c_nick)
|
@@ -1178,7 +1182,7 @@ loop do
|
|
1178
1182
|
# Move cursor to end of line and print the full command before clearing
|
1179
1183
|
@c.row(@row0)
|
1180
1184
|
@c.clear_line
|
1181
|
-
print @prompt + @cmd
|
1185
|
+
print @prompt + cmd_check(@cmd)
|
1182
1186
|
print "\n"; @c.clear_screen_down
|
1183
1187
|
if @cmd == "r" # Integration with rtfm (https://github.com/isene/RTFM)
|
1184
1188
|
t = Time.now
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.9.
|
4
|
+
version: 2.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-09-13 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, auto-cd, auto-opening files and more. UPDATE
|