lib/scss_lint/linter.rb in scss-lint-0.6.7 vs lib/scss_lint/linter.rb in scss-lint-0.7.0

- old
+ new

@@ -19,9 +19,20 @@ protected # Helper for creating lint from a parse tree node def add_lint(node) - @lints << Lint.new(node.filename, node.line, description) + @lints << Lint.new(engine.filename, node.line, description) + end + + # Monkey-patched implementation that adds support for traversing + # Sass::Script::Nodes (original implementation only supports + # Sass::Tree::Nodes). + def node_name(node) + if node.is_a?(Sass::Script::Node) + "script_#{node.class.name.gsub(/.*::(.*?)$/, '\\1').downcase}" + else + super + end end end end