Sha256: 5175944c1d41bd49e2a9e1afccc04fb62676890c681dc7dcab723f2dab459ff2

Contents?: true

Size: 697 Bytes

Versions: 143

Compression:

Stored size: 697 Bytes

Contents

begin
  require 'builder'
rescue LoadError
  gem 'builder'
  require 'builder'
end

module Cucumber
  module Formatter
    # Emits attributes ordered alphabetically, so that we can predicatbly test output.
    class OrderedXmlMarkup < Builder::XmlMarkup #:nodoc:
      def _insert_attributes(attrs, order=[])
        return if attrs.nil?
        keys = attrs.keys.map{|k| k.to_s}
        keys.sort!
        keys.reverse! if (attrs.keys - [:version, :encoding] == []) #HACK to ensure the 'version' attribute is first in xml declaration.
        keys.each do |k|
          v = attrs[k.to_sym] || attrs[k]
          @target << %{ #{k}="#{_attr_value(v)}"} if v
        end
      end
    end
  end
end

Version data entries

143 entries across 141 versions & 21 rubygems

Version Path
whirlwind-0.1.7 lib/ordered_xml_markup.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/cucumber-1.2.1/lib/cucumber/formatter/ordered_xml_markup.rb
candlepin-api-0.4.0 bundle/ruby/gems/cucumber-1.2.1/lib/cucumber/formatter/ordered_xml_markup.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/cucumber-1.2.1/lib/cucumber/formatter/ordered_xml_markup.rb
pretty_face-0.7 sample_report/some_code/ordered_xml_markup.rb
pretty_face-0.6.1 sample_report/some_code/ordered_xml_markup.rb
pretty_face-0.6 sample_report/some_code/ordered_xml_markup.rb
pretty_face-0.5 sample_report/some_code/ordered_xml_markup.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/lib/cucumber/formatter/ordered_xml_markup.rb
pretty_face-0.4 sample_report/some_code/ordered_xml_markup.rb
pretty_face-0.3 sample_report/some_code/ordered_xml_markup.rb
pretty_face-0.2 sample_report/some_code/ordered_xml_markup.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/lib/cucumber/formatter/ordered_xml_markup.rb
pretty_face-0.1 sample_report/some_code/ordered_xml_markup.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/lib/cucumber/formatter/ordered_xml_markup.rb
casecumber-1.0.2.1 lib/cucumber/formatter/ordered_xml_markup.rb
casecumber-1.2.1.cb2 lib/cucumber/formatter/ordered_xml_markup.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.2.1 lib/cucumber/formatter/ordered_xml_markup.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/lib/cucumber/formatter/ordered_xml_markup.rb