xsd 2.6.2 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3f894631bb4ecfab0ab93c8b67f1a4d2d85dc88aeef5c69890e424c018ea7a0
4
- data.tar.gz: 6be2dfdee0a06f955d80ba57cbc39739fa6c09c06d6af80d194e77ccf32c8797
3
+ metadata.gz: 6ec3eb825c36a39f706cd6a684d294b443fa7c59a4e9494ef8b1a6e65f226e5e
4
+ data.tar.gz: 659b6e95914a0d3a4e04c7b5e17ec54cebbda343b8154b7cd5ff6dd9f2a2ca93
5
5
  SHA512:
6
- metadata.gz: 7d45a0c77011c0bdfd4bdee3998eef649129cb51d2c248b733a35b9c2c19bb8678b2b41035afcc95f69f02e37df550bd90ef5c57a03225789de34ff7dfb65c11
7
- data.tar.gz: dd2673d5e862524a8fad13f8ce55857d9ec3c7daed215542b9806491c428e778ce011b77c26f2dc3aa6ba24a60bfd5d1bdf9ed6cc59a702ac4daa23725fa9dce
6
+ metadata.gz: 7d5dc6738b374642049d316e7213f2b7c83177182cc8aeed164ff7253d8c3a349faf6c46a8781ad1734fa4daa5337462cee769d72bdd7c69d959e18b3ea8605b
7
+ data.tar.gz: e1d929216f6e9239f5ab82ddaf20558b6e562917e6f1c51c392bd988c699f73af0500f9837fd85c8f76afaccb170f88c6a3ddd723b0be7660e596e1010ef7aa1
data/.rubocop.yml CHANGED
@@ -4,7 +4,7 @@ require:
4
4
  - rubocop-rspec
5
5
 
6
6
  AllCops:
7
- TargetRubyVersion: 3.2.2
7
+ TargetRubyVersion: 3.2.3
8
8
  NewCops: enable
9
9
  SuggestExtensions: false
10
10
 
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [2.7.0] - 2024-04-17
2
+
3
+ - Return <xs:any> and <xs:anyAttribute> from collect_elements/collect_attributes
4
+
5
+ ## [2.6.3] - 2024-04-13
6
+
7
+ - Fix retrieving documentation for referenced elements
8
+ - Cache "namespace" call result
9
+
1
10
  ## [2.6.2] - 2024-04-12
2
11
 
3
12
  - Get default value for element/attribute "form" property from schema
@@ -189,7 +189,16 @@ module XSD
189
189
  # Return element documentation
190
190
  # @return Array<String>
191
191
  def documentation
192
- documentation_for(node)
192
+ @documentation ||= begin
193
+ docs = documentation_for(node)
194
+ if docs.any?
195
+ docs
196
+ elsif is_a?(Referenced) && referenced?
197
+ documentation_for(reference.node)
198
+ else
199
+ []
200
+ end
201
+ end
193
202
  end
194
203
 
195
204
  # Return documentation for specified node
@@ -211,7 +220,7 @@ module XSD
211
220
  else
212
221
  # map children recursive
213
222
  map_children(:*).map do |obj|
214
- if obj.is_a?(Element)
223
+ if obj.is_a?(Element) || obj.is_a?(Any)
215
224
  obj
216
225
  else
217
226
  # get elements considering references
@@ -235,7 +244,7 @@ module XSD
235
244
  else
236
245
  # map children recursive
237
246
  map_children(:*).map do |obj|
238
- if obj.is_a?(Attribute)
247
+ if obj.is_a?(Attribute) || obj.is_a?(AnyAttribute)
239
248
  obj
240
249
  else
241
250
  # get attributes considering references
@@ -27,5 +27,11 @@ module XSD
27
27
  # @!attribute process_contents
28
28
  # @return String, nil
29
29
  property :processContents, :string, default: 'strict'
30
+
31
+ # Get virtual element name
32
+ # @return String
33
+ def name
34
+ '#any'
35
+ end
30
36
  end
31
37
  end
@@ -26,5 +26,11 @@ module XSD
26
26
  # @!attribute process_contents
27
27
  # @return String, nil
28
28
  property :processContents, :string, default: 'strict'
29
+
30
+ # Get virtual attribute name
31
+ # @return String
32
+ def name
33
+ '#anyAttribute'
34
+ end
29
35
  end
30
36
  end
@@ -5,8 +5,7 @@ module XSD
5
5
  # Get definition namespace
6
6
  # @return String
7
7
  def namespace
8
- is_referenced = respond_to?(:referenced?)
9
- is_referenced && referenced? ? reference.schema.target_namespace : schema.target_namespace
8
+ @namespace ||= (is_a?(Referenced) && referenced? ? reference.schema : schema).target_namespace
10
9
  end
11
10
 
12
11
  # Get absolute definition name
data/lib/xsd/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module XSD
4
- VERSION = '2.6.2'
4
+ VERSION = '2.7.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.2
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - d.arkhipov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-12 00:00:00.000000000 Z
11
+ date: 2024-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder