[Ruby] Launching script/runner from within Rails

ben wiseley wiseleyb at gmail.com
Thu Feb 8 16:21:01 PST 2007


um, because i still suck at ruby and really suck at regx?  :)

thanks for the tip!


On 2/8/07, Ryan Davis <ryand-ruby at zenspider.com> wrote:
>
>
> 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
>
> ??
>
> _______________________________________________
> Ruby at zenspider.com - Seattle.rb non-commercial list
> http://www.zenspider.com/seattle.rb
> http://www.zenspider.com/mailman/listinfo/ruby
>


More information about the Ruby mailing list