Method: TechnoGate::Contao::System.safe_system

Defined in:
lib/contao/system.rb

.safe_system(cmd, *args) ⇒ Object

Kernel.system but with exceptions



18
19
20
21
22
23
# File 'lib/contao/system.rb', line 18

def self.safe_system cmd, *args
  unless self.system cmd, *args
    args = args.map{ |arg| arg.to_s.gsub " ", "\\ " } * " "
    raise ErrorDuringExecution, "Failure while executing: #{cmd} #{args}"
  end
end