ruby-shell 2.1 → 2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rsh +5 -7
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a665db64b41e710d9518377b67c43fa024c06267b532e5fe055060d6ab72b02
4
- data.tar.gz: c9a28e30899b31d7905a8a16efd38bcadc33297cf77f43b08a2eafcfb00aaa64
3
+ metadata.gz: 430ac5700dcc8216283045a1d608e0c53982018c39797921b39eb262e8df22bb
4
+ data.tar.gz: 8af1ec08df62ec8c79f1f1177ee8629fd388dbf15975a827296ec99894b77fdd
5
5
  SHA512:
6
- metadata.gz: 39a7cc409d442888446e1329d121028e99ef6c71aa09be23dba13d3a5680590896d9d4cacbe7b93e678db4e5b96bbee40cbd37edab21d75e7c6c3694816eb1cd
7
- data.tar.gz: 0e93cc5d3d37c282a6ed4f50e149d94052299dabe9c7bcea7a8d44e90995ac77f3a2cd60c30360273d274e6b50e012c147c06d2773a382ed87cbc3ab605a1216
6
+ metadata.gz: 1182b247e8c1128e748d2c24a3f1066e10be2c0e561b50ed02df1b39cbef77450035fa383f9fdb4da50552de56b867201acb9f6e3e8797034da1c9a437dd96e2
7
+ data.tar.gz: 9b461d925debaed83878c368635c4b6a3b1a1543984896501ef43d5441d4c3b67667ffe4aae2cc0958ea8c82c226e7c46834352de90b3be56c98dcb0b17ed549
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.1"
11
+ @version = "2.3"
12
12
 
13
13
  # MODULES, CLASSES AND EXTENSIONS
14
14
  class String # Add coloring to strings (with escaping for Readline)
@@ -120,9 +120,7 @@ begin # Initialization
120
120
  @history = [] # Initiate history array
121
121
  # Paths
122
122
  @user = Etc.getpwuid(Process.euid).name # For use in @prompt
123
- @path = ["/bin",
124
- "/usr/bin",
125
- "/home/#{@user}/bin"] # Basic paths for executables if not set in .rshrc
123
+ @path = ENV["PATH"].split(":") # Get paths
126
124
  # History
127
125
  @histsize = 200 # Max history if not set in .rshrc
128
126
  @hloaded = false # Variable to determine if history is loaded
@@ -253,7 +251,7 @@ def getchr # Process key presses
253
251
  when /[[:print:]]/ then chr = c
254
252
  else chr = ""
255
253
  end
256
- stdin_clear
254
+ #stdin_clear
257
255
  return chr
258
256
  end
259
257
  def getstr # A custom Readline-like function
@@ -410,7 +408,6 @@ def getstr # A custom Readline-like function
410
408
  @c.col(@pos0 + @history[0].length)
411
409
  @c.clear_screen_down
412
410
  end
413
-
414
411
  def tab(type)
415
412
  i = 0
416
413
  chr = ""
@@ -419,7 +416,8 @@ def tab(type)
419
416
  @postab = @history[0][@pos..].to_s # Extract the current line from cursor to end
420
417
  @c_row, @c_col = @c.pos # Get cursor position
421
418
  @tabstr = @pretab.split(/[|, ]/).last.to_s # Get the sustring that is being tab completed
422
- @tabstr = "" if @pretab[-1] =~ /[ |]/
419
+ @tabstr = "" if @pretab[-1] =~ /[ |]/ # Tab from nothing if tabbing starts with space or pipe
420
+ @tabstr = @pretab if type == "hist" # Searching for matches with whole string in history
423
421
  @pretab = @pretab.delete_suffix(@tabstr)
424
422
  type = "switch" if @tabstr[0] == "-"
425
423
  while chr != "ENTER"
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-shell
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.1'
4
+ version: '2.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-23 00:00:00.000000000 Z
11
+ date: 2024-10-24 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. In
15
15
  continual development. New in 2.0: Full rewrite of tab completion engine. Lots of
16
- other bug fixes. 2.1: Better error handling.'
16
+ other bug fixes. 2.3: Better history search.'
17
17
  email: g@isene.com
18
18
  executables:
19
19
  - rsh