shells 0.1.15 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shells/shell_base.rb +13 -9
- data/lib/shells/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e354e8be6b735b095f817b7e81d16b17623dca1
|
4
|
+
data.tar.gz: 4bd80fab1367ffb4906ba3f7a2ac71467f2be52b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c79d26288cfb080164d2fcbe670cc74a38d53471208e023d66e8c0584a83b1778c40dd15f26b7970cfb34186ca6847dc7e680e4b034dec64b08695e97e82ed09
|
7
|
+
data.tar.gz: e19f6b9ffc46635a73ee9d7cd962f905cb2c300bddd31abff858fec7aa5054ae9f9a36962f05530058be2ac9b3711e1f6917f71db4da2078955eaf50dae9facc
|
data/lib/shells/shell_base.rb
CHANGED
@@ -839,16 +839,20 @@ module Shells
|
|
839
839
|
@stdcomb_hist ||= []
|
840
840
|
end
|
841
841
|
|
842
|
+
def regex_escape(text)
|
843
|
+
text
|
844
|
+
.gsub('[', '\\[')
|
845
|
+
.gsub('(', '\\(')
|
846
|
+
.gsub('.', '\\.')
|
847
|
+
.gsub('*', '\\*')
|
848
|
+
.gsub('{', '\\{')
|
849
|
+
.gsub('?', '\\?')
|
850
|
+
end
|
851
|
+
|
842
852
|
def command_match(command)
|
843
|
-
p = @options[:prompt]
|
844
|
-
|
845
|
-
|
846
|
-
.gsub('.', '\\.')
|
847
|
-
.gsub('*', '\\*')
|
848
|
-
.gsub('{', '\\{')
|
849
|
-
.gsub('?', '\\?')
|
850
|
-
|
851
|
-
/\A(?:#{p}\s*)?#{command}\z/
|
853
|
+
p = regex_escape @options[:prompt]
|
854
|
+
c = regex_escape command
|
855
|
+
/\A(?:#{p}\s*)?#{c}[ \t\r]*\n?/m
|
852
856
|
end
|
853
857
|
|
854
858
|
def prompt_match
|
data/lib/shells/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shells
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Beau Barker
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|