relaton-iho 1.3.2 → 1.4.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: 7898af6b5b9c984bcb5888c925df80918f797b3ded43f86ad41e749ebd45b50b
4
- data.tar.gz: b1af3d18334b55e941c18c79cf6e3b060b1ac3ecc6c2f0a82757bf4c0e5df05d
3
+ metadata.gz: 9c2889e6d995ae69c8aaf59df34b2a4c8ca5c7700be4e7f31f5ae27411469afd
4
+ data.tar.gz: 9c27f57bd7cd0824fcbfbd4acc6cd6921f7c7cf0bd2594a4032406ccd037d406
5
5
  SHA512:
6
- metadata.gz: 4eb5ce96479f46296bd0c67294d06e1efb646296051ed4e013ba3ce42eddeaa1ba081a0fce26787d02c3fe4157263d29cc0c81adc4150e8214b7d807f6c95de9
7
- data.tar.gz: d840e8461f613ba954bba1719519d7df704ef73e18cfaeb75648a3216893146f67256296b91e8e7046be7968d2d373581be3366d725255ccc584ee586dd737fb
6
+ metadata.gz: b73ac143dab2eff7e69440608d2373b0f62cfe059cebcf0a1fab47a2d395dd8fd6b3fd22ba5f3124293cd14f8d4e7382795e65a0c3135e0ea7fe407636af7503
7
+ data.tar.gz: e25a2f287db40dfc99a305358134b3dfd87afe2aa3a500c103f2de8f97e6ae4093b8aa3b1843a1cf253c073cb5bc8ca9d6b1f5002b11b711eb313ac15c4b43b4
@@ -32,7 +32,7 @@ Or install it yourself as:
32
32
 
33
33
  [source,sh]
34
34
  ----
35
- $ gem install relaton_iho
35
+ $ gem install relaton-iho
36
36
  ----
37
37
 
38
38
  == Usage
@@ -41,11 +41,13 @@ $ gem install relaton_iho
41
41
 
42
42
  [source,ruby]
43
43
  ----
44
- hits = RelatonIho::IhoBibliography.search("OGC 19-025r1")
45
- => [<RelatonIho::Hit:0x007fcab6b9aab8 @text="OGC 19-025r1" @fetched="false" @fullIdentifier="" @title="">]
44
+ pry(main)> require 'relaton_iho'
45
+ => true
46
46
 
47
- tem = hits[0].fetch
48
- => #<RelatonIho::IhoBibliographicItem:0x007fcab3cb4758
47
+ item = RelatonIho::IhoBibliography.search("B-11")
48
+ [relaton-iho] ("B-11") fetching...
49
+ [relaton-iho] ("B-11") found B-11
50
+ => #<RelatonIho::IhoBibliographicItem:0x007fe74fc80800
49
51
  ...
50
52
  ----
51
53
 
@@ -53,14 +55,12 @@ tem = hits[0].fetch
53
55
  [source,ruby]
54
56
  ----
55
57
  item.to_xml
56
- => "<bibitem id="19-025r1" type="standard">
57
- <title type="title-main" format="text/plain" language="en" script="Latn">Development of Spatial Data Infrastructures for Marine Data Management</title>
58
- <title type="main" format="text/plain" language="en" script="Latn">Development of Spatial Data Infrastructures for Marine Data Management</title>
59
- <uri type="obp">https://portal.opengeospatial.org/files/?artifact_id=88037</uri>
60
- <docidentifier type="OGC">19-025r1</docidentifier>
61
- <date type="published">
62
- <on>2019</on>
63
- </date>
58
+ => "<bibitem id="B-11" type="standard">
59
+ <fetched>2020-03-29</fetched>
60
+ <title type="main" format="text/plain" language="en">IHO-IOC GEBCO Cook Book</title>
61
+ <title type="main" format="text/plain" language="fr">Livre de recettes GEBCO OHI-COI</title>
62
+ <uri type="pdf">https://www.star.nesdis.noaa.gov/socd/lsa/GEBCO_Cookbook/documents/CookBook_20191031.pdf</uri>
63
+ <docidentifier type="IHO">B-11</docidentifier>
64
64
  ...
