metanorma-iso 2.5.4 → 2.6.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: 27078d397dbb62231ecac33bc066b23fe72a3f878144556b3856f54a9860201c
4
- data.tar.gz: 75d0a641ea5a5b968b876f67392b35498273f1b574ef0ac9560444c151b4ad3b
3
+ metadata.gz: fb4c2d0b884e8601efbd7d6d0bfa000846b52709fadbd38317e9398493ad8cd0
4
+ data.tar.gz: 8d7846f9bf8bfc5e684f66542f9ea6a166f99043edc9d982a4e61ad69b0a63a5
5
5
  SHA512:
6
- metadata.gz: d58426c8e269fa6da326020e37b5ddd72511b4dad56a1411c6a6510d358fd3a8ac67db48f29bcc1d50c2fa8df3f92f07a293da5c971a9a566ab2e46479c5c1a5
7
- data.tar.gz: f3dc0240af1378db3c923ea986c15217c146ca7b869593ccb3fb2db3594cf1fc82b9593905f73bd7864cf8551765d4ac340b130e09a725b47e23f94e6c8fcde8
6
+ metadata.gz: 40264b7b5e2b23244b502f8b0e63a9041ed06dfc6401c86ef3b418de8c38aae94187319f3e28852122b871d06e3fb122286cb575b2e0a6c3e60caaa571ccbc38
7
+ data.tar.gz: 5f0c03ecba1d00e25764620a02c345486d84b29b419d3749677810cc51672c695f4bab205cfa00d61bc01c59a4dff931209b3855912c90aeded9408c04214939
data/Gemfile CHANGED
@@ -4,10 +4,12 @@ Encoding.default_internal = Encoding::UTF_8
4
4
  source "https://rubygems.org"
5
5
  git_source(:github) { |repo| "https://github.com/#{repo}" }
6
6
 
7
- #gem "relaton", git: "https://github.com/relaton/relaton"
8
-
9
- gemspec
7
+ group :development, :test do
8
+ gem "rspec"
9
+ end
10
10
 
11
11
  if File.exist? "Gemfile.devel"
12
12
  eval File.read("Gemfile.devel"), nil, "Gemfile.devel" # rubocop:disable Security/Eval
13
13
  end
14
+
15
+ gemspec
@@ -2,7 +2,7 @@
2
2
  === {% if stage_int >= 40 %}DOCUMENT PROTÉGÉ PAR COPYRIGHT{%else%}{blank}{%endif%}
3
3
 
4
4
  [[boilerplate-year]]
5
- © span:std_publisher:[{{ agency }}] span:std_docNumber[{{ docyear }}]
5
+ © span:std_publisher:[{{ agency }}] span:std_docNumber[{{ docyear }}]
6
6
 
7
7
  [[boilerplate-message]]
8
8
  Droits de reproduction réservés. Sauf indication contraire, ou requise dans le cadre de sa mise en œuvre,
@@ -3,7 +3,7 @@
3
3
  === {% if stage_int >= 40 %}ДОКУМЕНТ, ОХРАНЯЕМЫЙ АВТОРСКИМ ПРАВОМ{% else %}{blank}{% endif %}
4
4
 
5
5
  [[boilerplate-year]]
6
- © span:std_publisher[{{ agency }}] span:std_docNumber[{{ docyear }}]
6
+ © span:std_publisher[{{ agency }}] span:std_docNumber[{{ docyear }}]
7
7
 
8
8
  [[boilerplate-message]]
9
9
  Все права защищены. Если иначе не определено или не требуется в контексте его реализации, никакая часть этой публикации не может быть воспроизведена или использована иначе в любой форме или каким-либо образом, электронным или механическим, включая фотокопирование, или публикацию в Интернете или интранете, без предварительного письменного разрешения. Разрешение может быть запрошено ISO по адресу, указанному ниже, или у органа — члена ISO страны запрашивающего.
@@ -3,7 +3,7 @@
3
3
  === {% if stage_int >= 40 %}COPYRIGHT PROTECTED DOCUMENT{% else %}{blank}{% endif %}
4
4
 
5
5
  [[boilerplate-year]]
6
- © span:std_publisher[{{ agency }}] span:std_docNumber[{{ docyear }}]
6
+ © span:std_publisher[{{ agency }}] span:std_docNumber[{{ docyear }}]
7
7
 
8
8
  [[boilerplate-message]]
9
9
  All rights reserved. Unless otherwise specified, or required in the context of its implementation,
@@ -1,7 +1,11 @@
1
1
  module Metanorma
2
2
  module ISO
3
3
  class Converter < Standoc::Converter
4
- def home_agency
4
+ # def home_agency
5
+ # "ISO"
6
+ # end
7
+
8
+ def default_publisher
5
9
  "ISO"
6
10
  end
7
11
 
@@ -11,47 +15,40 @@ module Metanorma
11
15
  end
12
16
 
13
17
  def metadata_author(node, xml)
14
- publishers = node.attr("publisher") || home_agency
15
- metadata_contrib_sdo(node, xml, publishers,
16
- { role: "author",
17
- default_org: !node.attr("publisher") })
18
- committee_contributors(node, xml, false, home_agency)
19
- end
20
-
21
- def metadata_contrib_sdo(node, xml, publishers, opt)
22
- publishers.nil? and return
23
- csv_split(publishers).each do |p|
24
- xml.contributor do |c|
25
- c.role type: opt[:role] do |r|
26
- opt[:desc] and r << opt[:desc]
27
- end
28
- c.organization do |a|
29
- (opt[:committee] and
30
- contrib_committee_build(a, opt[:agency],
31
- { name: p, id: opt[:ident] })) or
32
- organization(a, p, opt[:role] == "publisher", node,
33
- opt[:default_org])
34
- end
35
- end
36
- end
18
+ org_contributor(node, xml,
19
+ { source: ["publisher", "pub"], role: "author",
20
+ default: default_publisher })
21
+ committee_contributors(node, xml, false, default_publisher)
22
+ end
23
+
24
+ def org_organization(node, xml, org)
25
+ org[:committee] and
26
+ contrib_committee_build(xml, org[:agency], org) or
27
+ super
37
28
  end
38
29
 
39
30
  def committee_contributors(node, xml, approval, agency)
40
- types = metadata_approval_committee_types(approval ? node : nil)
41
- types.each do |v|
42
- n = node.attr("#{v}-number") or next
43
- t = committee_abbrev(node.attr("#{v}-type"), n, v)
44
- metadata_contrib_sdo(
45
- node, xml, node.attr(v),
46
- { role: approval ? "authorizer" : "author", ident: t,
47
- default_org: false, committee: true, agency: agency,
48
- desc: v.sub(/^approval-/, "").gsub("-", " ").capitalize }
49
- )
31
+ metadata_approval_committee_types(approval ? node : nil).each do |v|
32
+ node.attr("#{v}-number") or next
33
+ node.attr(v) or node.set_attr(v, "")
34
+ o = { source: [v], role: approval ? "authorizer" : "author",
35
+ default_org: false, committee: true, agency: agency,
36
+ desc: v.sub(/^approval-/, "").gsub("-", " ").capitalize }
37
+ org_contributor(node, xml, o)
50
38
  end
51
- approval and
52
- metadata_contrib_sdo(node, xml, agency,
53
- { role: "authorizer", default_org: false,
54
- desc: "Agency", committee: false })
39
+ approval or committee_contributors_approval(node, xml, agency)
40
+ end
41
+
42
+ def committee_contributors_approval(node, xml, agency)
43
+ o = { name: agency, role: "authorizer", default_org: false,
44
+ desc: "Agency", committee: false }
45
+ org_contributor(node, xml, o)
46
+ end
47
+
48
+ def extract_org_attrs_complex(node, opts, source, suffix)
49
+ n = node.attr("#{source}-number#{suffix}")
50
+ t = committee_abbrev(node.attr("#{source}-type#{suffix}"), n, source)
51
+ super.merge(ident: t).compact
55
52
  end
