metaschema 0.1.0 → 0.1.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.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec_status +64 -0
  3. data/.rubocop.yml +1 -0
  4. data/.rubocop_todo.yml +76 -0
  5. data/Rakefile +3 -3
  6. data/exe/metaschema +2 -2
  7. data/lib/metaschema/allowed_value_type.rb +24 -22
  8. data/lib/metaschema/allowed_values_type.rb +21 -19
  9. data/lib/metaschema/anchor_type.rb +19 -17
  10. data/lib/metaschema/any_type.rb +5 -3
  11. data/lib/metaschema/assembly.rb +24 -22
  12. data/lib/metaschema/assembly_model_type.rb +19 -17
  13. data/lib/metaschema/assembly_reference_type.rb +23 -21
  14. data/lib/metaschema/block_quote_type.rb +25 -23
  15. data/lib/metaschema/choice_type.rb +13 -11
  16. data/lib/metaschema/code_type.rb +23 -21
  17. data/lib/metaschema/constraint_let_type.rb +9 -7
  18. data/lib/metaschema/define_assembly_constraints_type.rb +23 -21
  19. data/lib/metaschema/define_field_constraints_type.rb +17 -15
  20. data/lib/metaschema/define_flag_constraints_type.rb +17 -15
  21. data/lib/metaschema/example_type.rb +11 -9
  22. data/lib/metaschema/expect_constraint_type.rb +17 -15
  23. data/lib/metaschema/field.rb +18 -16
  24. data/lib/metaschema/field_reference_type.rb +26 -24
  25. data/lib/metaschema/flag.rb +18 -16
  26. data/lib/metaschema/flag_reference_type.rb +20 -18
  27. data/lib/metaschema/global_assembly_definition_type.rb +33 -31
  28. data/lib/metaschema/global_field_definition_type.rb +37 -33
  29. data/lib/metaschema/global_flag_definition_type.rb +26 -24
  30. data/lib/metaschema/group_as_type.rb +10 -8
  31. data/lib/metaschema/grouped_assembly_reference_type.rb +17 -15
  32. data/lib/metaschema/grouped_choice_type.rb +23 -21
  33. data/lib/metaschema/grouped_field_reference_type.rb +17 -15
  34. data/lib/metaschema/grouped_inline_assembly_definition_type.rb +28 -26
  35. data/lib/metaschema/grouped_inline_field_definition_type.rb +35 -33
  36. data/lib/metaschema/image_type.rb +8 -6
  37. data/lib/metaschema/import.rb +6 -4
  38. data/lib/metaschema/index_has_key_constraint_type.rb +18 -16
  39. data/lib/metaschema/inline_assembly_definition_type.rb +35 -33
  40. data/lib/metaschema/inline_field_definition_type.rb +41 -39
  41. data/lib/metaschema/inline_flag_definition_type.rb +24 -22
  42. data/lib/metaschema/inline_markup_type.rb +19 -17
  43. data/lib/metaschema/insert_type.rb +7 -5
  44. data/lib/metaschema/json_key_type.rb +6 -4
  45. data/lib/metaschema/json_value_key_flag_type.rb +6 -4
  46. data/lib/metaschema/key_field.rb +9 -7
  47. data/lib/metaschema/list_item_type.rb +36 -34
  48. data/lib/metaschema/list_type.rb +7 -5
  49. data/lib/metaschema/markup_line_datatype.rb +22 -20
  50. data/lib/metaschema/matches_constraint_type.rb +17 -15
  51. data/lib/metaschema/metaschema_import_type.rb +6 -4
  52. data/lib/metaschema/metaschemaconstraints.rb +15 -13
  53. data/lib/metaschema/namespace_binding_type.rb +7 -5
  54. data/lib/metaschema/ordered_list_type.rb +7 -5
  55. data/lib/metaschema/preformatted_type.rb +22 -20
  56. data/lib/metaschema/property_type.rb +9 -7
  57. data/lib/metaschema/remarks_type.rb +28 -26
  58. data/lib/metaschema/root.rb +27 -25
  59. data/lib/metaschema/root_name.rb +6 -4
  60. data/lib/metaschema/scope.rb +13 -11
  61. data/lib/metaschema/table_cell_type.rb +24 -22
  62. data/lib/metaschema/table_row_type.rb +8 -6
  63. data/lib/metaschema/table_type.rb +7 -5
  64. data/lib/metaschema/targeted_allowed_values_constraint_type.rb +22 -20
  65. data/lib/metaschema/targeted_expect_constraint_type.rb +18 -16
  66. data/lib/metaschema/targeted_has_cardinality_constraint_type.rb +18 -16
  67. data/lib/metaschema/targeted_index_constraint_type.rb +19 -17
  68. data/lib/metaschema/targeted_index_has_key_constraint_type.rb +19 -17
  69. data/lib/metaschema/targeted_key_constraint_type.rb +18 -16
  70. data/lib/metaschema/targeted_matches_constraint_type.rb +18 -16
  71. data/lib/metaschema/use_name_type.rb +6 -4
  72. data/lib/metaschema/version.rb +1 -1
  73. data/lib/metaschema.rb +4 -4
  74. metadata +9 -6
