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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bacb556c1f796acbe69ed5938cf62d3c89a8f07
4
- data.tar.gz: 61e3d38bfc530ddeb37bb0b57d11e7bcf842df02
3
+ metadata.gz: b5a1b9593e6f23fee8bebb1f8e7dcfb2391c0601
4
+ data.tar.gz: b9487549c2ff9b766a6e345f13d96a0fdc6a4be0
5
5
  SHA512:
6
- metadata.gz: 41dfbeed359f730a2847c0c60132252ca0333079778729e9ddf5584cf14761305c2129d6bd0d4b61254d2515f4adc31d1dc82fbce9385be8207277fd17b91a43
7
- data.tar.gz: d9e7b9c85af23432736b4e64a31cd2d87b57e1fdafa5e21ff8c434fd086bec2836da8264ff834f0d003a2f2f918399102f5eee142fd0e2a3d877f452e7bfce7c
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
- user = Specinfra.configuration.ssh_options[:user]
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
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.4.2"
2
+ VERSION = "2.4.3"
3
3
  end
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.2
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-01 00:00:00.000000000 Z
11
+ date: 2014-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh