module SCSSLint
  # Reports lints in an XML format.
  class Reporter::XMLReporter < Reporter
    def report_lints
      output = '<?xml version="1.0" encoding="utf-8"?>'

      output << '<lint>'
      lints.group_by(&:filename).each do |filename, file_lints|
        output << "<file name=#{filename.encode(:xml => :attr)}>"

        file_lints.each do |lint|
          output << "<issue line=\"#{lint.location.line}\" " <<
                           "column=\"#{lint.location.column}\" " <<
                           "length=\"#{lint.location.length}\" " <<
                           "severity=\"#{lint.severity}\" " <<
                           "reason=#{lint.description.encode(:xml => :attr)} />"
        end

        output << '</file>'
      end
      output << '</lint>'

      output
    end
  end
end

module SCSSLint
  # Reports lints in an XML format.
  class Reporter::XMLReporter < Reporter
    def report_lints
      output = '<?xml version="1.0" encoding="utf-8"?>'

      output << '<lint>'
      lints.group_by(&:filename).each do |filename, file_lints|
        output << "<file name=#{filename.encode(xml: :attr)}>"

        file_lints.each do |lint|
          output << "<issue line=\"#{lint.location.line}\" " <<
                           "column=\"#{lint.location.column}\" " <<
                           "length=\"#{lint.location.length}\" " <<
                           "severity=\"#{lint.severity}\" " <<
                           "reason=#{lint.description.encode(xml: :attr)} />"
        end

        output << '</file>'
      end
      output << '</lint>'

      output
    end
  end
end

Use the new Ruby 1.9 hash syntax
Use the new Ruby 1.9 hash syntax

Change-Id: Id850e9ccc280b7304f0b769b8ad731d73e394431
Reviewed-on: http://gerrit.causes.com/37449
Tested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com>
Reviewed-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33d@causes.com>
