relaton-ecma 1.20.1 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 728e0c69d8e01b1e2618b103a3749b85668ded550dff7736780b6bf740ca5760
4
- data.tar.gz: 5f2a800eec2e0d43e1b002963c0fc0fba54d09e40360984cd861d7d87946c5df
3
+ metadata.gz: 25227ecdc3934df69612a531212d0646ee08dd246194f796d6f5bd54fd87b7f6
4
+ data.tar.gz: f2e36a4f3f59ca632fb35718bc75c7fa2470d86e7e234be4c93dd28a4b17fd5a
5
5
  SHA512:
6
- metadata.gz: 8b5ec489ed9e7eca324b68c4371e847aa88baea9a8b629502842df49d55fb6b33c9948e3755c2cde10eb345dbab4da31d528d7ee641f2a9fcd4e85731a71d31f
7
- data.tar.gz: 31eb6565deb80a3d42bd80ef7f9b4cad8017f5136492dc686afaa6d258f52141adc5faf9dd00d9447ea508309a383b206806e783f660e59318b60b8568d83855
6
+ metadata.gz: 49352ae2b3f43fcbcb8dc83da685198d2eeb6845b985c0f2148ffa2e2459df8e9a5e042bf003418fc942243cbef3311e1a240986a48c055dc451ae11b24748e0
7
+ data.tar.gz: 409281a068a0f1e7fec12ab54a8ad865e468be0e55b2d65028ebeeb4da09d96e606888b14133e00f8afbe7b6cf81d728a1cce2a642501a4f40da7f16d5f50157
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
- = RelatonEcma
1
+ = Relaton::Ecma
2
2
 
3
3
  image:https://img.shields.io/gem/v/relaton-ecma.svg["Gem Version", link="https://rubygems.org/gems/relaton-ecma"]
4
4
  image:https://github.com/relaton/relaton-ecma/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-ecma/actions?workflow=macos"]
@@ -8,7 +8,7 @@ image:https://codeclimate.com/github/relaton/relaton-ecma/badges/gpa.svg["Code C
8
8
  image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-ecma.svg["Pull Requests", link="https://github.com/relaton/relaton-ecma/pulls"]
9
9
  image:https://img.shields.io/github/commits-since/relaton/relaton-ecma/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-ecma/releases"]
10
10
 
11
- RelatonEcma is a Ruby gem that searches and fetches standards from the https://www.ecma-international.org[European Computer Manufacturers Association].
11
+ Relaton::Ecma is a Ruby gem that searches and fetches standards from the https://www.ecma-international.org[European Computer Manufacturers Association].
12
12
 
13
13
  == Installation
14
14
 
@@ -45,61 +45,61 @@ ECMA mementos have the following reference structure: `ECMA MEM/{YEAR}`. Where:
45
45
 
46
46
  [source,ruby]
47
47
  ----
48
- require 'relaton_ecma'
48
+ require 'relaton/ecma'
49
49
  => true
50
50
 
51
51
  # fetch ECMA standard
52
- item = RelatonEcma::EcmaBibliography.get 'ECMA-6'
53
- [relaton-ecma] (ECMA-6) Fetching from Relaton repository ...
54
- [relaton-ecma] (ECMA-6) Found: `ECMA-6`
55
- #<RelatonEcma::BibliographicItem:0x00007fc645b11c10
52
+ item = Relaton::Ecma::Bibliography.get 'ECMA-6'
53
+ [relaton-ecma] INFO: (ECMA-6) Fetching from Relaton repository ...
54
+ [relaton-ecma] INFO: (ECMA-6) Found: `ECMA-6`
55
+ => #<Relaton::Ecma::ItemData:0x000000012791d7a0
56
56
  ...
57
57
 
58
58
  # fetch ECMA standard with edition and volume
59
- RelatonEcma::EcmaBibliography.get "ECMA-269 ed3 vol2"
60
- [relaton-ecma] (ECMA-269 ed3 vol2) Fetching from Relaton repository ...
61
- [relaton-ecma] (ECMA-269 ed3 vol2) Found: `ECMA-269`
62
- => #<RelatonEcma::BibliographicItem:0x0000000106ac8210
59
+ Relaton::Ecma::Bibliography.get "ECMA-269 ed3 vol2"
60
+ [relaton-ecma] INFO: (ECMA-269 ed3 vol2) Fetching from Relaton repository ...
61
+ [relaton-ecma] INFO: (ECMA-269 ed3 vol2) Found: `ECMA-269`
62
+ => #<Relaton::Ecma::ItemData:0x0000000127b81410
63
63
  ...
64
64
 
65
65
  # fetch the last edition of ECMA standard
66
- bib = RelatonEcma::EcmaBibliography.get "ECMA-269"
67
- [relaton-ecma] (ECMA-269) Fetching from Relaton repository ...
68
- [relaton-ecma] (ECMA-269) Found: `ECMA-269`
69
- => #<RelatonEcma::BibliographicItem:0x000000010a408480
66
+ bib = Relaton::Ecma::Bibliography.get "ECMA-269"
67
+ [relaton-ecma] INFO: (ECMA-269) Fetching from Relaton repository ...
68
+ [relaton-ecma] INFO: (ECMA-269) Found: `ECMA-269`
69
+ => #<Relaton::Ecma::ItemData:0x0000000127cd0a00
70
70
  ...
