Hi,
very often I use this method:
def launch(cmd)
raise “Error launching #{cmd}” unless system(cmd)
end
Is there a built-in equivalent ?
cheers,
– Thibaut
Hi,
very often I use this method:
def launch(cmd)
raise “Error launching #{cmd}” unless system(cmd)
end
Is there a built-in equivalent ?
cheers,
– Thibaut
begin
system(cmd)
rescue NameError => e
puts e
end… Does that help you ?
hum – not sure actually. Is system() supposed to raise a NameError ?
I didn’t see this mentioned in the docs.
I searched further yet could not find anything like launch() so far.
– Thibaut
Thibaut Barrère wrote:
begin
� system(cmd)
rescue NameError => e
� puts e
end… Does that help you ?
hum – not sure actually. Is system() supposed to raise a NameError ?
I didn’t see this mentioned in the docs.
Easy enough to test:
begin
result = system(“made up command”)
puts result
rescue NameError => e
puts e
end
–output:–
false
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs