189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
# File 'lib/train/extras/command_wrapper.rb', line 189
def self.load(transport, options)
if transport.platform.unix?
return nil unless LinuxCommand.active?(options)
res = LinuxCommand.new(transport, options)
verification_res = res.verify
if verification_res
msg, reason = verification_res
raise Train::UserError.new("Sudo failed: #{msg}", reason)
end
res
elsif transport.platform.windows?
res = WindowsCommand.new(transport, options)
res
end
end
|