71
71
 
72
72
  bib.edition.content
73
73
  => "9"
74
74
 
75
75
  # fetch the first volume of ECMA standard
76
- bib = RelatonEcma::EcmaBibliography.get "ECMA-269 ed3"
77
- [relaton-ecma] (ECMA-269 ed3) Fetching from Relaton repository ...
78
- [relaton-ecma] (ECMA-269 ed3) Found: `ECMA-269`
79
- => #<RelatonEcma::BibliographicItem:0x000000010a3ed0e0
76
+ bib = Relaton::Ecma::Bibliography.get "ECMA-269 ed3"
77
+ [relaton-ecma] INFO: (ECMA-269 ed3) Fetching from Relaton repository ...
78
+ [relaton-ecma] INFO: (ECMA-269 ed3) Found: `ECMA-269`
79
+ => #<Relaton::Ecma::ItemData:0x0000000127cf7808
80
80
  ...
81
81
 
82
- bib.extent.first.reference_from
82
+ bib.extent.first.locality.first.reference_from
83
83
  => "1"
84
84
 
85
85
  # fetch ECMA technical report
86
- RelatonEcma::EcmaBibliography.get 'ECMA TR/18'
87
- [relaton-ecma] (ECMA TR/18) Fetching from Relaton repository ...
88
- [relaton-ecma] (ECMA TR/18) Found: `ECMA TR/18`
89
- => #<RelatonEcma::BibliographicItem:0x00007fc645c00cc0
86
+ Relaton::Ecma::Bibliography.get 'ECMA TR/18'
87
+ [relaton-ecma] INFO: (ECMA TR/18) Fetching from Relaton repository ...
88
+ [relaton-ecma] INFO: (ECMA TR/18) Found: `ECMA TR/18`
89
+ => #<Relaton::Ecma::ItemData:0x0000000127cdc940
90
90
  ...
91
91
 
92
92
  # fetch ECMA memento
93
- RelatonEcma::EcmaBibliography.get "ECMA MEM/2021"
94
- [relaton-ecma] (ECMA MEM/2021) Fetching from Relaton repository ...
95
- [relaton-ecma] (ECMA MEM/2021) Found: `ECMA MEM/2021`
96
- => #<RelatonEcma::BibliographicItem:0x00007fc665b2f060
93
+ Relaton::Ecma::Bibliography.get "ECMA MEM/2021"
94
+ [relaton-ecma] INFO: (ECMA MEM/2021) Fetching from Relaton repository ...
95
+ [relaton-ecma] INFO: (ECMA MEM/2021) Found: `ECMA MEM/2021`
96
+ => #<Relaton::Ecma::ItemData:0x0000000127cf71c8
97
97
  ...
98
98
 
99
99
  # Return nil if a document doesn't exist.
100
- RelatonEcma::EcmaBibliography.get '1111'
101
- [relaton-ecma] (1111) Fetching from Relaton repository ...
102
- [relaton-ecma] (1111) Not found.
100
+ Relaton::Ecma::Bibliography.get '1111'
101
+ [relaton-ecma] INFO: (1111) Fetching from Relaton repository ...
102
+ [relaton-ecma] INFO: (1111) Not found.
103
103
  => nil
104
104
  ----
105
105
 
@@ -108,11 +108,11 @@ RelatonEcma::EcmaBibliography.get '1111'
108
108
  [source,ruby]
109
109
  ----
110
110
  item.to_xml
111
- => "<bibitem id="ECMA-6" type="standard" schema-version="v1.2.1">
112
- <fetched>2022-12-03</fetched>
113
- <title format="text/plain" language="en" script="Latn">7-bit coded character set</title>
114
- <uri type="src">https://www.ecma-international.org/publications-and-standards/standards/ecma-6/</uri>
115
- <uri type="doi">https://www.ecma-international.org/wp-content/uploads/ECMA-6_6th_edition_december_1991.pdf</uri>
111
+ => "<bibitem id="ECMA6" type="standard" schema-version="v1.4.1">
112
+ <fetched>2025-12-29</fetched>
113
+ <title language="en" script="Latn">7-bit coded character set</title>
114
+ <uri type="src">https://ecma-international.org/publications-and-standards/standards/ecma-6/</uri>
115
+ <uri type="pdf">https://ecma-international.org/wp-content/uploads/ECMA-6_6th_edition_december_1991.pdf</uri>
116
116
  <docidentifier type="ECMA" primary="true">ECMA-6</docidentifier>
117
117
  ...
118
118
  </bibitem>"
@@ -122,17 +122,18 @@ With `bibdata: true` option XML output wrapped with `bibdata` element and `ext`
122
122
  [source,ruby]
123
123
  ----
124
124
  item.to_xml bibdata: true
