Method: Flay#process_erb

Defined in:
lib/flay_erb.rb

#process_erb(file) ⇒ Object

Process erb and parse the result. Returns the sexp of the parsed ruby.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/flay_erb.rb', line 10

def process_erb file
  erb = File.read file

  ruby = Erubi.new(erb).src

  begin
    RubyParser.new.process(ruby, file)
  rescue => e
    warn ruby if option[:verbose]
    raise e
  end
end