ruby-shell 3.6.17 → 3.6.18

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rsh +9 -5
  3. metadata +2 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47a8896d9151658c431c1f2302f18b0d143887c9fe67d410a64d9c18bd143347
4
- data.tar.gz: 230a1b7784618c69c860d169e36be458a09509d66052cd3350e1bb6e16620908
3
+ metadata.gz: 2e9ecc77e9137be0869ab5108ca168b9af1fe7482f7c48db56d222381f3e0c2b
4
+ data.tar.gz: ffb83039ed726fdc1484e9c4d283525205dc39cd8a346c981005da8f14c3e5ac
5
5
  SHA512:
6
- metadata.gz: 1c841a0dc5675dbd5bf1bb9341b0f9edeead426cec47357a2e1655dc1d67465732822a596d71468a5972f511c2a6f0f2f983ee19ed24317567de6b05affef665
7
- data.tar.gz: 61c8fb056e30ad6eba62bca87be4d4d60da8817fb69acee4924d672fa32dcd8f050250a7accae2af6bb288de43907b06c95b38956980af53cdf205c437952f28
6
+ metadata.gz: a5bd6cc37c73511c6267b246c86048f55a48bb6054d9e2242b958f5d6a164a81d04c090b6c0ff053afa84e4ac64fcac2b4e36cae11926f45f7553af1461a27ee
7
+ data.tar.gz: abe9d8a5fcb1738492c99301c2f2171b4abb5450a4c24f79294b2eebe98a12e7962557e13d0bd79f068423d970223ea4af94358f6f7d40a577af81315efee2e3
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 = "3.6.17" # Optimize core input loop
11
+ @version = "3.6.18" # Fix nick deletion and hyphenated command handling
12
12
 
13
13
  # MODULES, CLASSES AND EXTENSIONS
14
14
  class String # Add coloring to strings (with escaping for Readline)
@@ -1522,7 +1522,10 @@ def rshrc # Write user configuration to .rshrc (portable between machines)
1522
1522
  if conf =~ /@nick\s*=\s*(\{.*?\})/m
1523
1523
  begin
1524
1524
  file_nicks = eval($1)
1525
- @nick = file_nicks.merge(@nick) if file_nicks.is_a?(Hash)
1525
+ if file_nicks.is_a?(Hash)
1526
+ file_nicks.reject! { |k, _| @deleted_nicks&.include?(k) }
1527
+ @nick = file_nicks.merge(@nick)
1528
+ end
1526
1529
  rescue SyntaxError, StandardError
1527
1530
  # If eval fails, keep current @nick
1528
1531
  end
@@ -1819,8 +1822,9 @@ def nick(nick_str = nil) # Define a new nick like this: `:nick "ls = ls --color
1819
1822
  puts "Imported #{imported.length} nicks"
1820
1823
  rshrc
1821
1824
  elsif nick_str.match(/^\s*-/)
1822
- source = nick_str.sub(/^\s*-/, '')
1825
+ source = nick_str.sub(/^\s*-/, '').strip
1823
1826
  if @nick.delete(source)
1827
+ (@deleted_nicks ||= []) << source
1824
1828
  puts "Nick '#{source}' deleted"
1825
1829
  rshrc
1826
1830
  else
@@ -3814,9 +3818,9 @@ loop do
3814
3818
  used_param_nick = first_cmd && @nick[first_cmd] && @nick[first_cmd].include?('{{')
3815
3819
 
3816
3820
  # Do nick/gnick substitution
3817
- ca = @nick.transform_keys {|k| /((^\K\s*\K)|(\|\K\s*\K))\b(?<!-)#{Regexp.escape k}\b/}
3821
+ ca = @nick.transform_keys {|k| /((^\K\s*\K)|(\|\K\s*\K))\b(?<!-)#{Regexp.escape k}\b(?!-)/}
3818
3822
  @cmd = @cmd.gsub(Regexp.union(ca.keys), @nick)
3819
- ga = @gnick.transform_keys {|k| /\b(?<!-)#{Regexp.escape k}\b/}
3823
+ ga = @gnick.transform_keys {|k| /\b(?<!-)#{Regexp.escape k}\b(?!-)/}
3820
3824
  @cmd = @cmd.gsub(Regexp.union(ga.keys), @gnick)
3821
3825
 
3822
3826
  # Expand placeholders if parametrized nick was used
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: 3.6.17
4
+ version: 3.6.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
@@ -12,8 +12,7 @@ date: 2026-03-23 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
15
- v3.6.17: Optimize core input loop with cached syntax highlighting and math-based
16
- scroll detection.'
15
+ v3.6.18: Fix nick deletion persistence and hyphenated command substitution.'
17
16
  email: g@isene.com
18
17
  executables:
19
18
  - rsh