ruby-shell 0.10.1 → 0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/bin/rsh +16 -11
  4. metadata +2 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c7ebd4a7beebe30b2df0d2fcf14d1edc9f503730aaa1a3bf43253c83c844bec
4
- data.tar.gz: 602746338bda097043bf6bd465d39949cd1401660073b10f736bccf9d6b64aed
3
+ metadata.gz: 002e79c6d55d5d7f9aedab8fd39f1e1712a00cc5346d5971017023bb98be6a36
4
+ data.tar.gz: e55bcd60840eb1e244dfd74868a0efe28c9fa4d5eb85da778dd5642219a23647
5
5
  SHA512:
6
- metadata.gz: 50f8c28add6488b720bb28f669136c74c6f09681e4a8690293e1a9a5e7cb2ab13247d3e13c6cec090841c3f30229af9e87bfed322afec373920662b4a9477a91
7
- data.tar.gz: 89c72e7a3205a18c1d496dc1e2b058998b65b93fea587fc012b619365154d56d65d75d55b471d03b03e1f6c137431fbf760607407761897d22bfaca565f03faf
6
+ metadata.gz: d14305387565d0c2ec54843d4a3f256563e7079567c6f75b51a3357494582439f49648b43a0c60a7b509b5f01a52bcee23e293dbbbf47d82fbb8d58325173f58
7
+ data.tar.gz: e5647e1c8b7218a50e76fab9cf1170ed5c5df863ad6530f66a571f083a881deaf3a94bad242d0543585f4c65bd38f7496466764c525d3ec8adfac25552997741
data/README.md CHANGED
@@ -37,6 +37,7 @@ Special commands:
37
37
  * `:gnick 'h = /home/me'` to make a general alias (h) point to something (/home/me)
38
38
  * `:nick?` will list all command nicks and general nicks (you can edit your nicks in .rshrc)
39
39
  * `:history` will list the command history, while `:rmhistory` will delete the history
40
+ * `:help` will display this help text
40
41
 
41
42
  ## Nicks
42
43
  Add command nicks (aliases) with `:nick "some_nick = some_command"`, e.g. `:nick "ls = ls --color"`. Add general nicks that will substitute anything on a command line (not just commands) like this `:gnick "some_gnick = some_command"`, e.g. `:gnick "x = /home/user/somewhere"`. List (g)nicks with `:nick?`. Remove a nick with `:nick "-some_command"`, e.g. `:nick "-ls"` to remove an `ls` nick. Same for gnicks.
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.10"
17
+ @version = "0.11"
18
18
 
19
19
  # MODULES, CLASSES AND EXTENSIONS
20
20
  class String # Add coloring to strings (with escaping for Readline)
@@ -129,9 +129,9 @@ begin # Initialization
129
129
  @cmd = "" # Initiate variable @cmd
130
130
  end
131
131
 
132
- # GENERIC FUNCTIONS
133
- def firstrun
134
- @firstrun = <<~FIRSTRUN
132
+ # HELP TEXT
133
+ @help = <<~HELP
134
+
135
135
  Hello #{@user}, welcome to rsh - the Ruby SHell.
136
136
 
137
137
  rsh does not attempt to compete with the grand old shells like bash and zsh.
@@ -160,16 +160,19 @@ def firstrun
160
160
  * `:gnick 'h = /home/me'` to make a general alias (h) point to something (/home/me)
161
161
  * `:nick?` will list all command nicks and general nicks (you can edit your nicks in .rshrc)
162
162
  * `:history` will list the command history, while `:rmhistory` will delete the history
163
+ * `:help` will display this help text
163
164
 
164
- Since there is no rsh configuration file (.rshrc), I will help you set it up to suit your needs.
165
- FIRSTRUN
165
+ HELP
166
166
 
167
- puts @firstrun
168
- puts "The prompt you see now is the very basic rsh prompt: "
167
+ # GENERIC FUNCTIONS
168
+ def firstrun
169
+ puts @help
170
+ puts "Since there is no rsh configuration file (.rshrc), I will help you set it up to suit your needs.\n\n"
171
+ puts "The prompt you see now is the very basic rsh prompt:"
169
172
  print "#{@prompt} (press ENTER)"
170
173
  STDIN.gets
171
- puts "I will now change the prompt into something more useful."
172
- puts "Feel free to amend the prompt in your .rshrc."
174
+ puts "\nI will now change the prompt into something more useful."
175
+ puts "Feel free to amend the prompt in your .rshrc.\n\n"
173
176
  rc = <<~RSHRC
174
177
  # PROMPT
175
178
  # The numbers in parenthesis are 256 color codes (the '.c()' is a String extention
@@ -190,7 +193,6 @@ FIRSTRUN
190
193
  @nick = {"ls"=>"ls --color -F"}
191
194
  RSHRC
192
195
  File.write(Dir.home+'/.rshrc', rc)
193
-
194
196
  end
195
197
  def getchr # Process key presses
196
198
  c = STDIN.getch
@@ -509,6 +511,9 @@ def rshrc # Write updates to .rshrc
509
511
  end
510
512
 
511
513
  # RSH FUNCTIONS
514
+ def help
515
+ puts @help
516
+ end
512
517
  def history # Show history
513
518
  puts "History:"
514
519
  puts @history
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.10.1
4
+ version: '0.11'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
@@ -12,8 +12,7 @@ date: 2023-06-04 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.10: Added introduction and creation of .rshrc on first run. Improved rtfm integration.
16
- 0.10.1: Fixed depricated Dir.exists?'
15
+ 0.11: Added command :help to display the help text'
17
16
  email: g@isene.com
18
17
  executables:
19
18
  - rsh