Stefano Crocco wrote in post #1136457:
>
> Putting everything together, this is how I'd do it:
>
> require 'ripper'
>
> error_string = ""
> failures = 0
> Dir["**/*.erb"].each do |template|
>      begin
>          file = File.expand_path template
>          src = ERB.new(File.read(file), nil, '-').src
>          if !Ripper.sexp(src)
>            error_string += `erb -P -x -T '-' #{file} | ruby -c 2>&1` +
> "\n"
>            failures += 1
>          end
>      end
>  end

This is great, thank you! I adapted your example a bit, works like a
charm.

-- 
Posted via http://www.ruby-forum.com/.