56
53
 
57
54
  def contrib_committee_build(xml, agency, committee)
@@ -59,7 +56,7 @@ module Metanorma
59
56
  xml.name agency
60
57
  xml.subdivision committee[:name]
61
58
  committee[:abbr] and xml.abbreviation committee[:abbr]
62
- committee[:id] and xml.identifier committee[:id]
59
+ committee[:ident] and xml.identifier committee[:ident]
63
60
  end
64
61
 
65
62
  COMMITTEE_ABBREVS =
@@ -72,32 +69,18 @@ module Metanorma
72
69
  "#{type} #{number}".strip
73
70
  end
74
71
 
72
+ def org_attrs_parse(node, opts)
73
+ super&.map do |x|
74
+ x.merge(agency: opts[:agency], abbr: opts[:abbr],
75
+ committee: opts[:committee], default_org: opts[:default_org])
76
+ end
77
+ end
78
+
75
79
  def metadata_publisher(node, xml)
76
- publishers = node.attr("publisher") || home_agency
77
- metadata_contrib_sdo(node, xml, publishers,
78
- { role: "publisher",
79
- default_org: !node.attr("publisher") })
80
+ super
80
81
  # approvals
81
82
  committee_contributors(node, xml, true,
82
- node.attr("approval-agency") || home_agency)
83
- end
84
-
85
- def metadata_copyright(node, xml)
86
- publishers = node.attr("copyright-holder") || node.attr("publisher") ||
87
- home_agency
88
- csv_split(publishers).each do |p|
89
- xml.copyright do |c|
90
- c.from (node.attr("copyright-year") || Date.today.year)
91
- c.owner do |owner|
92
- owner.organization do |o|
93
- organization(
94
- o, p, true, node,
95
- !(node.attr("copyright-holder") || node.attr("publisher"))
96
- )
97
- end
98
- end
99
- end
100
- end
83
+ node.attr("approval-agency") || default_publisher)
101
84
  end
102
85
 
103
86
  def metadata_committee(node, xml)
@@ -134,7 +117,7 @@ module Metanorma
134
117
  end
135
118
 
136
119
  def metadata_approval_agency(xml, list)
137
- list = [home_agency] if list.nil? || list.empty?
120
+ list = [default_publisher] if list.nil? || list.empty?
138
121
  list.each do |v|
139
122
  xml.agency v
140
123
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "2.5.4".freeze
3
+ VERSION = "2.6.0".freeze
4
4
  end
5
5
  end
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
33
33
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
34
34
 
35
- spec.add_dependency "metanorma-standoc", "~> 2.6.3"
35
+ spec.add_dependency "metanorma-standoc", "~> 2.7.0"
36
36
  spec.add_dependency "mnconvert", "~> 1.14"
37
37
  spec.add_dependency "pubid-iso", "~> 0.6.0"
38
38
  spec.add_dependency "ruby-jing"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.4
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-20 00:00:00.000000000 Z
11
+ date: 2023-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.6.3
19
+ version: 2.7.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.6.3
26
+ version: 2.7.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mnconvert
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -296,7 +296,6 @@ files:
296
296
  - ".rubocop.yml"
297
297
  - CODE_OF_CONDUCT.md
298
298
  - Gemfile
299
- - Gemfile.devel
300
299
  - LICENSE
301
300
  - Makefile
302
301
  - README.adoc
data/Gemfile.devel DELETED
@@ -1,3 +0,0 @@
1
- gem "metanorma-standoc", git: "https://github.com/metanorma/metanorma-standoc", branch: "main"
2
- gem "isodoc", git: "https://github.com/metanorma/isodoc", branch: "main"
3
-