65
65
  </bibitem>"
66
66
  ----
@@ -69,33 +69,45 @@ With argument `bibdata: true` it ouputs XML wrapped by `bibdata` element and add
69
69
  ----
70
70
  item.to_xml bibdata: true
71
71
  => "<bibdata type="standard">
72
- <title type="title-main" format="text/plain" language="en" script="Latn">Development of Spatial Data Infrastructures for Marine Data Management</title>
73
- <title type="main" format="text/plain" language="en" script="Latn">Development of Spatial Data Infrastructures for Marine Data Management</title>
74
- <uri type="obp">https://portal.opengeospatial.org/files/?artifact_id=88037</uri>
75
- <docidentifier type="OGC">19-025r1</docidentifier>
76
- <date type="published\">
77
- <on>2019</on>
78
- </date>
72
+ <fetched>2020-03-29</fetched>
73
+ <title type="main" format="text/plain" language="en">IHO-IOC GEBCO Cook Book</title>
74
+ <title type="main" format="text/plain" language="fr">Livre de recettes GEBCO OHI-COI</title>
75
+ <uri type="pdf">https://www.star.nesdis.noaa.gov/socd/lsa/GEBCO_Cookbook/documents/CookBook_20191031.pdf</uri>
76
+ <docidentifier type="IHO">B-11</docidentifier>
79
77
  ...
80
78
  <ext>
81
- <doctype>public-engineering-report</doctype>
79
+ <editorialgroup>
80
+ <committee>
81
+ <name>Hydrographic Services and Standards Committee</name>
82
+ <abbreviation>HSSC</abbreviation>
83
+ </committee>
84
+ <committee>
85
+ <name>Inter-Regional Coordination Committee</name>
86
+ <abbreviation>IRCC</abbreviation>
87
+ <committee>
88
+ <name>JOINT IHO-IOC GUIDING COMMITTEE FOR THE GENERAL BATHYMETRIC CHART OF THE OCEANS</name>
89
+ <abbreviation>GEBCO</abbreviation>
90
+ </committee>
91
+ </committee>
92
+ </editorialgroup>
82
93
  </ext>
83
94
  </bibdata>"
84
95
  ----
85
96
 
86
- === Get code, and year
97
+ === Get code
87
98
  [source,ruby]
88
99
  ----
89
- RelatonIho::IhoBibliography.get "OGC 19-025r1", "2019", {}
90
- fetching OGC 19-025r1...
91
- => #<RelatonIho::IhoBibliographicItem:0x007fc322e9aba0
100
+ RelatonIho::IhoBibliography.get "IHO B-11"
101
+ [relaton-iho] ("IHO B-11") fetching...
102
+ [relaton-iho] ("IHO B-11") found B-11
103
+ => #<RelatonIho::IhoBibliographicItem:0x007fe78dbb7c78
92
104
  ...
93
105
  ----
94
106
 
95
107
  === Create bibliographic item from XML
96
108
  [source,ruby]
97
109
  ----
98
- RelatonIho::XMLParser.from_xml File.read('spec/fixtures/ogc_bib_item.xml')
110
+ RelatonIho::XMLParser.from_xml File.read('spec/fixtures/iho.xml')
99
111
  => #<RelatonIho::IhoBibliographicItem:0x007fc322ea82c8
100
112
  ...
101
113
  ----
@@ -103,12 +115,12 @@ RelatonIho::XMLParser.from_xml File.read('spec/fixtures/ogc_bib_item.xml')
103
115
  === Create bibliographic item from YAML
104
116
  [source,ruby]
105
117
  ----
