xsd 2.9.0 → 2.9.1
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/CHANGELOG.md +11 -0
- data/Gemfile +0 -1
- data/lib/xsd/base_object.rb +2 -2
- data/lib/xsd/objects/schema.rb +16 -0
- data/lib/xsd/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 90d2e1e3950f8ada667ad7a2960940c3a4857918425c6fb54ef6c6a92702f1bc
|
|
4
|
+
data.tar.gz: 713e112c94582f982c01708d6ca735fd667006b476cb6ef0125383c55e39644b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a804d3750423fe3c04c5d99614dac7a49679941498dacb9e9f72ef319c99da2c21ab70e94df58e38e7d0bae59561c66836c81db7df651ca68030baf363c96eab
|
|
7
|
+
data.tar.gz: 7ed63b4341d8a27a6fc1b3df4d3c6aebd30a2a5e101bf91ccaa32b54997b47f475d98c329c406eb5802706d4361b9ef6dc119a6422922726234391d124a202b2
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [2.9.1] - 2026-10-20
|
|
2
|
+
|
|
3
|
+
### Changed
|
|
4
|
+
|
|
5
|
+
- A reference by name (a `type`, `ref`, `base`, …) is looked up in an index of the schema's top-level declarations
|
|
6
|
+
(`Schema#declaration_node`), built on the first lookup, instead of an XPath query that scanned every child of the
|
|
7
|
+
schema again for each reference. Large schemas referenced thousands of times are read several times faster
|
|
8
|
+
there; what is found is the same.
|
|
9
|
+
- The specs no longer load `wasabi`, which only a commented-out example used and which does not load on Ruby 3.4
|
|
10
|
+
(it requires `kconv`): the suite runs on Ruby 3.4.
|
|
11
|
+
|
|
1
12
|
## [2.9.0] - 2026-10-18
|
|
2
13
|
|
|
3
14
|
### Changed
|
data/Gemfile
CHANGED
data/lib/xsd/base_object.rb
CHANGED
|
@@ -129,9 +129,9 @@ module XSD
|
|
|
129
129
|
# determine schema for namespace
|
|
130
130
|
search_schemas = schemas_for_namespace(name_prefix)
|
|
131
131
|
|
|
132
|
-
# find
|
|
132
|
+
# find the declaration in the schemas of the namespace
|
|
133
133
|
search_schemas.each do |s|
|
|
134
|
-
node = s.
|
|
134
|
+
node = s.declaration_node(node_name, name_local)
|
|
135
135
|
return s.node_to_object(node) if node
|
|
136
136
|
end
|
|
137
137
|
|
data/lib/xsd/objects/schema.rb
CHANGED
|
@@ -127,6 +127,22 @@ module XSD
|
|
|
127
127
|
chameleon? ? (@object_cache ||= {}.compare_by_identity) : reader.object_cache
|
|
128
128
|
end
|
|
129
129
|
|
|
130
|
+
# The node of a top-level declaration of this schema, by its kind and name — what a reference by name looks up
|
|
131
|
+
# (BaseObject#object_by_name). The children are indexed in one pass on the first lookup: a query per lookup
|
|
132
|
+
# scans all of them again, and a large schema is looked up in once for every reference to it.
|
|
133
|
+
# @param [Symbol, String] node_name kind of declaration: complexType, simpleType, element, group, ...
|
|
134
|
+
# @param [String] name local name
|
|
135
|
+
# @return Nokogiri::XML::Element, nil
|
|
136
|
+
def declaration_node(node_name, name)
|
|
137
|
+
@declaration_nodes ||= node.element_children.each_with_object({}) do |child, index|
|
|
138
|
+
next unless child.namespace&.href == XML_SCHEMA
|
|
139
|
+
|
|
140
|
+
# the first one, as a query would find it
|
|
141
|
+
index[[child.name, child['name']]] ||= child
|
|
142
|
+
end
|
|
143
|
+
@declaration_nodes[[node_name.to_s, name]]
|
|
144
|
+
end
|
|
145
|
+
|
|
130
146
|
# This schema and every schema it includes, those included in turn too
|
|
131
147
|
# @return Array<Schema>
|
|
132
148
|
def with_includes
|
data/lib/xsd/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: xsd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.9.
|
|
4
|
+
version: 2.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- d.arkhipov
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: builder
|
|
@@ -119,7 +118,6 @@ metadata:
|
|
|
119
118
|
homepage_uri: https://github.com/ekzo-dev/ruby-xsd
|
|
120
119
|
source_code_uri: https://github.com/ekzo-dev/ruby-xsd
|
|
121
120
|
changelog_uri: https://github.com/ekzo-dev/ruby-xsd/blob/main/CHANGELOG.md
|
|
122
|
-
post_install_message:
|
|
123
121
|
rdoc_options: []
|
|
124
122
|
require_paths:
|
|
125
123
|
- lib
|
|
@@ -134,8 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
134
132
|
- !ruby/object:Gem::Version
|
|
135
133
|
version: '0'
|
|
136
134
|
requirements: []
|
|
137
|
-
rubygems_version: 3.
|
|
138
|
-
signing_key:
|
|
135
|
+
rubygems_version: 3.6.9
|
|
139
136
|
specification_version: 4
|
|
140
137
|
summary: The Ruby XSD library is an XML Schema implementation for Ruby.
|
|
141
138
|
test_files: []
|