sts 0.3.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53893d88ea3c686e0c78692259ffd84b95ed767ed288f325d071cd29bd959680
4
- data.tar.gz: 249dad626f684d0e7d8e069ee6e97a21beccb4152373c7f0261593bb4cf10185
3
+ metadata.gz: 3878043fa422f182a16489bf53b740967591ad3effa6191be2ffbbbfa285b715
4
+ data.tar.gz: 4e38a43e0368b58e456dbd2a5a96c6874ada800da08d5af4721ec08d41bfd001
5
5
  SHA512:
6
- metadata.gz: a97fc37e13758ee81ca7a09470b53d911c332d3881e10e60c5d13b29b4d4b1fe0c419c0ca4c3b6c79e660c7330cf42b8d78387acaae33009a5709b6b05cf614a
7
- data.tar.gz: 339ab9c2b2bcad8ed9f0563c4a9af87738f060e7721a409b8cbc22f8ab26d5d090efddffcb95a1d029c0019b7a6edc787807cadefaf190ca2d7921a2f93b5bfc
6
+ metadata.gz: badf2e28603cd492996e3ad9872fad39a2dc75034e5b14fd5ad240b6043c0e9421606f0a5655ea25e4e5d79306a3bf42af15b7aec0d3e5a24c93054cadec61d4
7
+ data.tar.gz: d6e027a704baa902bb0dc1f8982a06d45b232fb7c63bf6cfa4bea036007007147fcc34f0d3887a2c9ea96cf54bc87f0142b69346d3afcc0cbdd6ed00d7fbca23
data/Gemfile CHANGED
@@ -16,3 +16,5 @@ gem "rubocop", "~> 1.21"
16
16
  gem "rubocop-performance", "~> 1.19"
17
17
 
18
18
  gem "equivalent-xml", "~> 0.6"
19
+
20
+ gem "xml-c14n"
@@ -11,6 +11,7 @@ module Sts
11
11
 
12
12
  xml do
13
13
  root "custom-meta-group"
14
+
14
15
  map_element "custom-meta", to: :custom_meta
15
16
  end
16
17
  end
@@ -6,6 +6,7 @@ module Sts
6
6
  module NisoSts
7
7
  class ExtLink < Sts::Mapper
8
8
  attribute :ext_link_type, Shale::Type::String
9
+ attribute :href, Shale::Type::String
9
10
  attribute :content, Shale::Type::String
10
11
 
11
12
  xml do
@@ -14,6 +15,9 @@ module Sts
14
15
  map_content to: :content
15
16
 
16
17
  map_attribute "ext-link-type", to: :ext_link_type
18
+ map_attribute "href", to: :href,
19
+ namespace: "http://www.w3.org/1999/xlink",
20
+ prefix: "xlink"
17
21
  end
18
22
  end
19
23
  end
@@ -2,13 +2,14 @@
2
2
 
3
3
  require_relative "../mapper"
4
4
 
5
+ require_relative "label"
5
6
  require_relative "paragraph"
6
7
 
7
8
  module Sts
8
9
  module NisoSts
9
10
  class Fn < Sts::Mapper
10
11
  attribute :id, Shale::Type::String
11
- attribute :label, Shale::Type::String
12
+ attribute :label, Label
12
13
  attribute :paragraph, Paragraph
13
14
 
14
15
  xml do
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "../tbx_iso_tml/sup"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class Label < Sts::Mapper
10
+ attribute :content, Shale::Type::String
11
+ attribute :sup, Sts::TbxIsoTml::Sup
12
+
13
+ xml do
14
+ root "label"
15
+
16
+ map_content to: :content
17
+ map_element "sup", to: :sup
18
+ end
19
+ end
20
+ end
21
+ end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative "../mapper"
4
4
  require_relative "list"
5
+ require_relative "non_normative_example"
5
6
 
6
7
  module Sts
7
8
  module NisoSts
@@ -10,15 +11,17 @@ module Sts
10
11
 
11
12
  class ListItem < Sts::Mapper
12
13
  attribute :label, Shale::Type::String
13
- attribute :p, Sts::NisoSts::Paragraph
14
14
  attribute :list, List
15
+ attribute :non_normative_example, NonNormativeExample
16
+ attribute :p, Sts::NisoSts::Paragraph
15
17
 
16
18
  xml do
17
19
  root "list-item"
18
20
 
19
21
  map_element :label, to: :label
20
- map_element :p, to: :p
21
22
  map_element :list, to: :list
23
+ map_element "non-normative-example", to: :non_normative_example
24
+ map_element :p, to: :p
22
25
  end
23
26
  end
24
27
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ module Sts
6
+ module NisoSts
7
+ class MetaDate < Sts::Mapper
8
+ attribute :content, Shale::Type::String
9
+ attribute :type, Shale::Type::String
10
+
11
+ xml do
12
+ root "meta-date"
13
+
14
+ map_content to: :content
15
+
16
+ map_attribute :type, to: :type
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,40 +1,56 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "../mapper"
4
- require_relative "title_wrap"
4
+
5
+ require_relative "custom_meta_group"
5
6
  require_relative "document_identification"
7
+ require_relative "meta_date"
8
+ require_relative "page_count"
9
+ require_relative "permissions"
6
10
  require_relative "standard_identification"
7
11
  require_relative "standard_ref"
8
- require_relative "page_count"
12
+ require_relative "std_cross_reference"
13
+ require_relative "title_wrap"
9
14
 
10
15
  module Sts
11
16
  module NisoSts
12
17
  class MetadataIso < Sts::Mapper
13
- attribute :title_wrap, TitleWrap
18
+ attribute :comm_ref, Shale::Type::String
14
19
  attribute :content_language, Shale::Type::String
15
- attribute :std_ident, StandardIdentification
20
+ attribute :custom_meta_group, CustomMetaGroup
16
21
  attribute :doc_ident, DocumentIdentification
17
- attribute :std_ref, StandardRef
18
22
  attribute :doc_ref, Shale::Type::String
23
+ attribute :ics, Shale::Type::String
24
+ attribute :meta_date, MetaDate
25
+ attribute :page_count, PageCount
26
+ attribute :permissions, Permissions
19
27
  attribute :pub_date, Shale::Type::String
20
28
  attribute :release_date, Shale::Type::String
21
- attribute :comm_ref, Shale::Type::String
22
29
  attribute :secretariat, Shale::Type::String
23
- attribute :page_count, PageCount
30
+ attribute :std_ident, StandardIdentification
31
+ attribute :std_ref, StandardRef
32
+ attribute :std_xref, StdCrossReference
33
+ attribute :title_wrap, TitleWrap
24
34
 
25
35
  xml do
26
36
  root "iso-meta"
27
- map_element "title-wrap", to: :title_wrap
37
+
38
+ map_element "comm-ref", to: :comm_ref
28
39
  map_element "content-language", to: :content_language
29
- map_element "std-ident", to: :std_ident
40
+ map_element "custom-meta-group", to: :custom_meta_group
30
41
  map_element "doc-ident", to: :doc_ident
31
- map_element "std-ref", to: :std_ref
32
42
  map_element "doc-ref", to: :doc_ref
43
+ map_element "ics", to: :ics
44
+ map_element "meta-date", to: :meta_date
45
+ map_element "page-count", to: :page_count
46
+ map_element "permissions", to: :permissions
33
47
  map_element "pub-date", to: :pub_date
34
48
  map_element "release-date", to: :release_date
35
- map_element "comm-ref", to: :comm_ref
36
49
  map_element "secretariat", to: :secretariat
37
- map_element "page-count", to: :page_count
50
+ map_element "std-ident", to: :std_ident
51
+ map_element "std-ref", to: :std_ref
52
+ map_element "std-xref", to: :std_xref
53
+ map_element "title-wrap", to: :title_wrap
38
54
  end
39
55
  end
40
56
  end
@@ -35,7 +35,9 @@ module Sts
35
35
 
36
36
  xml do
37
37
  root "std-meta"
38
+
38
39
  map_attribute "id", to: :id
40
+
39
41
  map_element "title-wrap", to: :title_wrap
40
42
  map_element "content-language", to: :content_language
41
43
  map_element "std-ident", to: :std_ident
@@ -10,6 +10,8 @@ module Sts
10
10
  class MixedCitation < Sts::Mapper
11
11
  attribute :content, Shale::Type::String
12
12
  attribute :bold, Shale::Type::String
13
+ attribute :italic, Shale::Type::String
14
+ attribute :publication_type, Shale::Type::String
13
15
  attribute :std, ReferenceStandard
14
16
  attribute :ext_link, ExtLink
15
17
 
@@ -18,7 +20,10 @@ module Sts
18
20
 
19
21
  map_content to: :content
20
22
 
23
+ map_attribute "publication-type", to: :publication_type
24
+
21
25
  map_element "bold", to: :bold
26
+ map_element "italic", to: :italic
22
27
  map_element "std", to: :std
23
28
  map_element "ext-link", to: :ext_link
24
29
  end
@@ -6,6 +6,8 @@ require_relative "paragraph"
6
6
 
7
7
  module Sts
8
8
  module NisoSts
9
+ class Paragraph < Sts::Mapper; end
10
+
9
11
  class NonNormativeExample < Sts::Mapper
10
12
  attribute :id, Shale::Type::String
11
13
  attribute :p, Paragraph
@@ -13,6 +15,7 @@ module Sts
13
15
 
14
16
  xml do
15
17
  root "non-normative-example"
18
+
16
19
  map_attribute "id", to: :id
17
20
  map_element "p", to: :p
18
21
  map_element "label", to: :label
@@ -9,17 +9,21 @@ require_relative "def_list"
9
9
  require_relative "non_normative_note"
10
10
  require_relative "non_normative_example"
11
11
  require_relative "reference_standard"
12
+ require_relative "ext_link"
13
+ require_relative "../tbx_iso_tml/entailed_term"
12
14
  require_relative "../tbx_iso_tml/xref"
13
15
 
14
16
  module Sts
15
17
  module NisoSts
16
18
  class NonNormativeNote < Sts::Mapper; end
19
+ class ReferenceStandard < Sts::Mapper; end
17
20
 
18
21
  class Paragraph < Sts::Mapper
19
22
  attribute :id, Shale::Type::String
20
23
  attribute :text, Shale::Type::String
21
24
  attribute :italic, Shale::Type::String
22
25
  attribute :bold, Shale::Type::String
26
+ attribute :uri, Shale::Type::String
23
27
  attribute :list, Sts::NisoSts::List
24
28
  attribute :def_list, DefList
25
29
  attribute :non_normative_note, NonNormativeNote
@@ -28,6 +32,8 @@ module Sts
28
32
  attribute :disp_formula, Sts::NisoSts::DisplayFormula, collection: true
29
33
  attribute :xref, TbxIsoTml::Xref
30
34
  attribute :std, ReferenceStandard
35
+ attribute :ext_link, ExtLink
36
+ attribute :entailed_term, Sts::TbxIsoTml::EntailedTerm
31
37
 
32
38
  xml do
33
39
  root "p"
@@ -42,6 +48,11 @@ module Sts
42
48
  map_element "non-normative-example", to: :non_normative_example
43
49
  map_element "inline-formula", to: :inline_formula
44
50
  map_element "disp-formula", to: :disp_formula
51
+ map_element "ext-link", to: :ext_link
52
+ map_element "entailedTerm", to: :entailed_term,
53
+ namespace: "urn:iso:std:iso:30042:ed-1",
54
+ prefix: "tbx"
55
+ map_element "uri", to: :uri
45
56
  map_element "std", to: :std, namespace: nil, prefix: nil
46
57
  map_element "xref", to: :xref, namespace: nil, prefix: nil
47
58
  end
@@ -3,6 +3,7 @@
3
3
  require_relative "../mapper"
4
4
  require_relative "standard_ref"
5
5
  require_relative "std_id_group"
6
+ require_relative "fn"
6
7
  require_relative "../tbx_iso_tml/xref"
7
8
 
8
9
  module Sts
@@ -13,6 +14,7 @@ module Sts
13
14
  attribute :content, Shale::Type::String
14
15
  attribute :std_ref, StandardRef
