ruby-shell 0.25 → 0.26
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 +17 -13
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 748af44619d5fa3fe9949d80a0bbe6ee20b59f930d0aeb3a509fc87e75358b4c
|
4
|
+
data.tar.gz: abf4fdf08919b9703b839b9cf482b4d7c04f29018bf86c5656f162b04406760b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87ba4d133d7e1d9db8fe8725b51ba07f23fccb91d64f8f77acc6b48e9577da746edfbc296c4776c95311ef1b11bc50223576f0579072a3c12099749b968e5568
|
7
|
+
data.tar.gz: 9390042b865bf9bc03d4ff9c569ca797e68763632dd940713d0826051600943640d563932b08946e757f99476b82f8b9157c44e3d923c6b408d63551e5e27aef
|
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.26"
|
18
18
|
|
19
19
|
# MODULES, CLASSES AND EXTENSIONS
|
20
20
|
class String # Add coloring to strings (with escaping for Readline)
|
@@ -525,6 +525,8 @@ def cmd_check(str) # Check if each element on the readline matches commands, nic
|
|
525
525
|
str.gsub(/\S+/) do |el|
|
526
526
|
if @nick.include?(el)
|
527
527
|
el.c(@c_nick)
|
528
|
+
elsif el == "r"
|
529
|
+
el.c(@c_nick)
|
528
530
|
elsif @gnick.include?(el)
|
529
531
|
el.c(@c_gnick)
|
530
532
|
elsif File.exist?(el.sub(/^~/, "/home/#{@user}"))
|
@@ -609,7 +611,7 @@ end
|
|
609
611
|
|
610
612
|
# INITIAL SETUP
|
611
613
|
begin # Load .rshrc and populate @history
|
612
|
-
|
614
|
+
trap "SIGINT" do end
|
613
615
|
firstrun unless File.exist?(Dir.home+'/.rshrc') # Initial loading - to get history
|
614
616
|
load(Dir.home+'/.rshrc')
|
615
617
|
ENV["SHELL"] = __FILE__
|
@@ -691,19 +693,21 @@ loop do
|
|
691
693
|
if @cmd == "f" # fzf integration (https://github.com/junegunn/fzf)
|
692
694
|
res = `fzf`.chomp
|
693
695
|
Dir.chdir(File.dirname(res))
|
694
|
-
|
695
|
-
if File.
|
696
|
-
|
697
|
-
|
696
|
+
elsif File.exist?(@cmd) and not File.executable?(@cmd)
|
697
|
+
if File.read(@cmd).force_encoding("UTF-8").valid_encoding?
|
698
|
+
system("#{ENV['EDITOR']} #{@cmd}") # Try open with user's editor
|
699
|
+
else
|
700
|
+
if @runmailcap
|
701
|
+
Thread.new { system("run-mailcap #{@cmd} 2>/dev/null") }
|
698
702
|
else
|
699
|
-
|
700
|
-
Thread.new { system("run-mailcap #{@cmd} 2>/dev/null") }
|
701
|
-
else
|
702
|
-
Thread.new { system("xdg-open #{@cmd} 2>/dev/null") }
|
703
|
-
end
|
703
|
+
Thread.new { system("xdg-open #{@cmd} 2>/dev/null") }
|
704
704
|
end
|
705
|
-
|
706
|
-
|
705
|
+
end
|
706
|
+
else
|
707
|
+
begin
|
708
|
+
puts "No such command or nick: #{@cmd}" unless system (@cmd) # Try execute the command
|
709
|
+
rescue StandardError => err
|
710
|
+
puts "\n#{err}"
|
707
711
|
end
|
708
712
|
end
|
709
713
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.26'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
@@ -12,8 +12,7 @@ date: 2023-06-19 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.
|
16
|
-
config save.'
|
15
|
+
0.26: Finally fixed a graceful handling of Ctrl-c.'
|
17
16
|
email: g@isene.com
|
18
17
|
executables:
|
19
18
|
- rsh
|