🚀 Launch Week Day 3:Introducing Supply Chain Attack Campaigns Tracking.Learn More →
Socket
Book a DemoInstallSign in
Socket

xml-c14n

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xml-c14n

bundlerRubyGems.org
Version
0.2.1
Version published
Maintainers
1
Created
Source

= XML pretty-print / canonicalizer / RSpec comparator

== Purpose

This gem provides Xml::C14n which is a library that uses Nokogiri to pretty-print and provide a canonicalized form of XML (https://www.w3.org/TR/xml-c14n11/[W3C Canonicalized XML]) suitable for signing and comparison.

This gem also provides the RSpec matcher be_analogous_with for comparing XML content. The matcher used is from the https://github.com/vkononov/compare-xml[`compare-xml`] gem.

== Usage

[source,ruby]

require 'xml/c14n'

input = Xml::C14n.format(File.read(xml_raw)) output = Xml::C14n.format(File.read(xml_c14n))

input == output

In RSpecs:

[source,ruby]

In spec/spec_helper.rb

require 'xml/c14n'

In spec/*_spec.rb

it "canonicalizes #{File.basename(f)}" do input = Xml::C14n.format(File.read(xml_raw)) output = Xml::C14n.format(File.read(xml_c14n))

expect(output).to eq(input) end

it "checks if analogous with #{File.basename(f)}" do input = Xml::C14n.format(File.read(xml_raw)) output = Xml::C14n.format(File.read(xml_c14n))

expect(output).to be_analogous_with(input) end

== License

Copyright Ribose.

FAQs

Package last updated on 14 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts