flyerhzm/rails_best_practices — Issue #62: Encoding issue with ERB templates
Author: negative
Created: 2011-10-09 14:06:41+00:00
State: open

The following exception is raised if the project contains ERB templates with UTF -8 characters (ran with the -d flag).

```/Users/negative/.rvm/gems/ruby-1.9.2-p290@test/gems/rails_best_practices-1.1.0/lib/rails_best_practices/core/runner.rb:107:in `rescue in parse_ruby': undefined local variable or method `filename' for # (NameError)
from /Users/negative/.rvm/gems/ruby-1.9.2-p290@test/gems/rails_best_practices-1.1.0/lib/rails_best_practices/core/runner.rb:103:in `parse_ruby'
from (eval):4:in `review'
from (eval):10:in `review_file'
```

The exception is raised because of line 104 in `runner.rb`:
```Sexp.from_array(Ripper::SexpBuilder.new(content).parse)
```

The following gist isolates the issue:
https://gist.github.com/1269432