15
16
  attribute :title, Shale::Type::String
17
+ attribute :fn, Fn, collection: true
16
18
  attribute :std_id_group, StdIdGroup, collection: true
17
19
  attribute :xref, Sts::TbxIsoTml::Xref, collection: true
18
20
 
@@ -21,7 +23,9 @@ module Sts
21
23
 
22
24
  map_attribute "type", to: :type
23
25
  map_attribute "std-id", to: :std_id
26
+
24
27
  map_element "std-ref", to: :std_ref, namespace: nil, prefix: nil
28
+ map_element "fn", to: :fn, namespace: nil, prefix: nil
25
29
  map_element "title", to: :title, namespace: nil, prefix: nil
26
30
  map_element "std-id-group", to: :std_id_group,
27
31
  namespace: nil,
@@ -10,6 +10,7 @@ require_relative "non_normative_note"
10
10
  require_relative "non_normative_example"
11
11
  require_relative "figure"
12
12
  require_relative "title"
13
+ require_relative "section_array"
13
14
 
14
15
  require_relative "../tbx_iso_tml/table_wrap"
15
16
 
@@ -23,6 +24,7 @@ module Sts
23
24
  attribute :label, Shale::Type::String
24
25
  attribute :title, Title
25
26
  attribute :type, Shale::Type::String
27
+ attribute :array, SectionArray
26
28
  attribute :paragraphs, Paragraph, collection: true
27
29
  attribute :list, List, collection: true
28
30
  attribute :term_sec, TermSection, collection: true
@@ -51,6 +53,7 @@ module Sts
51
53
  map_element "figure", to: :figures
52
54
  map_element "fig", to: :fig
53
55
  map_element "ref-list", to: :ref_list
56
+ map_element "array", to: :array
54
57
  map_element "table-wrap", to: :table_wrap
55
58
  map_element "non-normative-note", to: :non_normative_note
56
59
  map_element "non-normative-example", to: :non_normative_example
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "../tbx_iso_tml/table"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class SectionArray < Sts::Mapper
10
+ attribute :id, Shale::Type::String
11
+ attribute :table, Sts::TbxIsoTml::Table
12
+
13
+ xml do
14
+ root "array"
15
+
16
+ map_attribute "id", to: :id
17
+ map_element "table", to: :table
18
+ end
19
+ end
20
+ end
21
+ end
@@ -9,7 +9,8 @@ module Sts
9
9
  attribute :std_ref, StandardRef, collection: true
10
10
 
11
11
  xml do
12
- root "iso-meta"
12
+ root "std-xref"
13
+
13
14
  map_attribute "type", to: :type
14
15
  map_element "std-ref", to: :std_ref
15
16
  end
@@ -15,6 +15,7 @@ module Sts
15
15
  attribute :border, Shale::Type::String
16
16
  attribute :rules, Shale::Type::String
17
17
  attribute :frame, Shale::Type::String
18
+ attribute :width, Shale::Type::String
18
19
 
19
20
  xml do
20
21
  root "table"
@@ -22,6 +23,7 @@ module Sts
22
23
  map_attribute "border", to: :border
23
24
  map_attribute "rules", to: :rules
24
25
  map_attribute "frame", to: :frame
26
+ map_attribute "width", to: :width
25
27
 
26
28
  map_element "col", to: :col
27
29
  map_element "thead", to: :thead
@@ -10,6 +10,7 @@ module Sts
10
10
  class TableWrap < Sts::Mapper
11
11
  attribute :id, Shale::Type::String
12
12
  attribute :orientation, Shale::Type::String
13
+ attribute :position, Shale::Type::String
13
14
  attribute :label, Shale::Type::String
14
15
  attribute :table, Sts::TbxIsoTml::Table, collection: true
15
16
  attribute :table_wrap_foot, Sts::TbxIsoTml::TableWrapFoot
@@ -23,6 +24,8 @@ module Sts
23
24
 
24
25
  map_attribute "id", to: :id
25
26
  map_attribute "orientation", to: :orientation
27
+ map_attribute "position", to: :position
28
+
26
29
  map_element "label", to: :label
27
30
  map_element "caption", to: :caption
