sts 0.2.0 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29fa738a2be8fa8ad9b9deac71cf0ff7e6e84fdb4f6fdeef1cc7695b4eb0848d
4
- data.tar.gz: 3b2538ea0daeca072954ff6ff95c78ed43da784024de3151c6fc8ffca47fb552
3
+ metadata.gz: 53893d88ea3c686e0c78692259ffd84b95ed767ed288f325d071cd29bd959680
4
+ data.tar.gz: 249dad626f684d0e7d8e069ee6e97a21beccb4152373c7f0261593bb4cf10185
5
5
  SHA512:
6
- metadata.gz: 2cc9dc6d6365b1c8bc92ba833a9064bf1e2e4961bad763655eaecf2ccdaa872622755a27308d292491b5a5b3803b74803630e944f86c21331eb11821ed47143b
7
- data.tar.gz: 928162548cc113a5438b997c6b8ea208d91858b446e663a70ffacb7f7a16886fdf12cd21f8de2039b50e6ee21ca539b62e7667f973132b5edd47504e4aaa7f63
6
+ metadata.gz: a97fc37e13758ee81ca7a09470b53d911c332d3881e10e60c5d13b29b4d4b1fe0c419c0ca4c3b6c79e660c7330cf42b8d78387acaae33009a5709b6b05cf614a
7
+ data.tar.gz: 339ab9c2b2bcad8ed9f0563c4a9af87738f060e7721a409b8cbc22f8ab26d5d090efddffcb95a1d029c0019b7a6edc787807cadefaf190ca2d7921a2f93b5bfc
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "standard"
4
+ require_relative "adoption_front"
5
+
6
+ module Sts
7
+ module NisoSts
8
+ class Adoption < Sts::Mapper
9
+ attribute :front, AdoptionFront
10
+ attribute :back, Back
11
+ attribute :id, Shale::Type::String
12
+ attribute :lang, Shale::Type::String
13
+ attribute :adoptions, Adoption, collection: true
14
+ attribute :standard, Standard
15
+
16
+ xml do
17
+ root "adoption"
18
+
19
+ map_attribute "id", to: :id
20
+ map_attribute "lang", to: :lang,
21
+ namespace: "http://www.w3.org/XML/1998/namespace",
22
+ prefix: "xml"
23
+ map_element "adoption-front", to: :front
24
+ map_element "back", to: :back
25
+ map_element "adoption", to: :adoptions
26
+ map_element "standard", to: :standard
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "front"
4
+
5
+ module Sts
6
+ module NisoSts
7
+ class AdoptionFront < Front
8
+ xml do
9
+ root "adoption-front"
10
+ map_element "iso-meta", to: :iso_meta
11
+ map_element "std-meta", to: :std_meta
12
+ map_element "sec", to: :sec
13
+ end
14
+ end
15
+ end
16
+ end
@@ -11,7 +11,7 @@ module Sts
11
11
 
12
12
  xml do
13
13
  root "custom-meta-group"
14
- map_attribute "custom-meta", to: :custom_meta
14
+ map_element "custom-meta", to: :custom_meta
15
15
  end
16
16
  end
17
17
  end
@@ -4,11 +4,10 @@ require_relative "../mapper"
4
4
 
5
5
  require_relative "metadata_iso"
6
6
  require_relative "metadata_std"
7
+ require_relative "section"
7
8
 
8
9
  module Sts
9
10
  module NisoSts
10
- class Section < Sts::Mapper; end
11
-
12
11
  class Front < Sts::Mapper
13
12
  attribute :iso_meta, MetadataIso
14
13
  attribute :std_meta, MetadataStd
@@ -8,12 +8,16 @@ module Sts
8
8
  module NisoSts
9
9
  class NonNormativeNote < Sts::Mapper
10
10
  attribute :id, Shale::Type::String
11
+ attribute :content_type, Shale::Type::String
11
12
  attribute :p, Paragraph
12
13
  attribute :label, Shale::Type::String
13
14
 
14
15
  xml do
15
16
  root "non-normative-note"
17
+
18
+ map_attribute "content-type", to: :content_type
16
19
  map_attribute "id", to: :id
20
+
17
21
  map_element "p", to: :p
18
22
  map_element "label", to: :label
19
23
  end
@@ -13,12 +13,6 @@ require_relative "title"
13
13
 
14
14
  require_relative "../tbx_iso_tml/table_wrap"
15
15
 
16
- module Sts
17
- module TbxIsoTml
18
- class TableWrap < Sts::Mapper; end
19
- end
20
- end
21
-
22
16
  module Sts
23
17
  module NisoSts
24
18
  class Title < Sts::Mapper; end
@@ -39,7 +33,7 @@ module Sts
39
33
  attribute :figures, Figure, collection: true
40
34
  attribute :fig, Figure, collection: true
41
35
 
42
- attribute :table_wrap, Sts::TbxIsoTml::TableWrap, collection: true
36
+ attribute :table_wrap, ::Sts::TbxIsoTml::TableWrap, collection: true
43
37
 
44
38
  xml do
45
39
  root "sec"
@@ -48,7 +42,7 @@ module Sts
48
42
  map_attribute "sec-type", to: :type
