Sha256: 3c0e594fb7a81715a3f5c54171cdcc6884deeee0ca4cc43766194aebb5a6235b

Contents?: true

Size: 698 Bytes

Versions: 27

Compression:

Stored size: 698 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

27 entries across 25 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/cucumber-1.3.18/lib/cucumber/formatter/ordered_xml_markup.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/cucumber-1.3.18/lib/cucumber/formatter/ordered_xml_markup.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/cucumber-1.3.16/lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.20 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.19 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.18 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.17 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.16 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.15 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.14 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.13 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.12 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.11 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.10 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.9 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.8 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.7 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.6 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.5 lib/cucumber/formatter/ordered_xml_markup.rb
cucumber-1.3.4 lib/cucumber/formatter/ordered_xml_markup.rb