specinfra 2.4.2 → 2.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/specinfra/backend/ssh.rb +8 -3
- data/lib/specinfra/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: b5a1b9593e6f23fee8bebb1f8e7dcfb2391c0601
|
4
|
+
data.tar.gz: b9487549c2ff9b766a6e345f13d96a0fdc6a4be0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee185a53cc56616a8465bcf89e64ec01db1f31cd12e1962cd6e34c1c53cdc5467d7cda3aa06efe9112d96b0f7a14cfd1a3f80c6d19b8f6eda37dd2bc1ad6963b
|
7
|
+
data.tar.gz: bd139216ad6a2be63dc952eac9a16530b36003780e478128e3a1c077fd6521cc3901a264de313261e430e3107ad3ff00098cc91d2753ce44454a6484228bd6a8
|
@@ -13,6 +13,7 @@ module Specinfra::Backend
|
|
13
13
|
end
|
14
14
|
|
15
15
|
ret[:stdout].gsub!(/\r\n/, "\n")
|
16
|
+
ret[:stdout].gsub!(/\A\n/, "") if sudo?
|
16
17
|
|
17
18
|
if @example
|
18
19
|
@example.metadata[:command] = cmd
|
@@ -35,9 +36,7 @@ module Specinfra::Backend
|
|
35
36
|
|
36
37
|
def build_command(cmd)
|
37
38
|
cmd = super(cmd)
|
38
|
-
|
39
|
-
disable_sudo = Specinfra.configuration.disable_sudo
|
40
|
-
if user != 'root' && !disable_sudo
|
39
|
+
if sudo?
|
41
40
|
cmd = "#{sudo} -p '#{prompt}' #{cmd}"
|
42
41
|
end
|
43
42
|
cmd
|
@@ -156,5 +155,11 @@ module Specinfra::Backend
|
|
156
155
|
|
157
156
|
"#{sudo_path.shellescape}#{sudo_options}"
|
158
157
|
end
|
158
|
+
|
159
|
+
def sudo?
|
160
|
+
user = Specinfra.configuration.ssh_options[:user]
|
161
|
+
disable_sudo = Specinfra.configuration.disable_sudo
|
162
|
+
user != 'root' && !disable_sudo
|
163
|
+
end
|
159
164
|
end
|
160
165
|
end
|
data/lib/specinfra/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specinfra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|