[Ruby] Launching script/runner from within Rails

Ryan Davis ryand-ruby at zenspider.com
Thu Feb 8 16:11:13 PST 2007


On Feb 8, 2007, at 11:58 AM, ben wiseley wrote:

>     file_formats = ["JPEG","PNG","GIF","TIFF","PC bitmap"]
>     res = `file #{filename}`
>     file_formats.each do |ff|
>       if res.include?(ff)
>         return
>       end
>     end

Why not:

return if `file #{filename}` =~ /jpeg|png|gif|tiff|pc bitmap/i

??



More information about the Ruby mailing list