@@ -1,13 +1,15 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "markup_line_datatype"
4
- require_relative "property_type"
5
- require_relative "remarks_type"
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: -> { "ERROR" }
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 "TargetedHasCardinalityConstraintType"
21
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
22
+ root 'TargetedHasCardinalityConstraintType'
23
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
22
24
 
23
- map_attribute "id", to: :id
24
- map_attribute "level", to: :level
25
- map_attribute "target", to: :target
26
- map_attribute "min-occurs", to: :min_occurs
27
- map_attribute "max-occurs", to: :max_occurs
28
- map_element "formal-name", to: :formal_name
29
- map_element "description", to: :description
30
- map_element "prop", to: :prop
31
- map_element "remarks", to: :remarks
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
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "key_field"
4
- require_relative "markup_line_datatype"
5
- require_relative "property_type"
6
- require_relative "remarks_type"
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: -> { "ERROR" }
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 "TargetedIndexConstraintType"
22
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
23
+ root 'TargetedIndexConstraintType'
24
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
23
25
 
24
- map_attribute "id", to: :id
25
- map_attribute "level", to: :level
26
- map_attribute "target", to: :target
27
- map_attribute "name", to: :name
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
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
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "key_field"
4
- require_relative "markup_line_datatype"
5
- require_relative "property_type"
6
- require_relative "remarks_type"
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: -> { "ERROR" }
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 "TargetedIndexHasKeyConstraintType"
22
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
23
+ root 'TargetedIndexHasKeyConstraintType'
24
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
23
25
 
24
- map_attribute "id", to: :id
25
- map_attribute "level", to: :level
26
- map_attribute "name", to: :name
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
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
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "key_field"
4
- require_relative "markup_line_datatype"
5
- require_relative "property_type"
6
- require_relative "remarks_type"
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: -> { "ERROR" }
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 "TargetedKeyConstraintType"
21
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
22
+ root 'TargetedKeyConstraintType'
23
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
22
24
 
23
- map_attribute "id", to: :id
24
- map_attribute "level", to: :level
25
- map_attribute "target", to: :target
26
- map_element "formal-name", to: :formal_name
27
- map_element "description", to: :description
28
- map_element "prop", to: :prop
29
- map_element "key-field", to: :key_field
30
- map_element "remarks", to: :remarks
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
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "markup_line_datatype"
4
- require_relative "property_type"
5
- require_relative "remarks_type"
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: -> { "ERROR" }
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 "TargetedMatchesConstraintType"
21
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
22
+ root 'TargetedMatchesConstraintType'
23
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
22
24
 
23
- map_attribute "id", to: :id
24
- map_attribute "level", to: :level
25
- map_attribute "regex", to: :regex
26
- map_attribute "datatype", to: :datatype
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 "remarks", to: :remarks
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
- require "lutaml/model"
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 "UseNameType"
10
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
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 "index", to: :index
15
+ map_attribute 'index', to: :index
14
16
  end
15
17
  end
16
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Metaschema
4
- VERSION = "0.1.0"
4
+ VERSION = '0.1.1'
5
5
  end
data/lib/metaschema.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
3
+ require 'lutaml/model'
4
4
 
5
5
  Lutaml::Model::Config.configure do |config|
6
- require "lutaml/model/xml_adapter/nokogiri_adapter"
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 "metaschema/version"
11
- require_relative "metaschema/root"
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.0
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-19 00:00:00.000000000 Z
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.5.11
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: []