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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2a2c0a0dc3fae93cfcca240627c9b95c27fd0c5
4
- data.tar.gz: a50b317403339b3e08ec82a1da7eb2514797d509
3
+ metadata.gz: 0e354e8be6b735b095f817b7e81d16b17623dca1
4
+ data.tar.gz: 4bd80fab1367ffb4906ba3f7a2ac71467f2be52b
5
5
  SHA512:
6
- metadata.gz: add66dd57d2f813499b65b4ecfa417a814cf6e56d3b565d9ebfe2a2d6838c78eefb4e71ab6a3eafc297860dbff6fd9fb166c37825f8dba771151c3a747b23aed
7
- data.tar.gz: 7eaefcc0d6e2cd7c7671762f2971ae0b4d9bff6b8bec64891b0e7835355eb543017991ee43113d24065aa8d14cf3c1aebb87f8682b8761e3dd9d797f03fd631f
6
+ metadata.gz: c79d26288cfb080164d2fcbe670cc74a38d53471208e023d66e8c0584a83b1778c40dd15f26b7970cfb34186ca6847dc7e680e4b034dec64b08695e97e82ed09
7
+ data.tar.gz: e19f6b9ffc46635a73ee9d7cd962f905cb2c300bddd31abff858fec7aa5054ae9f9a36962f05530058be2ac9b3711e1f6917f71db4da2078955eaf50dae9facc
@@ -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
- .gsub('[', '\\[')
845
- .gsub('(', '\\(')
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
@@ -1,3 +1,3 @@
1
1
  module Shells
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.16"
3
3
  end
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.15
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-08-11 00:00:00.000000000 Z
11
+ date: 2017-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh