lib/ruumba/analyzer.rb
# The regular expression to capture interpolated Ruby.
The regular expression to capture interpolated Ruby.
The regular expression to capture interpolated Ruby .
def parse_file(filename)
      file_text = File.read(filename).gsub(/<%==/, '<%= raw')
      matching_regions = file_text.enum_for(:scan, ERB_REGEX)
                                  .map { Regexp.last_match.offset(1) }
      [file_text, matching_regions]
    end
def parse_file ( filename ) file_text = File . read ( filename ) . gsub ( / <%== / , '<%= raw' ) matching_regions = file_text . enum_for ( :scan , ERB_REGEX ) . map { Regexp . last_match . offset ( 1 ) } [ file_text , matching_regions ] end
The regular expression to capture interpolated Ruby.
The regular expression to capture interpolated Ruby .
# http://edgeguides.rubyonrails.org/active_support_core_extensions.html#output-safety # replace '<%==' with '<%= raw' to avoid generating invalid ruby code
filename
<not_specific>