relaton-iec 1.20.4 → 2.0.0.pre.alpha.1

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.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +0 -3
  3. data/.rubocop.yml +1 -1
  4. data/README.adoc +98 -122
  5. data/grammars/basicdoc.rng +1559 -671
  6. data/grammars/biblio-standoc.rng +107 -46
  7. data/grammars/biblio.rng +1010 -375
  8. data/grammars/relaton-iec.rng +60 -121
  9. data/lib/relaton/iec/bibliography.rb +225 -0
  10. data/lib/relaton/iec/data_fetcher.rb +214 -0
  11. data/lib/relaton/iec/data_parser.rb +328 -0
  12. data/lib/relaton/iec/hit.rb +26 -0
  13. data/lib/relaton/iec/hit_collection.rb +96 -0
  14. data/lib/relaton/iec/item_data.rb +7 -0
  15. data/lib/relaton/iec/model/bibdata.rb +7 -0
  16. data/lib/relaton/iec/model/bibitem.rb +7 -0
  17. data/lib/relaton/iec/model/docidentifier.rb +40 -0
  18. data/lib/relaton/iec/model/doctype.rb +12 -0
  19. data/lib/relaton/iec/model/ext.rb +50 -0
  20. data/lib/relaton/iec/model/item.rb +24 -0
  21. data/lib/relaton/iec/model/item_base.rb +9 -0
  22. data/lib/relaton/iec/model/relation.rb +7 -0
  23. data/lib/relaton/iec/model/stage_name.rb +13 -0
  24. data/lib/relaton/iec/processor.rb +72 -0
  25. data/lib/relaton/iec/util.rb +8 -0
  26. data/lib/relaton/iec/version.rb +5 -0
  27. data/lib/relaton/iec.rb +98 -0
  28. data/relaton_iec.gemspec +9 -9
  29. metadata +38 -56
  30. data/CLAUDE.md +0 -88
  31. data/lib/relaton_iec/basic_block/alignment.rb +0 -29
  32. data/lib/relaton_iec/basic_block/basic_block.rb +0 -15
  33. data/lib/relaton_iec/basic_block/citation_type.rb +0 -32
  34. data/lib/relaton_iec/basic_block/dl.rb +0 -60
  35. data/lib/relaton_iec/basic_block/eref.rb +0 -10
  36. data/lib/relaton_iec/basic_block/eref_type.rb +0 -39
  37. data/lib/relaton_iec/basic_block/formula.rb +0 -34
  38. data/lib/relaton_iec/basic_block/image.rb +0 -40
  39. data/lib/relaton_iec/basic_block/index.rb +0 -27
  40. data/lib/relaton_iec/basic_block/index_xref.rb +0 -31
  41. data/lib/relaton_iec/basic_block/note.rb +0 -21
  42. data/lib/relaton_iec/basic_block/paragraph.rb +0 -27
  43. data/lib/relaton_iec/basic_block/paragraph_with_footnote.rb +0 -29
  44. data/lib/relaton_iec/basic_block/reference_format.rb +0 -38
  45. data/lib/relaton_iec/basic_block/stem.rb +0 -29
  46. data/lib/relaton_iec/basic_block/table.rb +0 -115
  47. data/lib/relaton_iec/basic_block/text_element.rb +0 -26
  48. data/lib/relaton_iec/data_fetcher.rb +0 -211
  49. data/lib/relaton_iec/data_parser.rb +0 -294
  50. data/lib/relaton_iec/document_identifier.rb +0 -34
  51. data/lib/relaton_iec/document_type.rb +0 -20
  52. data/lib/relaton_iec/hash_converter.rb +0 -42
  53. data/lib/relaton_iec/hit.rb +0 -34
  54. data/lib/relaton_iec/hit_collection.rb +0 -81
  55. data/lib/relaton_iec/iec_bibliographic_item.rb +0 -125
  56. data/lib/relaton_iec/iec_bibliography.rb +0 -200
  57. data/lib/relaton_iec/index.rb +0 -135
  58. data/lib/relaton_iec/processor.rb +0 -64
  59. data/lib/relaton_iec/tc_sc_officers_note.rb +0 -24
  60. data/lib/relaton_iec/util.rb +0 -6
  61. data/lib/relaton_iec/version.rb +0 -3
  62. data/lib/relaton_iec/xml_parser.rb +0 -37
  63. data/lib/relaton_iec.rb +0 -98
  64. /data/lib/{relaton_iec → relaton/iec}/statuses.yml +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c5de0c1e814fc7f481bd66dd3ec89b83a5a1ed4e7d77fd28d523086d92dba5d
4
- data.tar.gz: 3413c16ef8234612e5a460f3eac8988bc82fbc4c3a605bc99eb958598b93bb38
3
+ metadata.gz: eb18536c08a3cfa37917813b0505c3d35dd78195ff3c4179e459025cc3403551
4
+ data.tar.gz: 808fedfdaa1def6f060bd83353747d3e3f3d77246b7755ca3e55686f99b6f127
5
5
  SHA512:
6
- metadata.gz: 73ca94740f8c9990f9189bdb0424540351c7d683b9ea3cd0ec11fb4f88fbac7d7c3fdcf06b1ed3b8ef6728e7f6a652822ecb5d0308722d34510bc488e7d920ba
7
- data.tar.gz: 9e3d848e9d8805530e82389754586082a08fd7c1772a4222999c0f3e10d2d7334a4e4870aed6896f4cae4766310ee82eb0379183797b26576baf8bdb3b951809
6
+ metadata.gz: 7c1d60f01ac5cb66618d17d472e80d2bc8845b62ff28a5fb8b9f872cbae548eed38ce1c9e6bd9bbdedb84a94184958a91e6efd29e6a8b17cac18c04002bd81a3
7
+ data.tar.gz: f5387a30e591ca09cb4a5ebe5d4a231024a55f9b53b620a303ab3f49341f0c727e57ea3d2046cf829195f94ea9b2d4061f81ba734e5e013ad9b97402124620b0
@@ -14,9 +14,6 @@ on:
14
14
  repository_dispatch:
15
15
  types: [ do-release ]
16
16
 
17
- permissions:
18
- id-token: write
19
- contents: write
20
17
 
21
18
  jobs:
22
19
  release:
data/.rubocop.yml CHANGED
@@ -7,6 +7,6 @@ require: rubocop-rails
7
7
  inherit_from:
8
8
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
9
9
  AllCops:
10
- TargetRubyVersion: 2.7
10
+ TargetRubyVersion: 3.2
11
11
  Rails:
12
12
  Enabled: false
data/README.adoc CHANGED
@@ -1,4 +1,4 @@
1
- = RelatonIec: retrieve IEC Standards for bibliographic use using the BibliographicItem model
1
+ = Relaton::Iec: retrieve IEC Standards for bibliographic use using the BibliographicItem model
2
2
 
3
3
  image:https://img.shields.io/gem/v/relaton-iec.svg["Gem Version", link="https://rubygems.org/gems/relaton-iec"]
4
4
  image:https://github.com/relaton/relaton-iec/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-iec/actions?workflow=macos"]
@@ -8,9 +8,9 @@ image:https://codeclimate.com/github/relaton/relaton-iec/badges/gpa.svg["Code Cl
8
8
  image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-iec.svg["Pull Requests", link="https://github.com/relaton/relaton-iec/pulls"]
9
9
  image:https://img.shields.io/github/commits-since/relaton/relaton-iec/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-iec/releases"]
10
10
 
11
- RelatonIec is a Ruby gem that implements the https://github.com/metanorma/metanorma-model-iso#iso-bibliographic-item[IsoBibliographicItem model].
11
+ Relaton:Iec is a Ruby gem that implements the https://github.com/metanorma/metanorma-model-iso#iso-bibliographic-item[IsoBibliographicItem model].
12
12
 
13
- You can use it to retrieve metadata of IEC Standards from https://www.iec.ch, and access such metadata through the `IecBibliographicItem` object.
13
+ You can use it to retrieve metadata of IEC Standards from https://www.iec.ch, and access such metadata through the `Relaton::Iec::ItemData` object.
14
14
 
15
15
  == Installation
16
16
 
@@ -33,114 +33,74 @@ Or install it yourself as:
33
33
 
34
34
  === Search for a standard using keywords
35
35
 
36
- `RelatonIec::IecBibliography.search(ref, year)` method returns hits collection. Each hit can be used to fetch a document.
36
+ `Relaton::Iec::Bibliography.search(ref, year)` method returns hits collection. Each hit can be used to fetch a document.
37
37
 
38
38
  - `ref` - a reference to search document
39
39
  - `year` - filter by year (optional)
40
40
 
41
41
  [source,ruby]
42
42
  ----
43
- require 'relaton_iec'
43
+ require 'relaton/iec'
44
44
  => true
45
45
 
46
- hit_collection = RelatonIec::IecBibliography.search("60050")
47
- => <RelatonIec::HitCollection:0x007fe0d7126f28 @ref=60050 @fetched=false>
46
+ hit_collection = Relaton::Iec::Bibliography.search("IEC 60050")
47
+ => <Relaton::Iec::HitCollection:0x00000000005650 @ref=IEC 60050 @fetched=false>
48
48
 
49
49
  hit_collection.first
50
- => <RelatonIec::Hit:0x000000000003e8 @text="60050" @fetched="false" @fullIdentifier="" @title="IEC 60050-05:1935">
50
+ => <Relaton::Iec::Hit:0x00000000006260 @reference="IEC 60050" @fetched="false" @docidentifier="IEC 60050-05:1935">
51
51
 
52
- item = hit_collection[2].fetch
53
- => #<RelatonIec::IecBibliographicItem:0x007fe1171a06f8
52
+ item = hit_collection[2].item
53
+ => #<Relaton::Iec::ItemData:0x000000012cbc72a8
54
54
  ...
55
55
 
56
- item.docidentifier
57
- => [#<RelatonBib::DocumentIdentifier:0x00007ff1b52a2b60 @id="IEC 60050-07:1956", @language=nil, @primary=true, @scope=nil, @script=nil, @type="IEC">,
58
- #<RelatonBib::DocumentIdentifier:0x00007ff1b52a2a98
59
- @id="urn:iec:std:iec:60050-07:1956-01:::",
60
- @language=nil,
61
- @primary=nil,
62
- @scope=nil,
63
- @script=nil,
64
- @type="URN">]
65
-
66
- item.docidentifier.detect { |di| di.type == "URN" }.id
67
- => "urn:iec:std:iec:60050-07:1956-01:::"
68
- ----
69
-
70
- === Fetch document by keywords
56
+ item.docidentifier[0].type
57
+ => "IEC"
71
58
 
72
- `RelatonIec::IecBibliography.get(ref, year, opts)` method returns the document.
73
-
74
- - `ref` - a reference to search document
75
- - `year` - filter by year (optional)
76
- - `opts` - hash of options (optional). Supported options are `:all_parts` (boolean), `:keep_year` (boolean), `:publication_date_before` (string), `:publication_date_after` (string).
77
-
78
- [source,ruby]
79
- ----
80
- item = RelatonIec::IecBibliography.get("IEC 60050-112:2010")
81
- [relaton-iec] (IEC 60050-112:2010) Fetching from Relaton repository ...
82
- [relaton-iec] (IEC 60050-112:2010) Found: `IEC 60050-112:2010`
83
- => #<RelatonIec::IecBibliographicItem:0x00007f876525e8d0
84
- ...
85
-
86
- item = RelatonIec::IecBibliography.get("IEC 60050-112", "2010", all_parts: true)
87
- [relaton-iec] (IEC 60050-112) Fetching from Relaton repository ...
88
- [relaton-iec] (IEC 60050-112) Found: `IEC 60050 (all parts)`
89
- => #<RelatonIec::IecBibliographicItem:0x00007f87851888f0
90
- ...
59
+ item.docidentifier[0].primary
60
+ => true
91
61
 
92
- item.docidentifier.first
93
- => #<RelatonBib::DocumentIdentifier:0x00007f878518eea8 @id="IEC 60050 (all parts)", @language=nil, @primary=true, @scope=nil, @script=nil, @type="IEC">
62
+ item.docidentifier[0].content
63
+ => "IEC 60050-07:1956"
94
64
 
