lib/erb/formatter.rb in erb-formatter-0.2.0 vs lib/erb/formatter.rb in erb-formatter-0.2.1
- old
+ new
@@ -8,11 +8,11 @@
require 'strscan'
require 'pp'
require 'stringio'
class ERB::Formatter
- VERSION = "0.2.0"
+ VERSION = "0.2.1"
autoload :IgnoreList, 'erb/formatter/ignore_list'
class Error < StandardError; end
# https://stackoverflow.com/a/317081
@@ -289,10 +289,10 @@
erb_scanner = StringScanner.new(string.to_s)
erb_pre_pos = 0
until erb_scanner.eos?
if erb_scanner.scan_until(erb_tags_regexp)
- p PRE_MATCH: [erb_pre_pos, '..', erb_scanner.pre_match]
+ p PRE_MATCH: [erb_pre_pos, '..', erb_scanner.pre_match] if @debug
erb_pre_match = erb_scanner.pre_match
erb_pre_match = erb_pre_match[erb_pre_pos..]
erb_pre_pos = erb_scanner.pos
erb_code = erb_tags[erb_scanner.captures.first]