metaschema 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec_status +64 -0
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +76 -0
- data/Rakefile +3 -3
- data/exe/metaschema +2 -2
- data/lib/metaschema/allowed_value_type.rb +24 -22
- data/lib/metaschema/allowed_values_type.rb +21 -19
- data/lib/metaschema/anchor_type.rb +19 -17
- data/lib/metaschema/any_type.rb +5 -3
- data/lib/metaschema/assembly.rb +24 -22
- data/lib/metaschema/assembly_model_type.rb +19 -17
- data/lib/metaschema/assembly_reference_type.rb +23 -21
- data/lib/metaschema/block_quote_type.rb +25 -23
- data/lib/metaschema/choice_type.rb +13 -11
- data/lib/metaschema/code_type.rb +23 -21
- data/lib/metaschema/constraint_let_type.rb +9 -7
- data/lib/metaschema/define_assembly_constraints_type.rb +23 -21
- data/lib/metaschema/define_field_constraints_type.rb +17 -15
- data/lib/metaschema/define_flag_constraints_type.rb +17 -15
- data/lib/metaschema/example_type.rb +11 -9
- data/lib/metaschema/expect_constraint_type.rb +17 -15
- data/lib/metaschema/field.rb +18 -16
- data/lib/metaschema/field_reference_type.rb +26 -24
- data/lib/metaschema/flag.rb +18 -16
- data/lib/metaschema/flag_reference_type.rb +20 -18
- data/lib/metaschema/global_assembly_definition_type.rb +33 -31
- data/lib/metaschema/global_field_definition_type.rb +37 -33
- data/lib/metaschema/global_flag_definition_type.rb +26 -24
- data/lib/metaschema/group_as_type.rb +10 -8
- data/lib/metaschema/grouped_assembly_reference_type.rb +17 -15
- data/lib/metaschema/grouped_choice_type.rb +23 -21
- data/lib/metaschema/grouped_field_reference_type.rb +17 -15
- data/lib/metaschema/grouped_inline_assembly_definition_type.rb +28 -26
- data/lib/metaschema/grouped_inline_field_definition_type.rb +35 -33
- data/lib/metaschema/image_type.rb +8 -6
- data/lib/metaschema/import.rb +6 -4
- data/lib/metaschema/index_has_key_constraint_type.rb +18 -16
- data/lib/metaschema/inline_assembly_definition_type.rb +35 -33
- data/lib/metaschema/inline_field_definition_type.rb +41 -39
- data/lib/metaschema/inline_flag_definition_type.rb +24 -22
- data/lib/metaschema/inline_markup_type.rb +19 -17
- data/lib/metaschema/insert_type.rb +7 -5
- data/lib/metaschema/json_key_type.rb +6 -4
- data/lib/metaschema/json_value_key_flag_type.rb +6 -4
- data/lib/metaschema/key_field.rb +9 -7
- data/lib/metaschema/list_item_type.rb +36 -34
- data/lib/metaschema/list_type.rb +7 -5
- data/lib/metaschema/markup_line_datatype.rb +22 -20
- data/lib/metaschema/matches_constraint_type.rb +17 -15
- data/lib/metaschema/metaschema_import_type.rb +6 -4
- data/lib/metaschema/metaschemaconstraints.rb +15 -13
- data/lib/metaschema/namespace_binding_type.rb +7 -5
- data/lib/metaschema/ordered_list_type.rb +7 -5
- data/lib/metaschema/preformatted_type.rb +22 -20
- data/lib/metaschema/property_type.rb +9 -7
- data/lib/metaschema/remarks_type.rb +28 -26
- data/lib/metaschema/root.rb +27 -25
- data/lib/metaschema/root_name.rb +6 -4
- data/lib/metaschema/scope.rb +13 -11
- data/lib/metaschema/table_cell_type.rb +24 -22
- data/lib/metaschema/table_row_type.rb +8 -6
- data/lib/metaschema/table_type.rb +7 -5
- data/lib/metaschema/targeted_allowed_values_constraint_type.rb +22 -20
- data/lib/metaschema/targeted_expect_constraint_type.rb +18 -16
- data/lib/metaschema/targeted_has_cardinality_constraint_type.rb +18 -16
- data/lib/metaschema/targeted_index_constraint_type.rb +19 -17
- data/lib/metaschema/targeted_index_has_key_constraint_type.rb +19 -17
- data/lib/metaschema/targeted_key_constraint_type.rb +18 -16
- data/lib/metaschema/targeted_matches_constraint_type.rb +18 -16
- data/lib/metaschema/use_name_type.rb +6 -4
- data/lib/metaschema/version.rb +1 -1
- data/lib/metaschema.rb +4 -4
- metadata +9 -6
@@ -1,13 +1,15 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
3
|
+
require 'lutaml/model'
|
4
|
+
|
5
|
+
require_relative 'markup_line_datatype'
|
6
|
+
require_relative 'property_type'
|
7
|
+
require_relative 'remarks_type'
|
6
8
|
|
7
9
|
module Metaschema
|
8
10
|
class TargetedHasCardinalityConstraintType < Lutaml::Model::Serializable
|
9
11
|
attribute :id, :string
|
10
|
-
attribute :level, :string, default: -> {
|
12
|
+
attribute :level, :string, default: -> { 'ERROR' }
|
11
13
|
attribute :target, :string
|
12
14
|
attribute :min_occurs, :integer
|
13
15
|
attribute :max_occurs, :integer
|
@@ -17,18 +19,18 @@ module Metaschema
|
|
17
19
|
attribute :remarks, RemarksType
|
18
20
|
|
19
21
|
xml do
|
20
|
-
root
|
21
|
-
namespace
|
22
|
+
root 'TargetedHasCardinalityConstraintType'
|
23
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
22
24
|
|
23
|
-
map_attribute
|
24
|
-
map_attribute
|
25
|
-
map_attribute
|
26
|
-
map_attribute
|
27
|
-
map_attribute
|
28
|
-
map_element
|
29
|
-
map_element
|
30
|
-
map_element
|
31
|
-
map_element
|
25
|
+
map_attribute 'id', to: :id
|
26
|
+
map_attribute 'level', to: :level
|
27
|
+
map_attribute 'target', to: :target
|
28
|
+
map_attribute 'min-occurs', to: :min_occurs
|
29
|
+
map_attribute 'max-occurs', to: :max_occurs
|
30
|
+
map_element 'formal-name', to: :formal_name
|
31
|
+
map_element 'description', to: :description
|
32
|
+
map_element 'prop', to: :prop
|
33
|
+
map_element 'remarks', to: :remarks
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|
@@ -1,14 +1,16 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
6
|
-
require_relative
|
3
|
+
require 'lutaml/model'
|
4
|
+
|
5
|
+
require_relative 'key_field'
|
6
|
+
require_relative 'markup_line_datatype'
|
7
|
+
require_relative 'property_type'
|
8
|
+
require_relative 'remarks_type'
|
7
9
|
|
8
10
|
module Metaschema
|
9
11
|
class TargetedIndexConstraintType < Lutaml::Model::Serializable
|
10
12
|
attribute :id, :string
|
11
|
-
attribute :level, :string, default: -> {
|
13
|
+
attribute :level, :string, default: -> { 'ERROR' }
|
12
14
|
attribute :target, :string
|
13
15
|
attribute :name, :string
|
14
16
|
attribute :formal_name, :string
|
@@ -18,18 +20,18 @@ module Metaschema
|
|
18
20
|
attribute :remarks, RemarksType
|
19
21
|
|
20
22
|
xml do
|
21
|
-
root
|
22
|
-
namespace
|
23
|
+
root 'TargetedIndexConstraintType'
|
24
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
23
25
|
|
24
|
-
map_attribute
|
25
|
-
map_attribute
|
26
|
-
map_attribute
|
27
|
-
map_attribute
|
28
|
-
map_element
|
29
|
-
map_element
|
30
|
-
map_element
|
31
|
-
map_element
|
32
|
-
map_element
|
26
|
+
map_attribute 'id', to: :id
|
27
|
+
map_attribute 'level', to: :level
|
28
|
+
map_attribute 'target', to: :target
|
29
|
+
map_attribute 'name', to: :name
|
30
|
+
map_element 'formal-name', to: :formal_name
|
31
|
+
map_element 'description', to: :description
|
32
|
+
map_element 'prop', to: :prop
|
33
|
+
map_element 'key-field', to: :key_field
|
34
|
+
map_element 'remarks', to: :remarks
|
33
35
|
end
|
34
36
|
end
|
35
37
|
end
|
@@ -1,14 +1,16 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
6
|
-
require_relative
|
3
|
+
require 'lutaml/model'
|
4
|
+
|
5
|
+
require_relative 'key_field'
|
6
|
+
require_relative 'markup_line_datatype'
|
7
|
+
require_relative 'property_type'
|
8
|
+
require_relative 'remarks_type'
|
7
9
|
|
8
10
|
module Metaschema
|
9
11
|
class TargetedIndexHasKeyConstraintType < Lutaml::Model::Serializable
|
10
12
|
attribute :id, :string
|
11
|
-
attribute :level, :string, default: -> {
|
13
|
+
attribute :level, :string, default: -> { 'ERROR' }
|
12
14
|
attribute :name, :string
|
13
15
|
attribute :target, :string
|
14
16
|
attribute :formal_name, :string
|
@@ -18,18 +20,18 @@ module Metaschema
|
|
18
20
|
attribute :remarks, RemarksType
|
19
21
|
|
20
22
|
xml do
|
21
|
-
root
|
22
|
-
namespace
|
23
|
+
root 'TargetedIndexHasKeyConstraintType'
|
24
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
23
25
|
|
24
|
-
map_attribute
|
25
|
-
map_attribute
|
26
|
-
map_attribute
|
27
|
-
map_attribute
|
28
|
-
map_element
|
29
|
-
map_element
|
30
|
-
map_element
|
31
|
-
map_element
|
32
|
-
map_element
|
26
|
+
map_attribute 'id', to: :id
|
27
|
+
map_attribute 'level', to: :level
|
28
|
+
map_attribute 'name', to: :name
|
29
|
+
map_attribute 'target', to: :target
|
30
|
+
map_element 'formal-name', to: :formal_name
|
31
|
+
map_element 'description', to: :description
|
32
|
+
map_element 'prop', to: :prop
|
33
|
+
map_element 'key-field', to: :key_field
|
34
|
+
map_element 'remarks', to: :remarks
|
33
35
|
end
|
34
36
|
end
|
35
37
|
end
|
@@ -1,14 +1,16 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
6
|
-
require_relative
|
3
|
+
require 'lutaml/model'
|
4
|
+
|
5
|
+
require_relative 'key_field'
|
6
|
+
require_relative 'markup_line_datatype'
|
7
|
+
require_relative 'property_type'
|
8
|
+
require_relative 'remarks_type'
|
7
9
|
|
8
10
|
module Metaschema
|
9
11
|
class TargetedKeyConstraintType < Lutaml::Model::Serializable
|
10
12
|
attribute :id, :string
|
11
|
-
attribute :level, :string, default: -> {
|
13
|
+
attribute :level, :string, default: -> { 'ERROR' }
|
12
14
|
attribute :target, :string
|
13
15
|
attribute :formal_name, :string
|
14
16
|
attribute :description, MarkupLineDatatype
|
@@ -17,17 +19,17 @@ module Metaschema
|
|
17
19
|
attribute :remarks, RemarksType
|
18
20
|
|
19
21
|
xml do
|
20
|
-
root
|
21
|
-
namespace
|
22
|
+
root 'TargetedKeyConstraintType'
|
23
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
22
24
|
|
23
|
-
map_attribute
|
24
|
-
map_attribute
|
25
|
-
map_attribute
|
26
|
-
map_element
|
27
|
-
map_element
|
28
|
-
map_element
|
29
|
-
map_element
|
30
|
-
map_element
|
25
|
+
map_attribute 'id', to: :id
|
26
|
+
map_attribute 'level', to: :level
|
27
|
+
map_attribute 'target', to: :target
|
28
|
+
map_element 'formal-name', to: :formal_name
|
29
|
+
map_element 'description', to: :description
|
30
|
+
map_element 'prop', to: :prop
|
31
|
+
map_element 'key-field', to: :key_field
|
32
|
+
map_element 'remarks', to: :remarks
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|
@@ -1,13 +1,15 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
3
|
+
require 'lutaml/model'
|
4
|
+
|
5
|
+
require_relative 'markup_line_datatype'
|
6
|
+
require_relative 'property_type'
|
7
|
+
require_relative 'remarks_type'
|
6
8
|
|
7
9
|
module Metaschema
|
8
10
|
class TargetedMatchesConstraintType < Lutaml::Model::Serializable
|
9
11
|
attribute :id, :string
|
10
|
-
attribute :level, :string, default: -> {
|
12
|
+
attribute :level, :string, default: -> { 'ERROR' }
|
11
13
|
attribute :regex, :string
|
12
14
|
attribute :datatype, :string
|
13
15
|
attribute :target, :string
|
@@ -17,18 +19,18 @@ module Metaschema
|
|
17
19
|
attribute :remarks, RemarksType
|
18
20
|
|
19
21
|
xml do
|
20
|
-
root
|
21
|
-
namespace
|
22
|
+
root 'TargetedMatchesConstraintType'
|
23
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
22
24
|
|
23
|
-
map_attribute
|
24
|
-
map_attribute
|
25
|
-
map_attribute
|
26
|
-
map_attribute
|
27
|
-
map_attribute
|
28
|
-
map_element
|
29
|
-
map_element
|
30
|
-
map_element
|
31
|
-
map_element
|
25
|
+
map_attribute 'id', to: :id
|
26
|
+
map_attribute 'level', to: :level
|
27
|
+
map_attribute 'regex', to: :regex
|
28
|
+
map_attribute 'datatype', to: :datatype
|
29
|
+
map_attribute 'target', to: :target
|
30
|
+
map_element 'formal-name', to: :formal_name
|
31
|
+
map_element 'description', to: :description
|
32
|
+
map_element 'prop', to: :prop
|
33
|
+
map_element 'remarks', to: :remarks
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'lutaml/model'
|
2
4
|
|
3
5
|
module Metaschema
|
4
6
|
class UseNameType < Lutaml::Model::Serializable
|
@@ -6,11 +8,11 @@ module Metaschema
|
|
6
8
|
attribute :index, :integer
|
7
9
|
|
8
10
|
xml do
|
9
|
-
root
|
10
|
-
namespace
|
11
|
+
root 'UseNameType'
|
12
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
11
13
|
|
12
14
|
map_content to: :content
|
13
|
-
map_attribute
|
15
|
+
map_attribute 'index', to: :index
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
data/lib/metaschema/version.rb
CHANGED
data/lib/metaschema.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require 'lutaml/model'
|
4
4
|
|
5
5
|
Lutaml::Model::Config.configure do |config|
|
6
|
-
require
|
6
|
+
require 'lutaml/model/xml_adapter/nokogiri_adapter'
|
7
7
|
config.xml_adapter = Lutaml::Model::XmlAdapter::NokogiriAdapter
|
8
8
|
end
|
9
9
|
|
10
|
-
require_relative
|
11
|
-
require_relative
|
10
|
+
require_relative 'metaschema/version'
|
11
|
+
require_relative 'metaschema/root'
|
12
12
|
|
13
13
|
module Metaschema
|
14
14
|
class Error < StandardError; end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metaschema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lutaml-model
|
@@ -144,6 +144,9 @@ executables:
|
|
144
144
|
extensions: []
|
145
145
|
extra_rdoc_files: []
|
146
146
|
files:
|
147
|
+
- ".rspec_status"
|
148
|
+
- ".rubocop.yml"
|
149
|
+
- ".rubocop_todo.yml"
|
147
150
|
- README.adoc
|
148
151
|
- Rakefile
|
149
152
|
- exe/metaschema
|
@@ -221,7 +224,7 @@ metadata:
|
|
221
224
|
homepage_uri: https://github.com/lutaml/metaschema
|
222
225
|
source_code_uri: https://github.com/lutaml/metaschema
|
223
226
|
changelog_uri: https://github.com/lutaml/metaschema/releases
|
224
|
-
post_install_message:
|
227
|
+
post_install_message:
|
225
228
|
rdoc_options: []
|
226
229
|
require_paths:
|
227
230
|
- lib
|
@@ -236,8 +239,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
236
239
|
- !ruby/object:Gem::Version
|
237
240
|
version: '0'
|
238
241
|
requirements: []
|
239
|
-
rubygems_version: 3.
|
240
|
-
signing_key:
|
242
|
+
rubygems_version: 3.3.27
|
243
|
+
signing_key:
|
241
244
|
specification_version: 4
|
242
245
|
summary: Parser and generator for NIST Metaschema
|
243
246
|
test_files: []
|