125
- "<bibdata type="standard" schema-version="v1.2.1">
126
- <fetched>2022-12-03</fetched>
127
- <title format="text/plain" language="en" script="Latn">7-bit coded character set</title>
128
- <uri type="src">https://www.ecma-international.org/publications-and-standards/standards/ecma-6/</uri>
129
- <uri type="doi">https://www.ecma-international.org/wp-content/uploads/ECMA-6_6th_edition_december_1991.pdf</uri>
130
- <docidentifier type="ECMA" primary="true">ECMA-6</docidentifier>
131
- ...
132
- <ext schema-version="v1.0.0">
133
- <doctype>document</doctype>
134
- </ext>
135
- </bibdata>"
125
+ => "<bibdata type="standard" schema-version="v1.4.1">
126
+ <fetched>2025-12-29</fetched>
127
+ <title language="en" script="Latn">7-bit coded character set</title>
128
+ <uri type="src">https://ecma-international.org/publications-and-standards/standards/ecma-6/</uri>
129
+ <uri type="pdf">https://ecma-international.org/wp-content/uploads/ECMA-6_6th_edition_december_1991.pdf</uri>
130
+ <docidentifier type="ECMA" primary="true">ECMA-6</docidentifier>
131
+ ...
132
+ <ext schema-version="v1.0.0">
133
+ <doctype>document</doctype>
134
+ <flavor>ecma</flavor>
135
+ </ext>
136
+ </bibdata>"
136
137
  ----
137
138
 
138
139
  === Typed links
@@ -141,17 +142,23 @@ Each ECMA document has `src` and `doi` link types.
141
142
 
142
143
  [source,ruby]
143
144
  ----
144
- item.link
145
- => [#<RelatonBib::TypedUri:0x00007fb16ecde728 @content=#<Addressable::URI:0x7e4 URI:https://www.ecma-international.org/publications-and-standards/standards/ecma-6/>, @type="src">,
146
- #<RelatonBib::TypedUri:0x00007fb16ecde070 @content=#<Addressable::URI:0x7f8 URI:https://www.ecma-international.org/wp-content/uploads/ECMA-6_6th_edition_december_1991.pdf>, @type="doi">]
145
+ item.source
146
+ =>
147
+ [#<Relaton::Bib::Uri:0x00000001278dc5e8 @content="https://ecma-international.org/publications-and-standards/standards/ecma-6/", @language=nil, @locale=nil, @script=nil, @type="src">,
148
+ #<Relaton::Bib::Uri:0x00000001278dc188
149
+ @content="https://ecma-international.org/wp-content/uploads/ECMA-6_6th_edition_december_1991.pdf",
150
+ @language=nil,
151
+ @locale=nil,
152
+ @script=nil,
153
+ @type="pdf">]
147
154
  ----
148
155
 
149
156
  === Parse a file locally
150
157
 
151
158
  [source,ruby]
152
159
  ----
153
- item = RelatonEcma::XMLParser.from_xml File.read("spec/fixtures/bibdata.xml")
154
- => #<RelatonEcma::BibliographicItem:0x00007fc645b3bf10
160
+ item = Relaton::Ecma::Item.from_xml File.read("spec/fixtures/bibdata.xml")
161
+ => #<Relaton::Ecma::ItemData:0x0000000127cbb1a0
155
162
  ...
156
163
  ----
157
164
 
@@ -159,7 +166,7 @@ item = RelatonEcma::XMLParser.from_xml File.read("spec/fixtures/bibdata.xml")
159
166
 
160
167
  This gem uses a https://github.com/relaton/relaton-data-ecma[ecma-standards] prefetched dataset as a data source. The dataset contains documents from ECMA https://www.ecma-international.org/publications-and-standards/standards/[Standards], https://www.ecma-international.org/publications-and-standards/technical-reports/[Technical Reports], and https://www.ecma-international.org/publications-and-standards/mementos/[Mementos] pages.
161
168
 
162
- The method `RelatonEcma::DataFetcher.new(output: "data", format: "yaml").fetch` fetches all the documents from the pages and saves them to the `./data` folder in YAML format.
169
+ The method `Relaton::Ecma::DataFetcher.new(output, format).fetch` fetches all the documents from the pages and saves them to the `./data` folder in YAML format.
163
170
  Arguments:
164
171
 
165
172
  - `output` - folder to save documents (default './data').
@@ -167,7 +174,7 @@ Arguments:
167
174
 
168
175
  [source,ruby]
169
176
  ----
170
- RelatonEcma::DataFetcher.new.fetch
177
+ Relaton::Ecma::DataFetcher.new.fetch
171
178
  Started at: 2022-06-23 09:36:55 +0200
172
179
  Stopped at: 2022-06-23 09:36:58 +0200
173
180
  Done in: 752 sec.
@@ -176,7 +183,7 @@ Done in: 752 sec.
176
183
 
177
184
  === Logging
178
185
 
179
- RelatonEcma 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.
186
+ Relaton::Ecma 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.
180
187
 
181
188
  == Development
182
189