95
- item = RelatonIec::IecBibliography.get("IEC 60050-112", "2010")
96
- [relaton-iec] (IEC 60050-112) Fetching from Relaton repository ...
97
- [relaton-iec] (IEC 60050-112) Found: `IEC 60050-112:2010`
98
- => #<RelatonIec::IecBibliographicItem:0x007fa69f296da8
65
+ item.docidentifier[1].type
66
+ => "URN"
99
67
 
100
- item.docidentifier.first
101
- => #<RelatonBib::DocumentIdentifier:0x00007f876530c2c8 @id="IEC 60050-112:2010", @language=nil, @primary=true, @scope=nil, @script=nil, @type="IEC">
68
+ item.docidentifier[1].content
69
+ => "urn:iec:std:iec:60050-07:1956-01:::"
102
70
  ----
103
71
 
104
- === Filter by publication date range
105
-
106
- The `get` method supports `:publication_date_before` and `:publication_date_after` options to select editions within a date range.
72
+ === Fetch document by keywords
107
73
 
108
- - `:publication_date_before` -- returns documents published *before* the given date (exclusive)
109
- - `:publication_date_after` -- returns documents published *on or after* the given date (inclusive)
74
+ `Relaton::Iec::Bibliography.get(ref, year, opts)` method returns the document.
110
75
 
111
- Filter values can be year-only (`"2008"`), year-month (`"2008-02"`), or full dates (`"2008-02-02"`). Partial dates are zero-filled to the 1st of the month/year.
76
+ - `ref` - a reference to search document
77
+ - `year` - filter by year (optional)
78
+ - `opts` - hash of options (optional). Supported options are `:all_parts` (boolean), `:keep_year` (boolean).
112
79
 
113
80
  [source,ruby]
114
81
  ----
115
- # Get the most recent edition published before 2000
116
- item = RelatonIec::IecBibliography.get("IEC 61332", nil, publication_date_before: "2000")
117
- [relaton-iec] INFO: (IEC 61332) Fetching from Relaton repository ...
118
- [relaton-iec] INFO: (IEC 61332) Found: `IEC 61332:1995`
119
- => #<RelatonIec::IecBibliographicItem:0x0000000124cfcd10
82
+ item = Relaton::Iec::Bibliography.get("IEC 60050-112:2010")
83
+ [relaton-iec] INFO: (IEC 60050-112:2010) Fetching from Relaton repsitory ...
84
+ [relaton-iec] INFO: (IEC 60050-112:2010) Found: `IEC 60050-112:2010`
85
+ => #<Relaton::Iec::ItemData:0x000000012e5c6410
120
86
  ...
121
87
 
122
- item.date.find { |d| d.type == "published" }.on
123
- => "1995-10-11"
124
-
125
- # Get the most recent edition published in 2010 or later
126
- item = RelatonIec::IecBibliography.get("IEC 61332", nil, publication_date_after: "2010")
127
- [relaton-iec] INFO: (IEC 61332) Fetching from Relaton repository ...
128
- [relaton-iec] INFO: (IEC 61332) Found: `IEC 61332:2026`
129
- => #<RelatonIec::IecBibliographicItem:0x000000013285f790
88
+ item = Relaton::Iec::Bibliography.get("IEC 60050-112", "2010", all_parts: true)
89
+ [relaton-iec] INFO: (IEC 60050-112:2010) Fetching from Relaton repsitory ...
90
+ [relaton-iec] INFO: (IEC 60050-112:2010) Found: `IEC 60050 (all parts)`
91
+ => #<Relaton::Iec::ItemData:0x000000012e1ebb88
130
92
  ...
131
93
 
132
- item.date.find { |d| d.type == "published" }.on
133
- => "2026-01-23"
94
+ item.docidentifier.first.content
95
+ => "IEC 60050 (all parts)"
134
96
 
135
- # Combine both filters for a date range
136
- item = RelatonIec::IecBibliography.get("IEC 61332", nil, publication_date_after: "2000", publication_date_before: "2010")
137
- [relaton-iec] INFO: (IEC 61332) Fetching from Relaton repository ...
138
- [relaton-iec] INFO: (IEC 61332) Found: `IEC 61332:2005`
139
- => #<RelatonIec::IecBibliographicItem:0x000000013285f010
140
- ...
97
+ item = Relaton::Iec::Bibliography.get("IEC 60050-112", "2010")
98
+ [relaton-iec] INFO: (IEC 60050-112:2010) Fetching from Relaton repsitory ...
99
+ [relaton-iec] INFO: (IEC 60050-112:2010) Found: `IEC 60050-112:2010`
100
+ => #<Relaton::Iec::ItemData:0x000000012f0c6b80
141
101
 
