Class: Train::Extras::CommandWrapper
- Inherits:
-
Object
- Object
- Train::Extras::CommandWrapper
- Defined in:
- lib/train/extras/command_wrapper.rb
Class Method Summary collapse
Class Method Details
.load(transport, options) ⇒ Object
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/train/extras/command_wrapper.rb', line 164 def self.load(transport, ) if transport.os.unix? return nil unless LinuxCommand.active?() res = LinuxCommand.new(transport, ) verification_res = res.verify if verification_res msg, reason = verification_res raise Train::UserError.new("Sudo failed: #{msg}", reason) end res elsif transport.os.windows? res = WindowsCommand.new(transport, ) res end end |