28
31
  map_element "table", to: :table
@@ -10,12 +10,15 @@ require_relative "../niso_sts/inline_formula"
10
10
  require_relative "../niso_sts/non_normative_note"
11
11
  require_relative "../niso_sts/graphic"
12
12
  require_relative "../niso_sts/def_list"
13
+ require_relative "../niso_sts/paragraph"
13
14
 
14
15
  module Sts
15
16
  module TbxIsoTml
16
17
  class Td < Sts::Mapper
17
18
  attribute :content, Shale::Type::String
18
19
  attribute :align, Shale::Type::String
20
+ attribute :scope, Shale::Type::String
21
+ attribute :style, Shale::Type::String
19
22
  attribute :bold, Bold
20
23
  attribute :italic, Italic
21
24
  attribute :content_type, Shale::Type::String
@@ -31,6 +34,7 @@ module Sts
31
34
  attribute :std, Sts::NisoSts::ReferenceStandard
32
35
  attribute :graphic, Sts::NisoSts::Graphic
33
36
  attribute :def_list, Sts::NisoSts::DefList
37
+ attribute :paragraph, Sts::NisoSts::Paragraph
34
38
 
35
39
  xml do
36
40
  root "tr"
@@ -38,6 +42,8 @@ module Sts
38
42
  map_content to: :content
39
43
 
40
44
  map_attribute "align", to: :align
45
+ map_attribute "scope", to: :scope
46
+ map_attribute "style", to: :style
41
47
  map_attribute "content-type", to: :content_type
42
48
  map_attribute "char", to: :char
43
49
  map_attribute "charoff", to: :charoff
@@ -54,6 +60,7 @@ module Sts
54
60
  map_element "non-normative-note", to: :non_normative_note
55
61
  map_element "graphic", to: :graphic
56
62
  map_element "def-list", to: :def_list
63
+ map_element "p", to: :paragraph
57
64
  end
58
65
  end
59
66
  end
@@ -14,6 +14,8 @@ module Sts
14
14
  attribute :content, Shale::Type::String
15
15
  attribute :colspan, Shale::Type::String
16
16
  attribute :align, Shale::Type::String
17
+ attribute :scope, Shale::Type::String
18
+ attribute :style, Shale::Type::String
17
19
  attribute :rowspan, Shale::Type::String
18
20
  attribute :break, Shale::Type::String
19
21
  attribute :content_type, Shale::Type::String
@@ -32,6 +34,8 @@ module Sts
32
34
  map_content to: :content
33
35
  map_attribute "colspan", to: :colspan
34
36
  map_attribute "align", to: :align
37
+ map_attribute "scope", to: :scope
38
+ map_attribute "style", to: :style
35
39
  map_attribute "rowspan", to: :rowspan
36
40
  map_attribute "content-type", to: :content_type
37
41
  map_attribute "char", to: :char
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.3.0"
4
+ VERSION = "0.3.1"
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.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-14 00:00:00.000000000 Z
11
+ date: 2024-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -78,8 +78,10 @@ files:
78
78
  - lib/sts/niso_sts/front.rb
79
79
  - lib/sts/niso_sts/graphic.rb
80
80
  - lib/sts/niso_sts/inline_formula.rb
81
+ - lib/sts/niso_sts/label.rb
81
82
  - lib/sts/niso_sts/list.rb
82
83
  - lib/sts/niso_sts/list_item.rb
84
+ - lib/sts/niso_sts/meta_date.rb
83
85
  - lib/sts/niso_sts/meta_note.rb
84
86
  - lib/sts/niso_sts/metadata_iso.rb
85
87
  - lib/sts/niso_sts/metadata_std.rb
@@ -94,6 +96,7 @@ files:
94
96
  - lib/sts/niso_sts/reference_list.rb
95
97
  - lib/sts/niso_sts/reference_standard.rb
96
98
  - lib/sts/niso_sts/section.rb
99
+ - lib/sts/niso_sts/section_array.rb
97
100
  - lib/sts/niso_sts/standard.rb
98
101
  - lib/sts/niso_sts/standard_identification.rb
99
102
  - lib/sts/niso_sts/standard_ref.rb