canon 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -1
- data/.rubocop_todo.yml +276 -7
- data/README.adoc +203 -138
- data/_config.yml +116 -0
- data/docs/ADVANCED_TOPICS.adoc +20 -0
- data/docs/BASIC_USAGE.adoc +16 -0
- data/docs/CHARACTER_VISUALIZATION.adoc +567 -0
- data/docs/CLI.adoc +493 -0
- data/docs/CUSTOMIZING_BEHAVIOR.adoc +19 -0
- data/docs/DIFF_ARCHITECTURE.adoc +435 -0
- data/docs/DIFF_FORMATTING.adoc +540 -0
- data/docs/FORMATS.adoc +447 -0
- data/docs/INDEX.adoc +222 -0
- data/docs/INPUT_VALIDATION.adoc +477 -0
- data/docs/MATCH_ARCHITECTURE.adoc +463 -0
- data/docs/MATCH_OPTIONS.adoc +719 -0
- data/docs/MODES.adoc +432 -0
- data/docs/NORMATIVE_INFORMATIVE_DIFFS.adoc +219 -0
- data/docs/OPTIONS.adoc +1387 -0
- data/docs/PREPROCESSING.adoc +491 -0
- data/docs/RSPEC.adoc +605 -0
- data/docs/RUBY_API.adoc +478 -0
- data/docs/SEMANTIC_DIFF_REPORT.adoc +528 -0
- data/docs/UNDERSTANDING_CANON.adoc +17 -0
- data/docs/VERBOSE.adoc +482 -0
- data/exe/canon +7 -0
- data/lib/canon/cli.rb +179 -0
- data/lib/canon/commands/diff_command.rb +195 -0
- data/lib/canon/commands/format_command.rb +113 -0
- data/lib/canon/comparison/base_comparator.rb +39 -0
- data/lib/canon/comparison/comparison_result.rb +79 -0
- data/lib/canon/comparison/html_comparator.rb +410 -0
- data/lib/canon/comparison/json_comparator.rb +212 -0
- data/lib/canon/comparison/match_options.rb +616 -0
- data/lib/canon/comparison/xml_comparator.rb +566 -0
- data/lib/canon/comparison/yaml_comparator.rb +93 -0
- data/lib/canon/comparison.rb +239 -0
- data/lib/canon/config.rb +172 -0
- data/lib/canon/diff/diff_block.rb +71 -0
- data/lib/canon/diff/diff_block_builder.rb +105 -0
- data/lib/canon/diff/diff_classifier.rb +46 -0
- data/lib/canon/diff/diff_context.rb +85 -0
- data/lib/canon/diff/diff_context_builder.rb +107 -0
- data/lib/canon/diff/diff_line.rb +77 -0
- data/lib/canon/diff/diff_node.rb +56 -0
- data/lib/canon/diff/diff_node_mapper.rb +148 -0
- data/lib/canon/diff/diff_report.rb +133 -0
- data/lib/canon/diff/diff_report_builder.rb +62 -0
- data/lib/canon/diff_formatter/by_line/base_formatter.rb +407 -0
- data/lib/canon/diff_formatter/by_line/html_formatter.rb +672 -0
- data/lib/canon/diff_formatter/by_line/json_formatter.rb +284 -0
- data/lib/canon/diff_formatter/by_line/simple_formatter.rb +190 -0
- data/lib/canon/diff_formatter/by_line/xml_formatter.rb +860 -0
- data/lib/canon/diff_formatter/by_line/yaml_formatter.rb +292 -0
- data/lib/canon/diff_formatter/by_object/base_formatter.rb +199 -0
- data/lib/canon/diff_formatter/by_object/json_formatter.rb +305 -0
- data/lib/canon/diff_formatter/by_object/xml_formatter.rb +248 -0
- data/lib/canon/diff_formatter/by_object/yaml_formatter.rb +17 -0
- data/lib/canon/diff_formatter/character_map.yml +197 -0
- data/lib/canon/diff_formatter/debug_output.rb +431 -0
- data/lib/canon/diff_formatter/diff_detail_formatter.rb +551 -0
- data/lib/canon/diff_formatter/legend.rb +141 -0
- data/lib/canon/diff_formatter.rb +520 -0
- data/lib/canon/errors.rb +56 -0
- data/lib/canon/formatters/html4_formatter.rb +17 -0
- data/lib/canon/formatters/html5_formatter.rb +17 -0
- data/lib/canon/formatters/html_formatter.rb +37 -0
- data/lib/canon/formatters/html_formatter_base.rb +163 -0
- data/lib/canon/formatters/json_formatter.rb +3 -0
- data/lib/canon/formatters/xml_formatter.rb +20 -55
- data/lib/canon/formatters/yaml_formatter.rb +4 -1
- data/lib/canon/pretty_printer/html.rb +57 -0
- data/lib/canon/pretty_printer/json.rb +25 -0
- data/lib/canon/pretty_printer/xml.rb +29 -0
- data/lib/canon/rspec_matchers.rb +222 -80
- data/lib/canon/validators/base_validator.rb +49 -0
- data/lib/canon/validators/html_validator.rb +138 -0
- data/lib/canon/validators/json_validator.rb +89 -0
- data/lib/canon/validators/xml_validator.rb +53 -0
- data/lib/canon/validators/yaml_validator.rb +73 -0
- data/lib/canon/version.rb +1 -1
- data/lib/canon/xml/attribute_handler.rb +80 -0
- data/lib/canon/xml/c14n.rb +36 -0
- data/lib/canon/xml/character_encoder.rb +38 -0
- data/lib/canon/xml/data_model.rb +225 -0
- data/lib/canon/xml/element_matcher.rb +196 -0
- data/lib/canon/xml/line_range_mapper.rb +158 -0
- data/lib/canon/xml/namespace_handler.rb +86 -0
- data/lib/canon/xml/node.rb +32 -0
- data/lib/canon/xml/nodes/attribute_node.rb +54 -0
- data/lib/canon/xml/nodes/comment_node.rb +23 -0
- data/lib/canon/xml/nodes/element_node.rb +56 -0
- data/lib/canon/xml/nodes/namespace_node.rb +38 -0
- data/lib/canon/xml/nodes/processing_instruction_node.rb +24 -0
- data/lib/canon/xml/nodes/root_node.rb +16 -0
- data/lib/canon/xml/nodes/text_node.rb +23 -0
- data/lib/canon/xml/processor.rb +151 -0
- data/lib/canon/xml/whitespace_normalizer.rb +72 -0
- data/lib/canon/xml/xml_base_handler.rb +188 -0
- data/lib/canon.rb +14 -3
- metadata +116 -21
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Canon
|
|
4
|
+
module Xml
|
|
5
|
+
# Handles whitespace normalization for flexible XML/HTML comparison
|
|
6
|
+
#
|
|
7
|
+
# Provides methods for normalizing different categories of whitespace:
|
|
8
|
+
# 1. Indentation whitespace
|
|
9
|
+
# 2. Inter-element whitespace (between tags)
|
|
10
|
+
# 3. Text content whitespace (within text nodes)
|
|
11
|
+
# 4. Tag boundary whitespace (inside tags)
|
|
12
|
+
# 5. Attribute formatting (handled by existing ignore_attr_order)
|
|
13
|
+
class WhitespaceNormalizer
|
|
14
|
+
# Normalize text content by collapsing all whitespace sequences
|
|
15
|
+
# to single spaces and trimming leading/trailing whitespace
|
|
16
|
+
#
|
|
17
|
+
# @param text [String] Text to normalize
|
|
18
|
+
# @return [String] Normalized text
|
|
19
|
+
def normalize_text_content(text)
|
|
20
|
+
return "" if text.nil?
|
|
21
|
+
|
|
22
|
+
text.to_s
|
|
23
|
+
.gsub(/\s+/, " ") # Collapse all whitespace sequences to single space
|
|
24
|
+
.strip # Remove leading/trailing whitespace
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Normalize indentation by removing all leading whitespace from each line
|
|
28
|
+
#
|
|
29
|
+
# @param text [String] Text with indentation
|
|
30
|
+
# @return [String] Text with indentation removed
|
|
31
|
+
def normalize_indentation(text)
|
|
32
|
+
return "" if text.nil?
|
|
33
|
+
|
|
34
|
+
text.to_s
|
|
35
|
+
.lines
|
|
36
|
+
.map(&:lstrip) # Remove leading whitespace from each line
|
|
37
|
+
.join
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Normalize inter-element whitespace (whitespace between tags)
|
|
41
|
+
# This removes whitespace-only text nodes between elements
|
|
42
|
+
#
|
|
43
|
+
# @param node [Moxml::Node] Node to check
|
|
44
|
+
# @return [Boolean] true if node is whitespace-only and should be ignored
|
|
45
|
+
def inter_element_whitespace?(node)
|
|
46
|
+
return false unless node.respond_to?(:text?) && node.text?
|
|
47
|
+
|
|
48
|
+
text = node.respond_to?(:content) ? node.content.to_s : node.text.to_s
|
|
49
|
+
text.strip.empty?
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Normalize tag boundary whitespace
|
|
53
|
+
# This is the same as normalizing text content for now,
|
|
54
|
+
# but kept separate for clarity
|
|
55
|
+
#
|
|
56
|
+
# @param text [String] Text at tag boundary
|
|
57
|
+
# @return [String] Normalized text
|
|
58
|
+
def normalize_tag_boundaries(text)
|
|
59
|
+
normalize_text_content(text)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Check if two text strings are equivalent under flexible whitespace rules
|
|
63
|
+
#
|
|
64
|
+
# @param text1 [String] First text
|
|
65
|
+
# @param text2 [String] Second text
|
|
66
|
+
# @return [Boolean] true if equivalent after normalization
|
|
67
|
+
def flexible_equivalent?(text1, text2)
|
|
68
|
+
normalize_text_content(text1) == normalize_text_content(text2)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "uri"
|
|
4
|
+
|
|
5
|
+
module Canon
|
|
6
|
+
module Xml
|
|
7
|
+
# Handler for xml:base fixup in document subsets
|
|
8
|
+
# Implements RFC 3986 URI joining with C14N 1.1 modifications
|
|
9
|
+
class XmlBaseHandler
|
|
10
|
+
# Perform xml:base fixup on an element
|
|
11
|
+
# Returns the fixed-up xml:base value or nil if no fixup needed
|
|
12
|
+
def fixup_xml_base(element, omitted_ancestors)
|
|
13
|
+
return nil if omitted_ancestors.empty?
|
|
14
|
+
|
|
15
|
+
# Collect xml:base values from omitted ancestors
|
|
16
|
+
base_values = collect_base_values(element, omitted_ancestors)
|
|
17
|
+
return nil if base_values.empty?
|
|
18
|
+
|
|
19
|
+
# Join the base values in reverse document order
|
|
20
|
+
join_base_values(base_values)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
# Collect xml:base attribute values from element and omitted ancestors
|
|
26
|
+
def collect_base_values(element, omitted_ancestors)
|
|
27
|
+
values = []
|
|
28
|
+
|
|
29
|
+
# Collect from omitted ancestors (in document order)
|
|
30
|
+
omitted_ancestors.each do |ancestor|
|
|
31
|
+
base_attr = ancestor.attribute_nodes.find(&:xml_base?)
|
|
32
|
+
values << base_attr.value if base_attr
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Add element's own xml:base if present
|
|
36
|
+
element_base = element.attribute_nodes.find(&:xml_base?)
|
|
37
|
+
values << element_base.value if element_base
|
|
38
|
+
|
|
39
|
+
values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Join URI references per RFC 3986 with C14N 1.1 modifications
|
|
43
|
+
def join_base_values(values)
|
|
44
|
+
result = values.first
|
|
45
|
+
|
|
46
|
+
values[1..].each do |ref|
|
|
47
|
+
result = join_uri_references(result, ref)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
result
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Join two URI references per RFC 3986 sections 5.2.1, 5.2.2, 5.2.4
|
|
54
|
+
# with C14N 1.1 modifications
|
|
55
|
+
# rubocop:disable Metrics/MethodLength
|
|
56
|
+
def join_uri_references(base, ref)
|
|
57
|
+
# Parse reference (ignore fragment per C14N 1.1)
|
|
58
|
+
ref_parts = parse_uri(ref)
|
|
59
|
+
|
|
60
|
+
# If ref has a scheme, return ref (without fragment)
|
|
61
|
+
if ref_parts[:scheme]
|
|
62
|
+
return remove_dot_segments(ref_parts[:path] || "")
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Parse base
|
|
66
|
+
base_parts = parse_uri(base)
|
|
67
|
+
|
|
68
|
+
# Build result
|
|
69
|
+
result_parts = {}
|
|
70
|
+
|
|
71
|
+
if ref_parts[:authority]
|
|
72
|
+
result_parts[:authority] = ref_parts[:authority]
|
|
73
|
+
result_parts[:path] = remove_dot_segments(ref_parts[:path] || "")
|
|
74
|
+
result_parts[:query] = ref_parts[:query]
|
|
75
|
+
else
|
|
76
|
+
if ref_parts[:path].nil? || ref_parts[:path].empty?
|
|
77
|
+
result_parts[:path] = base_parts[:path]
|
|
78
|
+
result_parts[:query] = ref_parts[:query] || base_parts[:query]
|
|
79
|
+
else
|
|
80
|
+
if ref_parts[:path].start_with?("/")
|
|
81
|
+
result_parts[:path] = remove_dot_segments(ref_parts[:path])
|
|
82
|
+
else
|
|
83
|
+
result_parts[:path] = merge_paths(base_parts[:path],
|
|
84
|
+
ref_parts[:path])
|
|
85
|
+
result_parts[:path] = remove_dot_segments(result_parts[:path])
|
|
86
|
+
end
|
|
87
|
+
result_parts[:query] = ref_parts[:query]
|
|
88
|
+
end
|
|
89
|
+
result_parts[:authority] = base_parts[:authority]
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
result_parts[:scheme] = base_parts[:scheme]
|
|
93
|
+
|
|
94
|
+
# Reconstruct URI
|
|
95
|
+
reconstruct_uri(result_parts)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Parse URI into components
|
|
99
|
+
def parse_uri(uri_str)
|
|
100
|
+
parts = {}
|
|
101
|
+
|
|
102
|
+
# Simple regex-based parsing
|
|
103
|
+
if uri_str =~ %r{^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?}
|
|
104
|
+
parts[:scheme] = Regexp.last_match(2)
|
|
105
|
+
parts[:authority] = Regexp.last_match(4)
|
|
106
|
+
parts[:path] = Regexp.last_match(5)
|
|
107
|
+
parts[:query] = Regexp.last_match(7)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
parts
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Merge paths per RFC 3986 section 5.2.3
|
|
114
|
+
def merge_paths(base_path, ref_path)
|
|
115
|
+
if base_path&.include?("/")
|
|
116
|
+
base_path.sub(%r{/[^/]*$}, "/#{ref_path}")
|
|
117
|
+
else
|
|
118
|
+
ref_path
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Remove dot segments per RFC 3986 section 5.2.4
|
|
123
|
+
# with C14N 1.1 modifications
|
|
124
|
+
# rubocop:disable Metrics/MethodLength
|
|
125
|
+
def remove_dot_segments(path)
|
|
126
|
+
input = path.dup
|
|
127
|
+
output = ""
|
|
128
|
+
|
|
129
|
+
# Replace trailing ".." with "../"
|
|
130
|
+
input = input.sub(%r{/\.\.$}, "/../")
|
|
131
|
+
|
|
132
|
+
while input.length.positive?
|
|
133
|
+
# A: If input starts with "../" or "./"
|
|
134
|
+
if input.start_with?("../")
|
|
135
|
+
input = input[3..]
|
|
136
|
+
elsif input.start_with?("./")
|
|
137
|
+
input = input[2..]
|
|
138
|
+
# B: If input starts with "/./" or is "/."
|
|
139
|
+
elsif input.start_with?("/./")
|
|
140
|
+
input = "/#{input[3..]}"
|
|
141
|
+
elsif input == "/."
|
|
142
|
+
input = "/"
|
|
143
|
+
# C: If input starts with "/../" or is "/.."
|
|
144
|
+
elsif input.start_with?("/../")
|
|
145
|
+
input = "/#{input[4..]}"
|
|
146
|
+
output = output.sub(%r{/[^/]*$}, "")
|
|
147
|
+
elsif input == "/.."
|
|
148
|
+
input = "/"
|
|
149
|
+
output = output.sub(%r{/[^/]*$}, "")
|
|
150
|
+
# D: If input is "." or ".."
|
|
151
|
+
elsif [".", ".."].include?(input)
|
|
152
|
+
input = ""
|
|
153
|
+
# E: Move first path segment to output
|
|
154
|
+
else
|
|
155
|
+
seg_match = if input.start_with?("/")
|
|
156
|
+
input.match(%r{^(/[^/]*)})
|
|
157
|
+
else
|
|
158
|
+
input.match(/^([^\/]*)/)
|
|
159
|
+
end
|
|
160
|
+
seg = seg_match[1]
|
|
161
|
+
input = input[seg.length..]
|
|
162
|
+
output += seg
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Replace multiple consecutive "/" with single "/"
|
|
167
|
+
output = output.squeeze("/")
|
|
168
|
+
|
|
169
|
+
# Append "/" to trailing ".."
|
|
170
|
+
output += "/" if output.end_with?("/..")
|
|
171
|
+
|
|
172
|
+
output
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Reconstruct URI from parts
|
|
176
|
+
def reconstruct_uri(parts)
|
|
177
|
+
result = ""
|
|
178
|
+
|
|
179
|
+
result += "#{parts[:scheme]}:" if parts[:scheme]
|
|
180
|
+
result += "//#{parts[:authority]}" if parts[:authority]
|
|
181
|
+
result += parts[:path] if parts[:path]
|
|
182
|
+
result += "?#{parts[:query]}" if parts[:query]
|
|
183
|
+
|
|
184
|
+
result
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
end
|
data/lib/canon.rb
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative "canon/version"
|
|
4
|
+
require_relative "canon/errors"
|
|
4
5
|
require_relative "canon/formatters/xml_formatter"
|
|
5
6
|
require_relative "canon/formatters/yaml_formatter"
|
|
6
7
|
require_relative "canon/formatters/json_formatter"
|
|
8
|
+
require_relative "canon/formatters/html_formatter"
|
|
9
|
+
require_relative "canon/formatters/html4_formatter"
|
|
10
|
+
require_relative "canon/formatters/html5_formatter"
|
|
11
|
+
require_relative "canon/comparison"
|
|
7
12
|
|
|
8
13
|
require_relative "canon/rspec_matchers" if defined?(::RSpec)
|
|
9
14
|
|
|
10
15
|
module Canon
|
|
11
|
-
SUPPORTED_FORMATS = %i[xml yaml json].freeze
|
|
16
|
+
SUPPORTED_FORMATS = %i[xml yaml json html html4 html5 string].freeze
|
|
12
17
|
|
|
13
18
|
# Format content based on the specified format type
|
|
14
19
|
# @param content [String] The content to format
|
|
@@ -26,6 +31,7 @@ module Canon
|
|
|
26
31
|
get_formatter(format).parse(content)
|
|
27
32
|
end
|
|
28
33
|
|
|
34
|
+
# rubocop:disable Metrics/MethodLength
|
|
29
35
|
def self.get_formatter(format)
|
|
30
36
|
case format.to_sym
|
|
31
37
|
when :xml
|
|
@@ -34,10 +40,17 @@ module Canon
|
|
|
34
40
|
Formatters::YamlFormatter
|
|
35
41
|
when :json
|
|
36
42
|
Formatters::JsonFormatter
|
|
43
|
+
when :html
|
|
44
|
+
Formatters::HtmlFormatter
|
|
45
|
+
when :html4
|
|
46
|
+
Formatters::Html4Formatter
|
|
47
|
+
when :html5
|
|
48
|
+
Formatters::Html5Formatter
|
|
37
49
|
else
|
|
38
50
|
raise Error, "Unsupported format: #{format}"
|
|
39
51
|
end
|
|
40
52
|
end
|
|
53
|
+
# rubocop:enable Metrics/MethodLength
|
|
41
54
|
|
|
42
55
|
# Define shorthand methods for each supported format
|
|
43
56
|
# Creates parse_{format} and format_{format} methods
|
|
@@ -50,6 +63,4 @@ module Canon
|
|
|
50
63
|
format(content, format)
|
|
51
64
|
end
|
|
52
65
|
end
|
|
53
|
-
|
|
54
|
-
class Error < StandardError; end
|
|
55
66
|
end
|
metadata
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: canon
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-10-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
14
|
+
name: diff-lcs
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
@@ -25,7 +25,7 @@ dependencies:
|
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
28
|
+
name: json
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
31
|
- - ">="
|
|
@@ -39,7 +39,7 @@ dependencies:
|
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: moxml
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
45
|
- - ">="
|
|
@@ -67,13 +67,13 @@ dependencies:
|
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
70
|
+
name: paint
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
73
|
- - ">="
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
75
|
version: '0'
|
|
76
|
-
type: :
|
|
76
|
+
type: :runtime
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
@@ -81,13 +81,13 @@ dependencies:
|
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '0'
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name:
|
|
84
|
+
name: table_tennis
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
87
|
- - ">="
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
89
|
version: '0'
|
|
90
|
-
type: :
|
|
90
|
+
type: :runtime
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
@@ -95,13 +95,13 @@ dependencies:
|
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '0'
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name:
|
|
98
|
+
name: thor
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
101
|
- - ">="
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
103
|
version: '0'
|
|
104
|
-
type: :
|
|
104
|
+
type: :runtime
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
|
@@ -109,24 +109,27 @@ dependencies:
|
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: '0'
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
|
-
name:
|
|
112
|
+
name: unicode-name
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
|
115
115
|
- - ">="
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
117
|
version: '0'
|
|
118
|
-
type: :
|
|
118
|
+
type: :runtime
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
122
|
- - ">="
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
124
|
version: '0'
|
|
125
|
-
description:
|
|
126
|
-
|
|
125
|
+
description: |-
|
|
126
|
+
Canon provides canonicalization and pretty-printing for various serialization
|
|
127
|
+
formats (XML, HTML, JSON, YAML), producing standardized forms suitable for
|
|
128
|
+
comparison, testing, digital signatures, and human-readable output.
|
|
127
129
|
email:
|
|
128
130
|
- open.source@ribose.com
|
|
129
|
-
executables:
|
|
131
|
+
executables:
|
|
132
|
+
- canon
|
|
130
133
|
extensions: []
|
|
131
134
|
extra_rdoc_files: []
|
|
132
135
|
files:
|
|
@@ -136,21 +139,112 @@ files:
|
|
|
136
139
|
- CODE_OF_CONDUCT.md
|
|
137
140
|
- README.adoc
|
|
138
141
|
- Rakefile
|
|
142
|
+
- _config.yml
|
|
143
|
+
- docs/ADVANCED_TOPICS.adoc
|
|
144
|
+
- docs/BASIC_USAGE.adoc
|
|
145
|
+
- docs/CHARACTER_VISUALIZATION.adoc
|
|
146
|
+
- docs/CLI.adoc
|
|
147
|
+
- docs/CUSTOMIZING_BEHAVIOR.adoc
|
|
148
|
+
- docs/DIFF_ARCHITECTURE.adoc
|
|
149
|
+
- docs/DIFF_FORMATTING.adoc
|
|
150
|
+
- docs/FORMATS.adoc
|
|
151
|
+
- docs/INDEX.adoc
|
|
152
|
+
- docs/INPUT_VALIDATION.adoc
|
|
153
|
+
- docs/MATCH_ARCHITECTURE.adoc
|
|
154
|
+
- docs/MATCH_OPTIONS.adoc
|
|
155
|
+
- docs/MODES.adoc
|
|
156
|
+
- docs/NORMATIVE_INFORMATIVE_DIFFS.adoc
|
|
157
|
+
- docs/OPTIONS.adoc
|
|
158
|
+
- docs/PREPROCESSING.adoc
|
|
159
|
+
- docs/RSPEC.adoc
|
|
160
|
+
- docs/RUBY_API.adoc
|
|
161
|
+
- docs/SEMANTIC_DIFF_REPORT.adoc
|
|
162
|
+
- docs/UNDERSTANDING_CANON.adoc
|
|
163
|
+
- docs/VERBOSE.adoc
|
|
164
|
+
- exe/canon
|
|
139
165
|
- lib/canon.rb
|
|
166
|
+
- lib/canon/cli.rb
|
|
167
|
+
- lib/canon/commands/diff_command.rb
|
|
168
|
+
- lib/canon/commands/format_command.rb
|
|
169
|
+
- lib/canon/comparison.rb
|
|
170
|
+
- lib/canon/comparison/base_comparator.rb
|
|
171
|
+
- lib/canon/comparison/comparison_result.rb
|
|
172
|
+
- lib/canon/comparison/html_comparator.rb
|
|
173
|
+
- lib/canon/comparison/json_comparator.rb
|
|
174
|
+
- lib/canon/comparison/match_options.rb
|
|
175
|
+
- lib/canon/comparison/xml_comparator.rb
|
|
176
|
+
- lib/canon/comparison/yaml_comparator.rb
|
|
177
|
+
- lib/canon/config.rb
|
|
178
|
+
- lib/canon/diff/diff_block.rb
|
|
179
|
+
- lib/canon/diff/diff_block_builder.rb
|
|
180
|
+
- lib/canon/diff/diff_classifier.rb
|
|
181
|
+
- lib/canon/diff/diff_context.rb
|
|
182
|
+
- lib/canon/diff/diff_context_builder.rb
|
|
183
|
+
- lib/canon/diff/diff_line.rb
|
|
184
|
+
- lib/canon/diff/diff_node.rb
|
|
185
|
+
- lib/canon/diff/diff_node_mapper.rb
|
|
186
|
+
- lib/canon/diff/diff_report.rb
|
|
187
|
+
- lib/canon/diff/diff_report_builder.rb
|
|
188
|
+
- lib/canon/diff_formatter.rb
|
|
189
|
+
- lib/canon/diff_formatter/by_line/base_formatter.rb
|
|
190
|
+
- lib/canon/diff_formatter/by_line/html_formatter.rb
|
|
191
|
+
- lib/canon/diff_formatter/by_line/json_formatter.rb
|
|
192
|
+
- lib/canon/diff_formatter/by_line/simple_formatter.rb
|
|
193
|
+
- lib/canon/diff_formatter/by_line/xml_formatter.rb
|
|
194
|
+
- lib/canon/diff_formatter/by_line/yaml_formatter.rb
|
|
195
|
+
- lib/canon/diff_formatter/by_object/base_formatter.rb
|
|
196
|
+
- lib/canon/diff_formatter/by_object/json_formatter.rb
|
|
197
|
+
- lib/canon/diff_formatter/by_object/xml_formatter.rb
|
|
198
|
+
- lib/canon/diff_formatter/by_object/yaml_formatter.rb
|
|
199
|
+
- lib/canon/diff_formatter/character_map.yml
|
|
200
|
+
- lib/canon/diff_formatter/debug_output.rb
|
|
201
|
+
- lib/canon/diff_formatter/diff_detail_formatter.rb
|
|
202
|
+
- lib/canon/diff_formatter/legend.rb
|
|
203
|
+
- lib/canon/errors.rb
|
|
204
|
+
- lib/canon/formatters/html4_formatter.rb
|
|
205
|
+
- lib/canon/formatters/html5_formatter.rb
|
|
206
|
+
- lib/canon/formatters/html_formatter.rb
|
|
207
|
+
- lib/canon/formatters/html_formatter_base.rb
|
|
140
208
|
- lib/canon/formatters/json_formatter.rb
|
|
141
209
|
- lib/canon/formatters/xml_formatter.rb
|
|
142
210
|
- lib/canon/formatters/yaml_formatter.rb
|
|
211
|
+
- lib/canon/pretty_printer/html.rb
|
|
212
|
+
- lib/canon/pretty_printer/json.rb
|
|
213
|
+
- lib/canon/pretty_printer/xml.rb
|
|
143
214
|
- lib/canon/rspec_matchers.rb
|
|
215
|
+
- lib/canon/validators/base_validator.rb
|
|
216
|
+
- lib/canon/validators/html_validator.rb
|
|
217
|
+
- lib/canon/validators/json_validator.rb
|
|
218
|
+
- lib/canon/validators/xml_validator.rb
|
|
219
|
+
- lib/canon/validators/yaml_validator.rb
|
|
144
220
|
- lib/canon/version.rb
|
|
221
|
+
- lib/canon/xml/attribute_handler.rb
|
|
222
|
+
- lib/canon/xml/c14n.rb
|
|
223
|
+
- lib/canon/xml/character_encoder.rb
|
|
224
|
+
- lib/canon/xml/data_model.rb
|
|
225
|
+
- lib/canon/xml/element_matcher.rb
|
|
226
|
+
- lib/canon/xml/line_range_mapper.rb
|
|
227
|
+
- lib/canon/xml/namespace_handler.rb
|
|
228
|
+
- lib/canon/xml/node.rb
|
|
229
|
+
- lib/canon/xml/nodes/attribute_node.rb
|
|
230
|
+
- lib/canon/xml/nodes/comment_node.rb
|
|
231
|
+
- lib/canon/xml/nodes/element_node.rb
|
|
232
|
+
- lib/canon/xml/nodes/namespace_node.rb
|
|
233
|
+
- lib/canon/xml/nodes/processing_instruction_node.rb
|
|
234
|
+
- lib/canon/xml/nodes/root_node.rb
|
|
235
|
+
- lib/canon/xml/nodes/text_node.rb
|
|
236
|
+
- lib/canon/xml/processor.rb
|
|
237
|
+
- lib/canon/xml/whitespace_normalizer.rb
|
|
238
|
+
- lib/canon/xml/xml_base_handler.rb
|
|
145
239
|
- lib/xml-c14n.rb
|
|
146
240
|
- sig/xml/c14n.rbs
|
|
147
|
-
homepage: https://github.com/
|
|
241
|
+
homepage: https://github.com/lutaml/canon
|
|
148
242
|
licenses:
|
|
149
243
|
- BSD-2-Clause
|
|
150
244
|
metadata:
|
|
151
|
-
homepage_uri: https://github.com/
|
|
152
|
-
source_code_uri: https://github.com/
|
|
153
|
-
changelog_uri: https://github.com/
|
|
245
|
+
homepage_uri: https://github.com/lutaml/canon
|
|
246
|
+
source_code_uri: https://github.com/lutaml/canon
|
|
247
|
+
changelog_uri: https://github.com/lutaml/canon
|
|
154
248
|
post_install_message:
|
|
155
249
|
rdoc_options: []
|
|
156
250
|
require_paths:
|
|
@@ -169,5 +263,6 @@ requirements: []
|
|
|
169
263
|
rubygems_version: 3.5.22
|
|
170
264
|
signing_key:
|
|
171
265
|
specification_version: 4
|
|
172
|
-
summary:
|
|
266
|
+
summary: Canonicalization, formatting and comparison library for serialization formats
|
|
267
|
+
(XML, HTML, JSON, YAML)
|
|
173
268
|
test_files: []
|