On Oct 8, 12:09 pm, Simon Krahnke <overl... / gmx.li> wrote:
> * 7stud -- <dol... / excite.com> (01:57) schrieb:
>
> > if /%!PS-Adobe/ =~ File.open {|file| f.gets}
> >     File.rename(file, "#{file}.eps")
>
> This is not C or Python, Ruby needs an end.
>
> Or a one-liner:
>
> | File.rename(file, "#{file}.eps") if /%!PS-Adobe/ =~ File.open {|file| f.gets}

I think that should be

File.rename(file, "#{file}.eps") if /%!PS-Adobe/ =~ File.open(file){|
f| f.gets}

More terse:

File.rename(file, "#{file}.eps") if /%!PS-Adobe/ =~ IO.read(file,10)