106
- hash = YAML.load_file 'spec/fixtures/ogc_bib_item.yml'
107
- => {"id"=>"19-025r1",
118
+ hash = YAML.load_file 'spec/fixtures/iho.yaml'
119
+ => {"id"=>"B-11",
108
120
  ...
109
121
 
110
122
  bib_hash = RelatonIho::HashConverter.hash_to_bib hash
111
- => {:id=>"19-025r1",
123
+ => {:id=>"B-11",
112
124
  ...
113
125
 
114
126
  RelatonIho::IhoBibliographicItem.new bib_hash
@@ -64,6 +64,11 @@
64
64
  </choice>
65
65
  </attribute>
66
66
  </optional>
67
+ <optional>
68
+ <attribute name="droploc">
69
+ <data type="boolean"/>
70
+ </attribute>
71
+ </optional>
67
72
  <text/>
68
73
  </element>
69
74
  </define>
@@ -581,6 +586,8 @@
581
586
  <ref name="ol"/>
582
587
  <ref name="dl"/>
583
588
  <ref name="formula"/>
589
+ <ref name="quote"/>
590
+ <ref name="sourcecode"/>
584
591
  </choice>
585
592
  </oneOrMore>
586
593
  </element>
@@ -664,6 +671,16 @@
664
671
  </choice>
665
672
  </attribute>
666
673
  </optional>
674
+ <optional>
675
+ <attribute name="valign">
676
+ <choice>
677
+ <value>top</value>
678
+ <value>middle</value>
679
+ <value>bottom</value>
680
+ <value>baseline</value>
681
+ </choice>
682
+ </attribute>
683
+ </optional>
667
684
  <choice>
668
685
  <zeroOrMore>
669
686
  <choice>
@@ -700,6 +717,16 @@
700
717
  </choice>
701
718
  </attribute>
702
719
  </optional>
720
+ <optional>
721
+ <attribute name="valign">
722
+ <choice>
723
+ <value>top</value>
724
+ <value>middle</value>
725
+ <value>bottom</value>
726
+ <value>baseline</value>
727
+ </choice>
728
+ </attribute>
729
+ </optional>
703
730
  <choice>
704
731
  <zeroOrMore>
705
732
  <choice>
@@ -858,7 +885,7 @@
858
885
  <oneOrMore>
859
886
  <choice>
860
887
  <ref name="content"/>
861
- <ref name="preface_abstract"/>
888
+ <ref name="abstract"/>
862
889
  <ref name="foreword"/>
863
890
  <ref name="introduction"/>
864
891
  <ref name="acknowledgements"/>
@@ -1052,14 +1079,17 @@
1052
1079
  <ref name="section-title"/>
1053
1080
  </optional>
1054
1081
  <group>
1055
- <group>
1056
- <zeroOrMore>
1057
- <ref name="BasicBlock"/>
1058
- </zeroOrMore>
1059
- <zeroOrMore>
1060
- <ref name="note"/>
1061
- </zeroOrMore>
1062
- </group>
1082
+ <choice>
1083
+ <group>
1084
+ <zeroOrMore>
1085
+ <ref name="BasicBlock"/>
1086
+ </zeroOrMore>
1087
+ <zeroOrMore>
1088
+ <ref name="note"/>
1089
+ </zeroOrMore>
1090
+ </group>
1091
+ <ref name="amend"/>
1092
+ </choice>
1063
1093
  <zeroOrMore>
1064
1094
  <choice>
1065
1095
  <ref name="clause-subsection"/>
@@ -1456,11 +1486,6 @@
1456
1486
  </optional>
1457
1487
  </element>
1458
1488
  </define>
1459
- <define name="preface_abstract">
1460
- <element name="abstract">
1461
- <ref name="Basic-Section"/>
1462
- </element>
1463
- </define>
1464
1489
  <define name="term-clause">
1465
1490
  <element name="clause">
1466
1491
  <optional>
@@ -1510,4 +1535,79 @@
1510
1535
  <ref name="CitationType"/>
1511
1536
  </element>
1512
1537
  </define>
1538
+ <define name="amend">
1539
+ <element name="amend">
1540
+ <optional>
1541
+ <attribute name="id">
1542
+ <data type="ID"/>
1543
+ </attribute>
1544
+ </optional>
1545
+ <attribute name="change">
1546
+ <choice>
1547
+ <value>add</value>
1548
+ <value>modify</value>
1549
+ <value>delete</value>
1550
+ </choice>
1551
+ </attribute>
1552
+ <optional>
1553
+ <attribute name="path"/>
1554
+ </optional>
1555
+ <optional>
1556
+ <attribute name="path_end"/>
1557
+ </optional>
1558
+ <optional>
1559
+ <attribute name="title"/>
1560
+ </optional>
1561
+ <optional>
1562
+ <element name="location">
1563
+ <zeroOrMore>
1564
+ <ref name="locality"/>
1565
+ </zeroOrMore>
1566
+ </element>
1567
+ </optional>
1568
+ <zeroOrMore>
1569
+ <ref name="autonumber"/>
1570
+ </zeroOrMore>
1571
+ <optional>
1572
+ <element name="description">
1573
+ <zeroOrMore>
1574
+ <ref name="BasicBlock"/>
1575
+ </zeroOrMore>
1576
+ </element>
1577
+ </optional>
1578
+ <optional>
1579
+ <element name="newcontent">
1580
+ <zeroOrMore>
1581
+ <ref name="BasicBlock"/>
1582
+ </zeroOrMore>
1583
+ </element>
1584
+ </optional>
1585
+ <optional>
1586
+ <element name="description">
1587
+ <zeroOrMore>
1588
+ <ref name="BasicBlock"/>
1589
+ </zeroOrMore>
1590
+ </element>
1591
+ </optional>
1592
+ </element>
1593
+ </define>
1594
+ <define name="autonumber">
1595
+ <element name="autonumber">
1596
+ <attribute name="type">
1597
+ <choice>
1598
+ <value>requirement</value>
1599
+ <value>recommendation</value>
1600
+ <value>permission</value>
1601
+ <value>table</value>
1602
+ <value>figure</value>
1603
+ <value>admonition</value>
1604
+ <value>formula</value>
1605
+ <value>sourcecode</value>
1606
+ <value>example</value>
1607
+ <value>note</value>
1608
+ </choice>
1609
+ </attribute>
1610
+ <text/>
1611
+ </element>
1612
+ </define>
1513
1613
  </grammar>
@@ -10,7 +10,7 @@ module RelatonIho
10
10
  # @return [RelatonIho::IhoBibliographicItem]
11
11
  def search(text, _year = nil, _opts = {}) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
12
12
  warn "[relaton-iho] (\"#{text}\") fetching..."
13
- ref = text.sub(/^IHO\s/, "").downcase
13
+ ref = text.sub(/^IHO\s/, "").downcase.sub /^([[:alpha:]]+)(\d+)/, '\1-\2'
14
14
  uri = URI("#{ENDPOINT}#{ref}.yaml")
15
15
  resp = Net::HTTP.get_response uri
16
16
  return unless resp.code == "200"
@@ -21,7 +21,7 @@ module RelatonIho
21
21
  item
22
22
  rescue SocketError, Errno::EINVAL, Errno::ECONNRESET, EOFError,
23
23
  Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError,
24
- Net::ProtocolError, Net::ReadTimeout, OpenSSL::SSL::SSLError,
24
+ Net::ProtocolError, Net::ReadTimeout, # OpenSSL::SSL::SSLError,
25
25
  Errno::ETIMEDOUT => e
26
26
  raise RelatonBib::RequestError, "Could not access #{uri}: #{e.message}"
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonIho
2
- VERSION = "1.3.2".freeze
2
+ VERSION = "1.4.0".freeze
3
3
  end
@@ -32,5 +32,5 @@ Gem::Specification.new do |s|
32
32
  s.add_development_dependency "vcr"
33
33
  s.add_development_dependency "webmock"
34
34
 
35
- s.add_dependency "relaton-bib", "~> 1.3.0"
35
+ s.add_dependency "relaton-bib", "~> 1.4.0"
36
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.4.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-09-02 00:00:00.000000000 Z
11
+ date: 2020-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.3.0
159
+ version: 1.4.0
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 1.3.0
166
+ version: 1.4.0
167
167
  description: 'RelatonIho: retrieve IHO Standards for bibliographic using the BibliographicItem
168
168
  model'
169
169
  email: