ruby-shell 1.0 → 1.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/README.md +1 -0
- data/bin/rsh +9 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99b63b13ddf019d5fbac48dd76cbd8c53b381c46eebbf0717499e9b904015209
|
4
|
+
data.tar.gz: 40c43d51e54bdf37d7bc35d5e127e824314ec7ea89956e0015f6b8673dce016d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 035ee8876b1b89dcf4cea42e9d636a167e9909a44a629c130bbd09dda0487fcbae4d07ad5e148a48d06213486774cebc6e3e804107e842ce6a2e3544ee2b70d3
|
7
|
+
data.tar.gz: a5209bc92c252335efa4d07518cdab32b095c1e3c19dbae7dc2180f25e15997ed52f40c44f6186d03c668d7f6d65fd26630dd48548990f62831647d1794597fc
|
data/README.md
CHANGED
@@ -29,6 +29,7 @@ Or simply `gem install ruby-shell`.
|
|
29
29
|
* Set of simple rsh specific commands like nick, nick?, history and rmhistory
|
30
30
|
* rsh specific commands and full set of Ruby commands available via :<command>
|
31
31
|
* All colors are themeable in .rshrc (see github link for possibilities)
|
32
|
+
* Copy current command line to primary selection (paste w/middle button) with `Ctrl-y`
|
32
33
|
|
33
34
|
Special functions/integrations:
|
34
35
|
* Use `r` to launch rtfm (https://github.com/isene/RTFM) - if you have it installed
|
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 = "1.
|
17
|
+
@version = "1.1"
|
18
18
|
|
19
19
|
# MODULES, CLASSES AND EXTENSIONS
|
20
20
|
class String # Add coloring to strings (with escaping for Readline)
|
@@ -153,12 +153,14 @@ end
|
|
153
153
|
* Set of simple rsh specific commands like nick, nick?, history and rmhistory
|
154
154
|
* rsh specific commands and full set of Ruby commands available via :<command>
|
155
155
|
* All colors are themeable in .rshrc (see github link for possibilities)
|
156
|
-
|
156
|
+
* Copy current command line to primary selection (paste w/middle button) with `Ctrl-y`
|
157
|
+
|
157
158
|
Special functions/integrations:
|
158
159
|
* Use `r` to launch rtfm (https://github.com/isene/RTFM) - if you have it installed
|
159
160
|
* Use `f` to launch fzf (https://github.com/junegunn/fzf) - if you have it installed
|
160
161
|
* Use `=` followed by xrpn commands separated by commas (https://github.com/isene/xrpn)
|
161
162
|
* Use `:` followed by a Ruby expression to access the whole world of Ruby
|
163
|
+
|
162
164
|
Special commands:
|
163
165
|
* `:nick 'll = ls -l'` to make a command alias (ll) point to a command (ls -l)
|
164
166
|
* `:gnick 'h = /home/me'` to make a general alias (h) point to something (/home/me)
|
@@ -281,6 +283,7 @@ def getstr # A custom Readline-like function
|
|
281
283
|
@c.row(1)
|
282
284
|
@c.clear_screen_down
|
283
285
|
when 'UP' # Go up in history
|
286
|
+
#@history[0] = @history[@history[(@stk+1)..].index{|h| h =~ /#{@history[0]}/}+1] #Future magick
|
284
287
|
if @stk == 0 and @history[0].length > 0
|
285
288
|
@tabsearch = @history[0]
|
286
289
|
tabbing("hist")
|
@@ -354,6 +357,9 @@ def getstr # A custom Readline-like function
|
|
354
357
|
end
|
355
358
|
end
|
356
359
|
lift = true
|
360
|
+
when 'C-Y' # Copy command line to primary selection
|
361
|
+
system("echo -n '#{@history[0]}' | xclip")
|
362
|
+
puts "\n#{Time.now.strftime("%H:%M:%S")}: Copied to primary selection (paste with middle buttoni)".c(@c_stamp)
|
357
363
|
when 'C-K' # Kill/delete that entry in the history
|
358
364
|
@history.delete_at(@stk)
|
359
365
|
@stk -= 1
|
@@ -447,6 +453,7 @@ def tab_switch(str) # TAB completion for command switches (TAB after "-")
|
|
447
453
|
end
|
448
454
|
def tab_hist(str)
|
449
455
|
sel = @history.select {|el| el =~ /#{str}/}
|
456
|
+
sel.shift
|
450
457
|
sel.delete("")
|
451
458
|
hist = tabselect(sel, true)
|
452
459
|
if hist
|
metadata
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.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: 2023-06-
|
11
|
+
date: 2023-06-22 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
|
-
continual development. New in 1.
|
15
|
+
continual development. New in 1.1: Added; Copy current command line to primary selection
|
16
|
+
(paste w/middle button) with Ctrl-y'
|
16
17
|
email: g@isene.com
|
17
18
|
executables:
|
18
19
|
- rsh
|