142
- item.date.find { |d| d.type == "published" }.on
143
- => "2005-09-23"
102
+ item.docidentifier.first.content
103
+ => "IEC 60050-112:2010"
144
104
  ----
145
105
 
146
106
  === Search for ISO/IEC Directives
@@ -162,23 +122,40 @@ Possible options:
162
122
  [source,ruby]
163
123
  ----
164
124
  item.to_xml
165
- => "<bibitem id="IEC60050-112-2010" type="standard" schema-version="v1.2.1">
166
- <fetched>2023-03-01</fetched>
167
- <title type="main" format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary (IEV) - Part 112: Quantities and units</title>
168
- <title type="main" format="text/plain" language="fr" script="Latn">Vocabulaire Electrotechnique International (IEV) - Partie 112: Grandeurs et unités</title>
169
- <title type="main" format="text/plain" language="es" script="Latn">Versión Oficial En español - Vocabulario Electrotécnico Internacional. Parte 112: Magnitudes y unidades.</title>
125
+ => "<bibitem id="IEC600501122010" type="standard" schema-version="v1.4.1">
126
+ <fetched>2026-02-02</fetched>
127
+ <title language="en" script="Latn" type="title-main">International Electrotechnical Vocabulary (IEV)</title>
128
+ <title language="en" script="Latn" type="title-part">Part 112: Quantities and units</title>
129
+ <title language="en" script="Latn" type="main">International Electrotechnical Vocabulary (IEV) - Part 112: Quantities and units</title>
130
+ <title language="fr" script="Latn" type="title-main">Vocabulaire Electrotechnique International (IEV)</title>
131
+ <title language="fr" script="Latn" type="title-part">Partie 112: Grandeurs et unités</title>
132
+ <title language="fr" script="Latn" type="main">Vocabulaire Electrotechnique International (IEV) - Partie 112: Grandeurs et unités</title>
133
+ <title language="es" script="Latn" type="title-intro">Versión Oficial En español</title>
134
+ <title language="es" script="Latn" type="title-main">Vocabulario Electrotécnico Internacional. Parte 112: Magnitudes y unidades.</title>
135
+ <title language="es" script="Latn" type="main">Versión Oficial En español - Vocabulario Electrotécnico Internacional. Parte 112: Magnitudes y unidades.</title>
170
136
  <uri type="src">https://webstore.iec.ch/publication/162</uri>
137
+ <uri type="obp">https://webstore.iec.ch/preview/info_iec60050-112{ed1.0}b.pdf</uri>
138
+ <docidentifier type="IEC" primary="true">IEC 60050-112:2010</docidentifier>
139
+ <docidentifier type="URN">urn:iec:std:iec:60050-112:2010-01:::</docidentifier>
171
140
  ...
172
141
  </bibitem>"
173
142
 
174
143
  item.to_xml bibdata: true
175
- => "<bibdata type="standard" schema-version="v1.2.1">
176
- <fetched>2023-03-01</fetched>
177
- <title type="main" format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary (IEV) - Part 112: Quantities and units</title>
178
- <title type="main" format="text/plain" language="fr" script="Latn">Vocabulaire Electrotechnique International (IEV) - Partie 112: Grandeurs et unités</title>
179
- <title type="main" format="text/plain" language="es" script="Latn">Versión Oficial En español - Vocabulario Electrotécnico Internacional. Parte 112: Magnitudes y unidades.</title>
144
+ => "<bibdata type="standard" schema-version="v1.4.1">
145
+ <fetched>2026-02-02</fetched>
146
+ <title language="en" script="Latn" type="title-main">International Electrotechnical Vocabulary (IEV)</title>
147
+ <title language="en" script="Latn" type="title-part">Part 112: Quantities and units</title>
148
+ <title language="en" script="Latn" type="main">International Electrotechnical Vocabulary (IEV) - Part 112: Quantities and units</title>
149
+ <title language="fr" script="Latn" type="title-main">Vocabulaire Electrotechnique International (IEV)</title>
150
+ <title language="fr" script="Latn" type="title-part">Partie 112: Grandeurs et unités</title>
151
+ <title language="fr" script="Latn" type="main">Vocabulaire Electrotechnique International (IEV) - Partie 112: Grandeurs et unités</title>
152
+ <title language="es" script="Latn" type="title-intro">Versión Oficial En español</title>
153
+ <title language="es" script="Latn" type="title-main">Vocabulario Electrotécnico Internacional. Parte 112: Magnitudes y unidades.</title>
154
+ <title language="es" script="Latn" type="main">Versión Oficial En español - Vocabulario Electrotécnico Internacional. Parte 112: Magnitudes y unidades.</title>
180
155
  <uri type="src">https://webstore.iec.ch/publication/162</uri>
181
156
  <uri type="obp">https://webstore.iec.ch/preview/info_iec60050-112{ed1.0}b.pdf</uri>
157
+ <docidentifier type="IEC" primary="true">IEC 60050-112:2010</docidentifier>
158
+ <docidentifier type="URN">urn:iec:std:iec:60050-112:2010-01:::</docidentifier>
182
159
  ...
183
160
  <ext schema-version="v1.0.0">
184
161
  <doctype>international-standard</doctype>
@@ -186,44 +163,43 @@ item.to_xml bibdata: true
186
163
  </ext>
187
164
  </bibdata>"
188
165
 
189
- item.to_xml note: [{ text: "Note", type: "note" }]
190
- => "<bibitem id="IEC60050-112-2010" type="standard" schema-version="v1.2.1">
166
+ item.to_xml note: [{ content: "Note", type: "note" }]
167
+ => "<bibitem id="IEC600501122010" type="standard" schema-version="v1.4.1">
191
168
  ...
192
- <note format="text/plain" type="note">Note</note>
169
+ <note type="note">Note</note>
193
170
  ...
194
171
  </bibitem>"
195
172
  ----
196
173
 
197
- === Typed links
174
+ === Typed source links
198
175
 
199
- Each IEC document has `src` type link and optional `obp` type link.
176
+ Each IEC document has `src` type link source and optional `obp` type link source.
200
177
 
201
178
  [source,ruby]
202
179
  ----
203
- item.link
204
- => [#<RelatonBib::TypedUri:0x00007ff1d50e9e20
205
- @content=#<Addressable::URI:0x2260 URI:https://webstore.iec.ch/publication/162>,
206
- @language=nil,
207
- @script=nil,
208
- @type="src">,
209
- #<RelatonBib::TypedUri:0x00007ff1d50e9498
210
- @content=#<Addressable::URI:0x2274 URI:https://webstore.iec.ch/preview/info_iec60050-112{ed1.0}b.pdf>,
211
- @language=nil,
212
- @script=nil,
213
- @type="obp">]
180
+ item.source[0].type
181
+ => "src"
182
+
183
+ item.source[0].content
184
+ => "https://webstore.iec.ch/publication/162"
185
+
186
+ item.source[1].type
187
+ => "obp"
188
+
189
+ item.source[1].content
190
+ => "https://webstore.iec.ch/preview/info_iec60050-112{ed1.0}b.pdf"
214
191
  ----
215
192
 
216
- === Create bibliographic item from Hash
193
+ === Create bibliographic item from XML or YAML
217
194
 
218
195
  [source,ruby]
219
196
  ----
220
- hash = YAML.load_file "spec/examples/hit.yaml"
221
- => {"schema-version"=>"v1.2.1",
222
- "id"=>"IEC61058-2-4-1995+AMD1-2003CSV",
197
+ Relaton::Iec::Item.from_xml File.read("spec/fixtures/bibitem.xml")
198
+ => #<Relaton::Iec::ItemData:0x000000012e5c9d90
223
199
  ...
224
200
 
225
- RelatonIec::IecBibliographicItem.from_hash hash
226
- => #<RelatonIec::IecBibliographicItem:0x00007fe16f032d40
201
+ Relaton::Iec::Item.from_yaml File.read("spec/fixtures/item.yaml")
202
+ => #<Relaton::Iec::ItemData:0x000000012f282460
227
203
  ...
228
204
  ----
229
205
 
@@ -255,28 +231,28 @@ URN structure: +
255
231
 
256
232
  For more information see https://github.com/relaton/relaton-iec/issues/22
257
233
 
258
- The method `RelatonIec.code_to_urn(code, lang)` converts document identifier to URN.
234
+ The method `Relaton::Iec.code_to_urn(code, lang)` converts document identifier to URN.
259
235
 
260
236
  * `code` is a document identifier
261
237
  * `lang` is a laguage code (optional). Examples: en, fr, en-fr etc.
262
238
 
263
239
  [source,ruby]
264
240
  ----
265
- RelatonIec.code_to_urn "IEC 60050-102:2007/AMD1:2017"
241
+ Relaton::Iec.code_to_urn "IEC 60050-102:2007/AMD1:2017"
266
242
  => "urn:iec:std:iec:60050-102:2007:::::amd:1:2017"
267
243
 
268
- RelatonIec.code_to_urn "IEC 60034-1:1969+AMD1:1977+AMD2:1979+AMD3:1980 CSV", "en-fr"
244
+ Relaton::Iec.code_to_urn "IEC 60034-1:1969+AMD1:1977+AMD2:1979+AMD3:1980 CSV", "en-fr"
269
245
  => "urn:iec:std:iec:60034-1:1969::csv:en-fr:plus:amd:1:1977:plus:amd:2:1979:plus:amd:3:1980"
270
246
  ----
271
247
 
272
- The method `RelatonIec.urn_to_code(urn)` converts URN to document identifier.
248
+ The method `Relaton::Iec.urn_to_code(urn)` converts URN to document identifier.
273
249
 
274
250
  [source,ruby]
275
251
  ----
276
- RelatonIec.urn_to_code "urn:iec:std:iec:60050-102:2007:::::amd:1:2017"
252
+ Relaton::Iec.urn_to_code "urn:iec:std:iec:60050-102:2007:::::amd:1:2017"
277
253
  => ["IEC 60050-102:2007/AMD1:2017", ""]
278
254
 
279
- RelatonIec.urn_to_code "urn:iec:std:iec:60034-1:1969::csv:en-fr:plus:amd:1:1977:plus:amd:2:1979:plus:amd:3:1980"
255
+ Relaton::Iec.urn_to_code "urn:iec:std:iec:60034-1:1969::csv:en-fr:plus:amd:1:1977:plus:amd:2:1979:plus:amd:3:1980"
280
256
  => ["IEC 60034-1:1969+AMD1:1977+AMD2:1979+AMD3:1980 CSV", "en-fr"]
281
257
  ----
282
258
 
@@ -286,7 +262,7 @@ This gem uses the https://bitbucket.org/sdo-hapi/api-specifications/wiki/Guideli
286
262
  - `iec-harmonized-all` - fetches all the documents using the API
287
263
  - `iec-harmonized-latest` - fetches the latest documents using the API
288
264
 
289
- The method `RelatonIec::DataFetcher.new(source, output: "data", format: "yaml").fetch` fetches IEC documents from the dataset and saves them to the `./data` folder in YAML format.
265
+ The method `Relaton::Iec::DataFetcher.fetch(source, output: "data", format: "yaml") fetches IEC documents from the dataset and saves them to the `./data` folder in YAML format.
290
266
  Arguments:
291
267
 
292
268
  - `source` - data source. Possible values: `iec-harmonized-all`, `iec-harmonized-latest` (default `iec-harmonized-latest`).
@@ -295,7 +271,7 @@ Arguments:
295
271
 
296
272
  [source,ruby]
297
273
  ----
298
- RelatonIec::DataFetcher.new.fetch
274
+ Relaton::Iec::DataFetcher.fetch
299
275
  Started at: 2022-06-23 09:36:55 +0200
300
276
  Stopped at: 2022-06-23 09:36:58 +0200
301
277
  Done in: 752 sec.
@@ -304,7 +280,7 @@ Done in: 752 sec.
304
280
 
305
281
  === Logging
306
282
 
307
- RelatonIec uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation.
283
+ Relaton::Iec uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation.
308
284
 
309
285
  == Development
310
286