isodoc 0.9.21 → 0.9.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8d6a328ec654bc09eb32877b7fdaa77eeb3a29d9801314c3217e379dd2b1ab0
4
- data.tar.gz: 44458471ad66d02c9a624f2db2802728093e093263ec579b3d7a58eb38c24561
3
+ metadata.gz: 95becf2d354c0a7eca13689fadbde7a7f210bbc24d9d62bd8539b1275b937fea
4
+ data.tar.gz: 83bfc4071f99c990cc78038ff267f2db8b8b8d960ffefa649b8dd46f315faaee
5
5
  SHA512:
6
- metadata.gz: a5291949f4106b7786c76f906dc2feea4f00eb647a51c939fd3a0001071b6d2f0e583789fa327d8f88ce4c02fa431833ce82bfbbe87f4978fddde05eb9a310d1
7
- data.tar.gz: 41bdb19fda29e0dc3096c350161c07f0d59f2c63c4b4dc062a591b94e8e92e0f07c8c1f8b0d0ac351f8c824844113a7bfb02c8728c9c3a11e540a9fcecd4988d
6
+ metadata.gz: 529ea441de414d60b1d6c5316e57ba2dbc05693a231434929d0279fb8ae1f0a26d714f4c9f6453ee6f2ff3e6cca7549d54df0b893da80e951649d236b179e9fb
7
+ data.tar.gz: a547b7fad7468b36bab9e2684c9b564813a9c16d17a0a6a8cc690ef56b5657e7a4aca6f273ef7f2f486a22e48330d34c36d36f320ab0e536dee532d9d493e235
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- isodoc (0.9.21)
4
+ isodoc (0.9.22)
5
5
  asciimath
6
6
  html2doc (~> 0.8.6)
7
7
  htmlentities (~> 4.3.4)
@@ -17,7 +17,7 @@ PATH
17
17
  GEM
18
18
  remote: https://rubygems.org/
19
19
  specs:
20
- asciidoctor (2.0.7)
20
+ asciidoctor (2.0.8)
21
21
  asciimath (1.0.8)
22
22
  ast (2.4.0)
23
23
  byebug (9.1.0)
@@ -68,7 +68,7 @@ GEM
68
68
  mime-types-data (3.2019.0331)
69
69
  mini_portile2 (2.4.0)
70
70
  nenv (0.3.0)
71
- nokogiri (1.10.2)
71
+ nokogiri (1.10.3)
72
72
  mini_portile2 (~> 2.4.0)
73
73
  notiffany (0.1.1)
74
74
  nenv (~> 0.1)
@@ -92,7 +92,7 @@ GEM
92
92
  rspec-mocks (~> 3.8.0)
93
93
  rspec-core (3.8.0)
94
94
  rspec-support (~> 3.8.0)
95
- rspec-expectations (3.8.2)
95
+ rspec-expectations (3.8.3)
96
96
  diff-lcs (>= 1.2.0, < 2.0)
97
97
  rspec-support (~> 3.8.0)
98
98
  rspec-mocks (3.8.0)
@@ -5,6 +5,7 @@ require "fileutils"
5
5
  module IsoDoc
6
6
  class Convert < ::IsoDoc::Common
7
7
  attr_reader :options
8
+ attr_writer :labels
8
9
 
9
10
  # htmlstylesheet: Generic stylesheet for HTML
10
11
  # wordstylesheet: Generic stylesheet for Word
@@ -1,7 +1,7 @@
1
1
  module IsoDoc
2
2
  class Metadata
3
3
  DATETYPES = %w{published accessed created implemented obsoleted confirmed
4
- updated issued received}.freeze
4
+ updated issued received transmitted copied unchanged circulated}.freeze
5
5
 
6
6
  def ns(xpath)
7
7
  Common::ns(xpath)
@@ -49,7 +49,7 @@ module IsoDoc
49
49
  def extract_person_affiliations(authors)
50
50
  authors.inject([]) do |m, a|
51
51
  name = a&.at(ns("./affiliation/organization/name"))&.text
