From: matt_neuburg@... (Matt Neuburg) Date: 2009-08-11T09:15:23+09:00 Subject: Re: Calling another Ruby script Peter Bailey wrote: > Hi, > Can someone please tell me how you can can call out another Ruby script? > I have a lot of image processing scripts. Sometimes, rarely, they'll > simply fail because some of the images might be bad. But, I need to know > whether or not the images got processed or not. So, because an image > failure can literally lead to the whole Ruby script just failing, I'd > like to create a separate script that simply lists all of the files in > the input directory (separately from the processing script) and checks > to see if they all got processed or not. In DOS, I would use a "call" > statement. What's the equivalent in Ruby? > Thanks, > Peter Just load the other script in the usual way and call something in it. Example: script1.rb: def doStuff(x) end script2.rb: require 'script1' list_of_files = # whatever list_of_files.each do |a_file| begin doStuff(a_file) rescue puts "#{a_file} didn't process correctly" end end m. ???? m.