metanorma-iec 0.1.7 → 1.0.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 +4 -4
- data/lib/asciidoctor/iec/converter.rb +0 -10
- data/lib/asciidoctor/iec/iec.rng +1 -1
- data/lib/isodoc/iec/metadata.rb +19 -8
- data/lib/metanorma/iec/version.rb +1 -1
- data/spec/isodoc/metadata_spec.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc93e8e07d5be4e94b78dbb0fbca3ce2d1950154566e5fa4726ebfdbdcdee9c9
|
4
|
+
data.tar.gz: 4b25cebefe0d6a9890b5e3bee62f0bc2493fef0d874a08b8b22fee5bac5318bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e3cfceb34bd1079babd73f1ee5748c3efa5eb7bf8ea41cbcb58532c447b30424284ec7c70750c3d3837b3452f8d2330f6c53742c3cea39222fabc3bedcfbd87
|
7
|
+
data.tar.gz: 38d31f9043008880da563b634031dcac86a045ba6247863eebf2cc934a780703d12b84a74bcf64d8b57862c6e7bdf9179b9cea07bedffcb262b28cb24872e3fc
|
@@ -9,16 +9,6 @@ module Asciidoctor
|
|
9
9
|
|
10
10
|
register_for "iec"
|
11
11
|
|
12
|
-
def makexml(node)
|
13
|
-
@draft = node.attributes.has_key?("draft")
|
14
|
-
#super
|
15
|
-
result = makexml1(node)
|
16
|
-
ret1 = cleanup(Nokogiri::XML(result))
|
17
|
-
ret1.root.add_namespace(nil, self.class::XML_NAMESPACE)
|
18
|
-
validate(ret1) unless @novalid
|
19
|
-
ret1
|
20
|
-
end
|
21
|
-
|
22
12
|
def metadata_author(node, xml)
|
23
13
|
publishers = node.attr("publisher") || "IEC"
|
24
14
|
publishers.split(/,[ ]?/).each do |p|
|
data/lib/asciidoctor/iec/iec.rng
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<grammar
|
2
|
+
<grammar ns="https://www.metanorma.org/ns/iec" xmlns="http://relaxng.org/ns/structure/1.0">
|
3
3
|
<!-- default namespace = "https://www.metanorma.com/ns/iec" -->
|
4
4
|
<include href="isostandard.rng">
|
5
5
|
<start>
|
data/lib/isodoc/iec/metadata.rb
CHANGED
@@ -19,7 +19,13 @@ module IsoDoc
|
|
19
19
|
"99" => {"00" => "DELPUB", "60" => "DELPUB"},
|
20
20
|
}.freeze
|
21
21
|
|
22
|
-
def
|
22
|
+
def stage_abbr(stage)
|
23
|
+
ret = STAGE_ABBRS.dig(stage, "00") || "??"
|
24
|
+
ret = "PPUB" if stage == "60"
|
25
|
+
ret
|
26
|
+
end
|
27
|
+
|
28
|
+
def status_abbrev1(stage, substage, iter, doctype, draft)
|
23
29
|
return "" unless stage
|
24
30
|
abbr = STAGE_ABBRS.dig(stage, substage) || "??"
|
25
31
|
if stage == "35" && substage == "92"
|
@@ -50,17 +56,22 @@ module IsoDoc
|
|
50
56
|
if docstatus
|
51
57
|
set(:stage, docstatus.text)
|
52
58
|
set(:stage_int, docstatus.text.to_i)
|
53
|
-
set(:unpublished, docstatus.text
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
59
|
+
set(:unpublished, unpublished(docstatus.text))
|
60
|
+
set(:statusabbr, status_abbrev1(docstatus.text,
|
61
|
+
isoxml&.at(ns("//bibdata/status/substage"))&.text,
|
62
|
+
isoxml&.at(ns("//bibdata/status/iteration"))&.text,
|
63
|
+
isoxml&.at(ns("//bibdata/ext/doctype"))&.text,
|
64
|
+
isoxml&.at(ns("//version/draft"))&.text))
|
65
|
+
unpublished(docstatus.text) and
|
66
|
+
set(:stageabbr, stage_abbr(docstatus.text))
|
60
67
|
end
|
61
68
|
revdate = isoxml.at(ns("//version/revision-date"))
|
62
69
|
set(:revdate, revdate&.text)
|
63
70
|
end
|
71
|
+
|
72
|
+
def unpublished(status)
|
73
|
+
status.to_i > 0 && status.to_i < 60
|
74
|
+
end
|
64
75
|
end
|
65
76
|
end
|
66
77
|
end
|
@@ -18,6 +18,7 @@ RSpec.describe IsoDoc::Iec::Metadata do
|
|
18
18
|
<title type="title-part" language="fr" format="text/plain">Riz</title>
|
19
19
|
<docidentifier type="iso">ISO/PreCD3 17301-1</docidentifier>
|
20
20
|
<docidentifier type="iso-tc">17301</docidentifier>
|
21
|
+
<docnumber>1730</docnumber>
|
21
22
|
<date type="published"><on>2011</on></date>
|
22
23
|
<date type="accessed"><on>2012</on></date>
|
23
24
|
<date type="created"><from>2010</from><to>2011</to></date>
|
@@ -70,7 +71,7 @@ RSpec.describe IsoDoc::Iec::Metadata do
|
|
70
71
|
</bibdata>
|
71
72
|
</iso-standard>
|
72
73
|
INPUT
|
73
|
-
{:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>[], :authors_affiliations=>{}, :createddate=>"2010–2011", :docnumber=>"ISO/PreCD3 17301-1", :docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1: Riz", :docsubtitleintro=>"Céréales et légumineuses", :docsubtitlemain=>"Spécification et méthodes d'essai", :docsubtitlepart=>"Riz", :docsubtitlepartlabel=>"Partie 1", :doctitle=>"Cereals and pulses — Specifications and test methods — Part 1: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Rice", :doctitlepartlabel=>"Part 1", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :edition=>"2", :editorialgroup=>["TC 34", "SC 4", "WG 3"], :ics=>"XXX", :obsoleteddate=>"2014", :obsoletes=>nil, :obsoletes_part=>nil, :publisheddate=>"2011", :revdate=>"2016-05-01", :sc=>"SC 4", :secretariat=>"GB", :stage=>"35", :stage_int=>35, :stageabbr=>"3CD", :tc=>"TC 34", :tc_docnumber=>["17301"], :unpublished=>true, :wg=>"WG 3"}
|
74
|
+
{:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>[], :authors_affiliations=>{}, :createddate=>"2010–2011", :docnumber=>"ISO/PreCD3 17301-1", :docnumeric=>"1730", :docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1: Riz", :docsubtitleintro=>"Céréales et légumineuses", :docsubtitlemain=>"Spécification et méthodes d'essai", :docsubtitlepart=>"Riz", :docsubtitlepartlabel=>"Partie 1", :doctitle=>"Cereals and pulses — Specifications and test methods — Part 1: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Rice", :doctitlepartlabel=>"Part 1", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :edition=>"2", :editorialgroup=>["TC 34", "SC 4", "WG 3"], :ics=>"XXX", :obsoleteddate=>"2014", :obsoletes=>nil, :obsoletes_part=>nil, :publisheddate=>"2011", :revdate=>"2016-05-01", :sc=>"SC 4", :secretariat=>"GB", :stage=>"35", :stage_int=>35, :stageabbr=>"CD", :statusabbr=>"3CD", :tc=>"TC 34", :tc_docnumber=>["17301"], :unpublished=>true, :wg=>"WG 3"}
|
74
75
|
OUTPUT
|
75
76
|
end
|
76
77
|
|
@@ -146,7 +147,7 @@ OUTPUT
|
|
146
147
|
</bibdata>
|
147
148
|
</iso-standard>
|
148
149
|
INPUT
|
149
|
-
{:agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :docnumber=>"ISO/IEC/CD 17301-1-3", :docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1–3: Riz", :docsubtitleintro=>"Céréales et légumineuses", :docsubtitlemain=>"Spécification et méthodes d'essai", :docsubtitlepart=>"Riz", :docsubtitlepartlabel=>"Partie 1–3", :doctitle=>"Cereals and pulses — Specifications and test methods — Part 1–3: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Rice", :doctitlepartlabel=>"Part 1–3", :doctype=>"Technical Report", :docyear=>"2016", :draft=>nil, :draftinfo=>"", :edition=>nil, :editorialgroup=>["ABC 34", "DEF 4", "GHI 3"], :ics=>"1.2.3, 1.2.3", :obsoletes=>"IEC 8121", :obsoletes_part=>"3.1", :revdate=>nil, :sc=>"DEF 4", :secretariat=>"XXXX", :stage=>"50", :stage_int=>50, :stageabbr=>"CFDIS", :tc=>"ABC 34", :tc_docnumber=>["17301"], :unpublished=>true, :wg=>"GHI 3"}
|
150
|
+
{:agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :docnumber=>"ISO/IEC/CD 17301-1-3", :docnumeric=>nil, :docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1–3: Riz", :docsubtitleintro=>"Céréales et légumineuses", :docsubtitlemain=>"Spécification et méthodes d'essai", :docsubtitlepart=>"Riz", :docsubtitlepartlabel=>"Partie 1–3", :doctitle=>"Cereals and pulses — Specifications and test methods — Part 1–3: Rice", :doctitleintro=>"Cereals and pulses", :doctitlemain=>"Specifications and test methods", :doctitlepart=>"Rice", :doctitlepartlabel=>"Part 1–3", :doctype=>"Technical Report", :docyear=>"2016", :draft=>nil, :draftinfo=>"", :edition=>nil, :editorialgroup=>["ABC 34", "DEF 4", "GHI 3"], :ics=>"1.2.3, 1.2.3", :obsoletes=>"IEC 8121", :obsoletes_part=>"3.1", :revdate=>nil, :sc=>"DEF 4", :secretariat=>"XXXX", :stage=>"50", :stage_int=>50, :stageabbr=>"RFDIS", :statusabbr=>"CFDIS", :tc=>"ABC 34", :tc_docnumber=>["17301"], :unpublished=>true, :wg=>"GHI 3"}
|
150
151
|
OUTPUT
|
151
152
|
end
|
152
153
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.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: 2020-02-
|
11
|
+
date: 2020-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-jing
|