lib/erb/formatter.rb in erb-formatter-0.2.2 vs lib/erb/formatter.rb in erb-formatter-0.3.0

- old
+ new

@@ -1,15 +1,17 @@ # frozen_string_literal: false +require 'pp' require "erb" require "ripper" require 'securerandom' require 'strscan' require 'stringio' class ERB::Formatter - VERSION = "0.2.2" + VERSION = "0.3.0" + autoload :IgnoreList, 'erb/formatter/ignore_list' class Error < StandardError; end # https://stackoverflow.com/a/317081 @@ -338,10 +340,10 @@ p POS: pre_pos...scanner.pos, advanced: source[pre_pos...scanner.pos] if @debug p MATCHED: matched if @debug self.pre_pos = scanner.charpos # Don't accept `name= "value"` attributes - raise "Bad attribute, please fix spaces after the equal sign." if BAD_ATTR.match? pre_match + raise "Bad attribute, please fix spaces after the equal sign:\n#{pre_match}" if BAD_ATTR.match? pre_match format_erb_tags(pre_match) if pre_match if matched.match?(HTML_TAG_CLOSE) tag_name = scanner.captures.first