52
- location = a&.at(ns("./affiliation/organization/contact/address/"\
52
+ location = a&.at(ns("./affiliation/organization/address/"\
53
53
  "formattedAddress"))&.text
54
54
  m << ((!name.nil? && !location.nil?) ? "#{name}, #{location}" :
55
55
  (name || location || ""))
@@ -206,6 +206,17 @@ module IsoDoc
206
206
  end
207
207
 
208
208
  def relations(isoxml, _out)
209
+ relations_obsoletes(isoxml)
210
+ relations_partof(isoxml)
211
+ end
212
+
213
+ def relations_partof(isoxml)
214
+ std = isoxml.at(ns("//bibdata/relation[@type = 'partOf']")) || return
215
+ id = std.at(ns(".//docidentifier"))
216
+ set(:partof, id.text) if id
217
+ end
218
+
219
+ def relations_obsoletes(isoxml)
209
220
  std = isoxml.at(ns("//bibdata/relation[@type = 'obsoletes']")) || return
210
221
  locality = std.at(ns(".//locality"))
211
222
  id = std.at(ns(".//docidentifier"))
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "0.9.21".freeze
2
+ VERSION = "0.9.22".freeze
3
3
  end
@@ -24,6 +24,12 @@ RSpec.describe IsoDoc do
24
24
  <date type="created"><from>2010</from><to>2011</to></date>
25
25
  <date type="activated"><on>2013</on></date>
26
26
  <date type="obsoleted"><on>2014</on></date>
27
+ <date type="circulated"><on>2015</on></date>
28
+ <date type="copied"><on>2016</on></date>
29
+ <date type="confirmed"><on>2017</on></date>
30
+ <date type="updated"><on>2018</on></date>
31
+ <date type="unchanged"><on>2019</on></date>
32
+ <date type="transmitted"><on>2020</on></date>
27
33
  <edition>2</edition>
28
34
  <version>
29
35
  <revision-date>2016-05-01</revision-date>
@@ -50,9 +56,9 @@ RSpec.describe IsoDoc do
50
56
  </name>
51
57
  <affiliation>
52
58
  <organization><name>Slate Inc.</name>
53
- <contact><address>
59
+ <address>
54
60
  <formattedAddress>Bedrock</formattedAddress>
55
- </address></contact>
61
+ </address>
56
62
  </organization>
57
63
  </affiliation>
58
64
  </person>
@@ -85,7 +91,7 @@ RSpec.describe IsoDoc do
85
91
  </bibdata>
86
92
  </iso-standard>
87
93
  INPUT
88
- {:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>["Barney Rubble", "Fred Flintstone"], :authors_affiliations=>{"Slate Inc., Bedrock"=>["Barney Rubble"], ""=>["Fred Flintstone"]}, :confirmeddate=>"XXX", :createddate=>"2010&ndash;2011", :doc=>"URL E", :docnumber=>"17301-1", :doctitle=>"Cereals and pulses", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :edition=>"2", :editorialgroup=>["TC 34", "SC 4", "WG 3"], :html=>"URL B", :ics=>"XXX", :implementeddate=>"XXX", :issueddate=>"XXX", :obsoleteddate=>"2014", :obsoletes=>nil, :obsoletes_part=>nil, :pdf=>"URL D", :publisheddate=>"2011", :receiveddate=>"XXX", :revdate=>"2016-05-01", :sc=>"SC 4", :secretariat=>"GB", :status=>"Committee draft", :tc=>"TC 34", :unpublished=>true, :updateddate=>"XXX", :url=>"URL A", :wg=>"WG 3", :xml=>"URL C"}
94
+ {:accesseddate=>"2012", :activateddate=>"2013", :agency=>"ISO", :authors=>["Barney Rubble", "Fred Flintstone"], :authors_affiliations=>{"Slate Inc., Bedrock"=>["Barney Rubble"], ""=>["Fred Flintstone"]}, :circulateddate=>"2015", :confirmeddate=>"2017", :copieddate=>"2016", :createddate=>"2010&ndash;2011", :doc=>"URL E", :docnumber=>"17301-1", :doctitle=>"Cereals and pulses", :doctype=>"International Standard", :docyear=>"2016", :draft=>"0.4", :draftinfo=>" (draft 0.4, 2016-05-01)", :edition=>"2", :editorialgroup=>["TC 34", "SC 4", "WG 3"], :html=>"URL B", :ics=>"XXX", :implementeddate=>"XXX", :issueddate=>"XXX", :obsoleteddate=>"2014", :obsoletes=>nil, :obsoletes_part=>nil, :pdf=>"URL D", :publisheddate=>"2011", :receiveddate=>"XXX", :revdate=>"2016-05-01", :sc=>"SC 4", :secretariat=>"GB", :status=>"Committee draft", :tc=>"TC 34", :transmitteddate=>"2020", :unchangeddate=>"2019", :unpublished=>true, :updateddate=>"2018", :url=>"URL A", :wg=>"WG 3", :xml=>"URL C"}
89
95
  OUTPUT
90
96
  end
91
97
 
@@ -134,6 +140,9 @@ OUTPUT
134
140
  <locality type="clause"><referenceFrom>3.1</referenceFrom></locality>
135
141
  <docidentifier>IEC 8121</docidentifier>
136
142
  </relation>
143
+ <relation type="partOf">
144
+ <docidentifier>IEC 8122</docidentifier>
145
+ </relation>
137
146
  <editorialgroup>
138
147
  <technical-committee number="34" type="ABC">Food products</technical-committee>
139
148
  <subcommittee number="4" type="DEF">Cereals and pulses</subcommittee>
@@ -147,7 +156,7 @@ OUTPUT
147
156
  </version>
148
157
  </iso-standard>
149
158
  INPUT
150
- {:accesseddate=>"XXX", :agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :confirmeddate=>"XXX", :createddate=>"XXX", :docnumber=>"17301-1-3", :doctitle=>"Cereals and pulses", :doctype=>"International Standard", :docyear=>"2016", :draft=>"12", :draftinfo=>" (draft 12, 2016-05-01)", :edition=>nil, :editorialgroup=>["ABC 34", "DEF 4", "GHI 3"], :ics=>"1.2.3, 1.2.3", :implementeddate=>"XXX", :issueddate=>"XXX", :obsoleteddate=>"XXX", :obsoletes=>"IEC 8121", :obsoletes_part=>"3.1", :publisheddate=>"XXX", :receiveddate=>"XXX", :revdate=>"2016-05-01", :sc=>"DEF 4", :secretariat=>"XXXX", :status=>"Published", :tc=>"ABC 34", :unpublished=>false, :updateddate=>"XXX", :wg=>"GHI 3"}
159
+ {:accesseddate=>"XXX", :agency=>"ISO/IEC", :authors=>[], :authors_affiliations=>{}, :circulateddate=>"XXX", :confirmeddate=>"XXX", :copieddate=>"XXX", :createddate=>"XXX", :docnumber=>"17301-1-3", :doctitle=>"Cereals and pulses", :doctype=>"International Standard", :docyear=>"2016", :draft=>"12", :draftinfo=>" (draft 12, 2016-05-01)", :edition=>nil, :editorialgroup=>["ABC 34", "DEF 4", "GHI 3"], :ics=>"1.2.3, 1.2.3", :implementeddate=>"XXX", :issueddate=>"XXX", :obsoleteddate=>"XXX", :obsoletes=>"IEC 8121", :obsoletes_part=>"3.1", :partof=>"IEC 8122", :publisheddate=>"XXX", :receiveddate=>"XXX", :revdate=>"2016-05-01", :sc=>"DEF 4", :secretariat=>"XXXX", :status=>"Published", :tc=>"ABC 34", :transmitteddate=>"XXX", :unchangeddate=>"XXX", :unpublished=>false, :updateddate=>"XXX", :wg=>"GHI 3"}
151
160
  OUTPUT
152
161
  end
153
162
 
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.21
4
+ version: 0.9.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-14 00:00:00.000000000 Z
11
+ date: 2019-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath