shells 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shells/bash_common.rb +3 -3
- data/lib/shells/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea9f3b33a7f702b90a070a65ed2733dfff093b3e
|
4
|
+
data.tar.gz: 17c72a0e4d99b53d509aa5f0065768f552a89b0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f177e564d9b6af1ec3eb911faf4ae66895302aeaef5a8c42774cd8c878b920b9b30d5a468c23adddae2e3767b2e67c0c25ecb68e2732a3fc2ad4e7b097e997da
|
7
|
+
data.tar.gz: 19e5ea9eaedf5f8e86bc4e882e011c37e9aaddaa26cefdf0c83e8a6559ab0fa353f166f0edee8856b0fbc15ffc8b30f80ec272b411bb70c74cd2330506f8280f
|
data/lib/shells/bash_common.rb
CHANGED
@@ -39,8 +39,8 @@ module Shells
|
|
39
39
|
# Executes an elevated command using the 'sudo' command.
|
40
40
|
def sudo_exec(command, options = {}, &block)
|
41
41
|
sudo_prompt = '[sp:'
|
42
|
-
sudo_match =
|
43
|
-
sudo_strip = /\[sp:[^\n]*\n/
|
42
|
+
sudo_match = /\n\[sp:$/m
|
43
|
+
sudo_strip = /\[sp:[^\n]*\n/m
|
44
44
|
ret = exec("sudo -p \"#{sudo_prompt}\" bash -c \"#{command.gsub('"', '\\"')}\"", options) do |data,type|
|
45
45
|
test_data = data.to_s
|
46
46
|
desired_length = sudo_prompt.length + 1 # prefix a NL before the prompt.
|
@@ -51,7 +51,7 @@ module Shells
|
|
51
51
|
end
|
52
52
|
|
53
53
|
if test_data =~ sudo_match
|
54
|
-
options[:password]
|
54
|
+
self.options[:password]
|
55
55
|
else
|
56
56
|
if block
|
57
57
|
block.call(data, type)
|
data/lib/shells/version.rb
CHANGED