isodoc 0.9.8 → 0.9.9
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/.rubocop.yml +2 -7
- data/Gemfile.lock +5 -5
- data/lib/isodoc/function/utils.rb +2 -3
- data/lib/isodoc/metadata.rb +2 -16
- data/lib/isodoc/version.rb +1 -1
- data/spec/isodoc/metadata_spec.rb +5 -9
- data/spec/isodoc/postproc_spec.rb +3 -3
- 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: fd17ce9e2842e1e5407c0be58735af16398e4ab1a73d6cd93bfc5fb3d85039cc
|
|
4
|
+
data.tar.gz: 271c0ac77d8d5b4d87524b4905716ca01445921039b13758aea8e2279cc0f929
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 06a8d496129ea43dc7ef263466801ff47710c824e6ca3cdc9d9038d8408febecb04672f851d1c7be187736813ea6ac92d5241d809e93577abc538bcd9c8f76a7
|
|
7
|
+
data.tar.gz: 0ec8c4fc83f1fe12dfe02f58b0f3e3f96d03ee616bc26ab8558f946e2db107e5aba7814cd426edafe79e100ba2a856db46b31487b1631e4b5be6efe0dea024ee
|
data/.rubocop.yml
CHANGED
|
@@ -3,13 +3,8 @@
|
|
|
3
3
|
# All project-specific additions and overrides should be specified in this file.
|
|
4
4
|
|
|
5
5
|
inherit_from:
|
|
6
|
-
|
|
7
|
-
- ".rubocop.tb.yml"
|
|
8
|
-
# Overrides from Ribose
|
|
9
|
-
- ".rubocop.ribose.yml"
|
|
6
|
+
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
|
10
7
|
AllCops:
|
|
11
|
-
|
|
12
|
-
StyleGuideCopsOnly: false
|
|
13
|
-
TargetRubyVersion: 2.4
|
|
8
|
+
TargetRubyVersion: 2.3
|
|
14
9
|
Rails:
|
|
15
10
|
Enabled: true
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
isodoc (0.9.
|
|
4
|
+
isodoc (0.9.9)
|
|
5
5
|
asciimath
|
|
6
6
|
html2doc (~> 0.8.6)
|
|
7
7
|
htmlentities (~> 4.3.4)
|
|
@@ -62,7 +62,7 @@ GEM
|
|
|
62
62
|
ruby_dep (~> 1.2)
|
|
63
63
|
lumberjack (1.0.13)
|
|
64
64
|
metanorma (0.3.0)
|
|
65
|
-
method_source (0.9.
|
|
65
|
+
method_source (0.9.2)
|
|
66
66
|
mime-types (3.2.2)
|
|
67
67
|
mime-types-data (~> 3.2015)
|
|
68
68
|
mime-types-data (3.2018.0812)
|
|
@@ -77,7 +77,7 @@ GEM
|
|
|
77
77
|
parser (2.5.3.0)
|
|
78
78
|
ast (~> 2.4.0)
|
|
79
79
|
powerpack (0.1.2)
|
|
80
|
-
pry (0.12.
|
|
80
|
+
pry (0.12.1)
|
|
81
81
|
coderay (~> 1.1.0)
|
|
82
82
|
method_source (~> 0.9.0)
|
|
83
83
|
rainbow (3.0.0)
|
|
@@ -110,7 +110,7 @@ GEM
|
|
|
110
110
|
ruby-progressbar (1.10.0)
|
|
111
111
|
ruby-xslt (0.9.10)
|
|
112
112
|
ruby_dep (1.5.0)
|
|
113
|
-
sass (3.7.
|
|
113
|
+
sass (3.7.2)
|
|
114
114
|
sass-listen (~> 4.0.0)
|
|
115
115
|
sass-listen (4.0.0)
|
|
116
116
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
|
@@ -124,7 +124,7 @@ GEM
|
|
|
124
124
|
json (>= 1.8, < 3)
|
|
125
125
|
simplecov-html (~> 0.10.0)
|
|
126
126
|
simplecov-html (0.10.2)
|
|
127
|
-
thor (0.20.
|
|
127
|
+
thor (0.20.3)
|
|
128
128
|
thread_safe (0.3.6)
|
|
129
129
|
timecop (0.9.1)
|
|
130
130
|
unicode-display_width (1.4.0)
|
|
@@ -106,11 +106,10 @@ module IsoDoc::Function
|
|
|
106
106
|
h = h.to_s.gsub(%r{<br/>}, " ").sub(/<\/?h[12][^>]*>/, "")
|
|
107
107
|
h1 = to_xhtml_fragment(h.dup)
|
|
108
108
|
h1.traverse do |x|
|
|
109
|
+
x.replace(" ") if x.name == "span" && /mso-tab-count/.match(x["style"])
|
|
109
110
|
x.remove if x.name == "span" && x["class"] == "MsoCommentReference"
|
|
110
111
|
x.remove if x.name == "a" && x["epub:type"] == "footnote"
|
|
111
|
-
if x.name == "a"
|
|
112
|
-
x.replace(x.children)
|
|
113
|
-
end
|
|
112
|
+
x.replace(x.children) if x.name == "a"
|
|
114
113
|
end
|
|
115
114
|
from_xhtml(h1)
|
|
116
115
|
end
|
data/lib/isodoc/metadata.rb
CHANGED
|
@@ -111,16 +111,6 @@ module IsoDoc
|
|
|
111
111
|
set(:agency, agency.sub(%r{/$}, ""))
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
-
def docnumber(isoxml)
|
|
115
|
-
docnumber = isoxml.at(ns("//bibdata/docidentifier/project-number"))
|
|
116
|
-
partnumber = isoxml.at(ns("//bibdata/docidentifier/project-number/@part"))
|
|
117
|
-
subpartnumber = isoxml.at(ns("//bibdata/docidentifier/project-number/@subpart"))
|
|
118
|
-
dn = docnumber&.text || ""
|
|
119
|
-
dn += "-#{partnumber.text}" if partnumber
|
|
120
|
-
dn += "-#{subpartnumber.text}" if subpartnumber
|
|
121
|
-
dn
|
|
122
|
-
end
|
|
123
|
-
|
|
124
114
|
def docstatus(isoxml, _out)
|
|
125
115
|
docstatus = isoxml.at(ns("//bibdata/status"))
|
|
126
116
|
if docstatus
|
|
@@ -133,12 +123,8 @@ module IsoDoc
|
|
|
133
123
|
end
|
|
134
124
|
|
|
135
125
|
def docid(isoxml, _out)
|
|
136
|
-
dn =
|
|
137
|
-
|
|
138
|
-
if docstatus && docstatus != "Published"
|
|
139
|
-
dn = "#{dn} #{docstatus}"
|
|
140
|
-
end
|
|
141
|
-
set(:docnumber, dn)
|
|
126
|
+
dn = isoxml.at(ns("//bibdata/docidentifier"))
|
|
127
|
+
set(:docnumber, dn&.text)
|
|
142
128
|
end
|
|
143
129
|
|
|
144
130
|
def draftinfo(draft, revdate)
|
data/lib/isodoc/version.rb
CHANGED
|
@@ -12,10 +12,8 @@ RSpec.describe IsoDoc do
|
|
|
12
12
|
<bibdata type="international-standard">
|
|
13
13
|
<title>The Incredible Mr Ripley</title>
|
|
14
14
|
<title language="en">Cereals and pulses</title>
|
|
15
|
-
<docidentifier>
|
|
16
|
-
|
|
17
|
-
<tc-document-number>17301</tc-document-number>
|
|
18
|
-
</docidentifier>
|
|
15
|
+
<docidentifier>17301-1</docidentifier>
|
|
16
|
+
<docnumber>17301</docnumber>
|
|
19
17
|
<date type="published"><on>2011</on></date>
|
|
20
18
|
<date type="accessed"><on>2012</on></date>
|
|
21
19
|
<date type="created"><from>2010</from><to>2011</to></date>
|
|
@@ -57,7 +55,7 @@ RSpec.describe IsoDoc do
|
|
|
57
55
|
</version>
|
|
58
56
|
</iso-standard>
|
|
59
57
|
INPUT
|
|
60
|
-
{:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :confirmeddate=>"XXX", :createddate=>"2010–2011", :docnumber=>"17301-1
|
|
58
|
+
{:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :confirmeddate=>"XXX", :createddate=>"2010–2011", :docnumber=>"17301-1", :doctitle=>"Cereals and pulses", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :editorialgroup=>["TC 34", "SC 4", "WG 3"], :ics=>"XXX", :implementeddate=>"XXX", :issueddate=>"XXX", :obsoleteddate=>"2014", :obsoletes=>nil, :obsoletes_part=>nil, :publisheddate=>"2011", :revdate=>"2016-05-01", :sc=>"SC 4", :secretariat=>"GB", :status=>"Committee draft", :tc=>"TC 34", :updateddate=>"XXX", :wg=>"WG 3"}
|
|
61
59
|
OUTPUT
|
|
62
60
|
end
|
|
63
61
|
|
|
@@ -71,10 +69,8 @@ OUTPUT
|
|
|
71
69
|
<bibdata type="international-standard">
|
|
72
70
|
<title language="fr" format="text/plain">Céréales et légumineuses</ti>
|
|
73
71
|
<title language="en" format="text/plain">Cereals and pulses</title>
|
|
74
|
-
<docidentifier>
|
|
75
|
-
|
|
76
|
-
<tc-document-number>17301</tc-document-number>
|
|
77
|
-
</docidentifier>
|
|
72
|
+
<docidentifier>17301-1-3</docidentifier>
|
|
73
|
+
<docnumber>17301</docnumber>
|
|
78
74
|
<contributor>
|
|
79
75
|
<role type="author"/>
|
|
80
76
|
<organization>
|
|
@@ -370,8 +370,8 @@ Content-Location: file:///C:/Doc/test_files/header.html
|
|
|
370
370
|
Content-Transfer-Encoding: base64
|
|
371
371
|
Content-Type: text/html charset="utf-8"
|
|
372
372
|
|
|
373
|
-
|
|
374
|
-
|
|
373
|
+
Ci8qIGFuIGVtcHR5IGhlYWRlciAqLwoKU1RBUlQgRE9DIElEOiAKICAgICAgICAgICAxMDAwCiAg
|
|
374
|
+
ICAgICAgIDogRU5EIERPQyBJRAoKRklMRU5BTUU6IHRlc3QKCg==
|
|
375
375
|
|
|
376
376
|
OUTPUT
|
|
377
377
|
end
|
|
@@ -406,7 +406,7 @@ CkZJTEVOQU1FOiB0ZXN0Cgo=
|
|
|
406
406
|
<p class="MsoToc1"><span lang="EN-GB" xml:lang="EN-GB"><span style="mso-element:field-begin"></span><span style="mso-spacerun:yes"> </span>TOC
|
|
407
407
|
\o "1-2" \h \z \u <span style="mso-element:field-separator"></span></span>
|
|
408
408
|
<span class="MsoHyperlink"><span lang="EN-GB" style="mso-no-proof:yes" xml:lang="EN-GB">
|
|
409
|
-
<a href="#_Toc">1
|
|
409
|
+
<a href="#_Toc">1. Clause 4<span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">
|
|
410
410
|
<span style="mso-tab-count:1 dotted">. </span>
|
|
411
411
|
</span><span lang="EN-GB" class="MsoTocTextSpan" xml:lang="EN-GB">
|
|
412
412
|
<span style="mso-element:field-begin"></span></span>
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: isodoc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-11-
|
|
11
|
+
date: 2018-11-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: asciimath
|