49
43
  map_attribute "specific-use", to: :specific_use
50
44
 
51
- map_element "label", to: :label
45
+ map_element "label", to: :label, render_nil: true
52
46
  map_element "title", to: :title
53
47
  map_element "p", to: :paragraphs
54
48
  map_element "sec", to: :sec
@@ -3,14 +3,34 @@
3
3
  require_relative "../mapper"
4
4
 
5
5
  require_relative "reference_list"
6
+ require_relative "reference_standard"
6
7
 
7
8
  module Sts
8
9
  module NisoSts
10
+ class TitleFull < Sts::Mapper
11
+ attribute :content, Shale::Type::String
12
+ attribute :std, ReferenceStandard
13
+
14
+ xml do
15
+ root "full"
16
+ map_content to: :content
17
+ map_element "std", to: :std, namespace: nil, prefix: nil
18
+ end
19
+ end
20
+
21
+ class TitleCompl < TitleFull
22
+ xml do
23
+ root "compl"
24
+ map_content to: :content
25
+ map_element "std", to: :std, namespace: nil, prefix: nil
26
+ end
27
+ end
28
+
9
29
  class TitleWrap < Sts::Mapper
10
30
  attribute :intro, Shale::Type::String
11
31
  attribute :main, Shale::Type::String
12
- attribute :full, Shale::Type::String
13
- attribute :compl, Shale::Type::String
32
+ attribute :full, TitleFull
33
+ attribute :compl, TitleCompl
14
34
  attribute :lang, Shale::Type::String
15
35
 
16
36
  xml do
data/lib/sts/niso_sts.rb CHANGED
@@ -18,5 +18,7 @@ require_relative "niso_sts/reference_list"
18
18
  require_relative "niso_sts/reference_standard"
19
19
  require_relative "niso_sts/section"
20
20
  require_relative "niso_sts/standard"
21
+ require_relative "niso_sts/adoption"
22
+ require_relative "niso_sts/adoption_front"
21
23
  require_relative "niso_sts/term_display"
22
24
  require_relative "niso_sts/term_section"
@@ -5,18 +5,19 @@ require_relative "../mapper"
5
5
  require_relative "table"
6
6
  require_relative "table_wrap_foot"
7
7
 
8
- require_relative "../niso_sts/caption"
9
-
10
8
  module Sts
11
9
  module TbxIsoTml
12
10
  class TableWrap < Sts::Mapper
13
11
  attribute :id, Shale::Type::String
14
12
  attribute :orientation, Shale::Type::String
15
13
  attribute :label, Shale::Type::String
16
- attribute :caption, Sts::NisoSts::Caption
17
14
  attribute :table, Sts::TbxIsoTml::Table, collection: true
18
15
  attribute :table_wrap_foot, Sts::TbxIsoTml::TableWrapFoot
19
16
 
17
+ # TODO: This require will cause a loop when defined in header
18
+ require_relative "../niso_sts/caption"
19
+ attribute :caption, Sts::NisoSts::Caption
20
+
20
21
  xml do
21
22
  root "table-wrap"
22
23
 
@@ -24,7 +24,7 @@ module Sts
24
24
  attribute :colspan, Shale::Type::String
25
25
  attribute :rowspan, Shale::Type::String
26
26
  attribute :valign, Shale::Type::String
27
- attribute :inline_formula, Sts::NisoSts::InlineFormula
27
+ attribute :inline_formula, Sts::NisoSts::InlineFormula, collection: true
28
28
  attribute :non_normative_note, Sts::NisoSts::NonNormativeNote
29
29
  attribute :list, Sts::NisoSts::List
30
30
  attribute :xref, Xref
data/lib/sts/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sts
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-10 00:00:00.000000000 Z
11
+ date: 2024-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description:
41
+ description:
42
42
  email:
43
43
  - open.source@ribose.com
44
44
  executables: []
@@ -57,6 +57,8 @@ files:
57
57
  - lib/sts.rb
58
58
  - lib/sts/mapper.rb
59
59
  - lib/sts/niso_sts.rb
60
+ - lib/sts/niso_sts/adoption.rb
61
+ - lib/sts/niso_sts/adoption_front.rb
60
62
  - lib/sts/niso_sts/app.rb
61
63
  - lib/sts/niso_sts/app_group.rb
62
64
  - lib/sts/niso_sts/back.rb
@@ -160,7 +162,7 @@ metadata:
160
162
  homepage_uri: https://github.com/metanorma/sts-ruby
161
163
  source_code_uri: https://github.com/metanorma/sts-ruby
162
164
  bug_tracker_uri: https://github.com/metanorma/sts-ruby/issues
163
- post_install_message:
165
+ post_install_message:
164
166
  rdoc_options: []
165
167
  require_paths:
166
168
  - lib
@@ -175,8 +177,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
177
  - !ruby/object:Gem::Version
176
178
  version: '0'
177
179
  requirements: []
178
- rubygems_version: 3.4.10
179
- signing_key:
180
+ rubygems_version: 3.3.27
181
+ signing_key:
180
182
  specification_version: 4
181
183
  summary: Library to work with NISO STS and ISOSTS.
182
184
  test_files: []