lib/ahnnotate/function/format.rb in ahnnotate-0.2.0 vs lib/ahnnotate/function/format.rb in ahnnotate-0.3.0

- old
+ new

@@ -12,25 +12,12 @@ end private def strip_schema(content) - matches = pattern.match(content) + @schema_stripper ||= StripSchema.new(comment: comment) - if matches - matches["post"] - else - content - end - end - - def pattern - @pattern ||= - begin - newline = /\r?\n\r?/ - - /\A#{comment}\s==\sSchema\sInfo#{newline}?(?:^#{comment}[^\n]*$#{newline})*#{newline}(?<post>.*)/m - end + @schema_stripper.call(content) end end end end