relaton-cen 1.20.2 → 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: 138f97cf5a761e41c5d9e38173a2930038fefa61950b220c9e5967c01f6cb89d
4
- data.tar.gz: 45516da4516514dcaefb3714bbdefcf8bc779249fa675bb8ef51dcfa08088e08
3
+ metadata.gz: f3eb5664fb1a3dc09e3edd51db089fc400db694dfad17f15f24f7c3a457afc52
4
+ data.tar.gz: 4a88caddce5b637865c5e9dc82858a8191daed465bfba20eaa383f7fb2f40854
5
5
  SHA512:
6
- metadata.gz: 0fc4b5e4e9ed4d13103b34e7208c9c15cdbbef82a54274ff7d6ef0b8cbe8a8a97773eb9d477d01f5109784af0d2bbc5bbe54c67f32eb870295f3b544c383e8e0
7
- data.tar.gz: 70839a7adfc5ac3723b65f8142d84c6766bebfe84c07c74a30cddbdfb096ec138cb6dd7d8256cce43eb31e27d1e960844ac4917acb256e0bb8bb0bb0ba8f0213
6
+ metadata.gz: a76e20816bb4c9d7b1139d33ec29ecbf47cd5b57003423ba69d123937b6290d23b71f2392d935e2baccbf514e6c9e37d12dbe6b8cd9468be2d3bd864c770bbf6
7
+ data.tar.gz: 5f2fd6480a13346910aee065d47eba8066c71f7633392a9a9186d3c8fc7bfb6c6d040f9c8610e6516aeab11d586569cea21967a863dd9001ff955d7a86d74747
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
- = RelatonCen retrieve CEN Standards for bibliographic use using the BibliographicItem model
1
+ = Relaton::Cen retrieve CEN Standards for bibliographic use using the BibliographicItem model
2
2
 
3
3
  image:https://img.shields.io/gem/v/relaton-cen.svg["Gem Version", link="https://rubygems.org/gems/relaton-cen"]
4
4
  image:https://github.com/relaton/relaton-cen/workflows/rake/badge.svg["Build Status", link="https://github.com/relaton/relaton-cen/actions?workflow=rake"]
@@ -39,20 +39,20 @@ For CENELEC standards, use references with the prefix `CEN/CLC`. For example, `C
39
39
 
40
40
  [source,ruby]
41
41
  ----
42
- require 'relaton_cen'
42
+ require 'relaton/cen'
43
43
  => true
44
44
 
45
- hit_collection = RelatonCen::CenBibliography.search("CEN ISO/TS 21003-7")
46
- => <RelatonCen::HitCollection:0x00000000017de0 @ref=ISO/TS 21003-7 @fetched=false>
45
+ hit_collection = Relaton::Cen::Bibliography.search("CEN ISO/TS 21003-7")
46
+ => <Relaton::Cen::HitCollection:0x00000000002560 @ref=CEN ISO/TS 21003-7 @fetched=false>
47
47
 
48
- item = hit_collection[0].fetch
49
- => #<RelatonIsoBib::IsoBibliographicItem:0x00007fadcd45fad8
48
+ item = hit_collection[0].item
49
+ => #<Relaton::Cen::ItemData:0x000000012a35c458
50
50
  ...
51
51
  ----
52
52
 
53
53
  === Get a standard by its code
54
54
 
55
- Use `RelatonCen::CenBibliography.get(ref, year, options)` to get a standard by its code.
55
+ Use `Relaton::Cen::Bibliography.get(ref, year, options)` to get a standard by its code.
56
56
 
57
57
  - `ref` is the standard code, e.g. `CEN ISO/TS 21003-7`
58
58
  - `year` is the year of the standard, e.g. `2019` (optional)
@@ -62,29 +62,31 @@ Use `RelatonCen::CenBibliography.get(ref, year, options)` to get a standard by i
62
62
  [source,ruby]
63
63
  ----
64
64
  # With year in reference
65
- RelatonCen::CenBibliography.get "EN 10160:1999"
66
- [relaton-cen] (EN 10160:1999) Fetching from standards.cencenelec.eu ...
67
- [relaton-cen] (EN 10160:1999) Found: `EN 10160:1999`
68
- => #<RelatonCen::BibliographicItem:0x0000000112d8b900
65
+ Relaton::Cen::Bibliography.get "EN 10160:1999"
66
+ [relaton-cen] INFO: (EN 10160:1999) Fetching from standards.cencenelec.eu ...
67
+ [relaton-cen] INFO: (EN 10160:1999) Found: `EN 10160:1999`
68
+ => #<Relaton::Cen::ItemData:0x00000001273d5b58
69
69
  ...
70
70
 
71
71
  # With a year as a separate argument
72
- RelatonCen::CenBibliography.get "EN 10160", "1999"
72
+ Relaton::Cen::Bibliography.get "EN 10160", "1999"
73
+ [relaton-cen] INFO: (EN 10160:1999) Fetching from standards.cencenelec.eu ...
74
+ [relaton-cen] INFO: (EN 10160:1999) Found: `EN 10160:1999`
75
+ => #<Relaton::Cen::ItemData:0x00000001274d58c8
76
+ ...
73
77
 
74
78
  # To get the most recent version of a standard by its code use reference without year
75
- > RelatonCen::CenBibliography.get "CEN/CLC Guide 6"
76
- [relaton-cen] (CEN/CLC Guide 6) Fetching from standards.cencenelec.eu ...
77
- [isoics] code not found in ICS list
78
- [relaton-cen] (CEN/CLC Guide 6) Found: `CEN/CLC Guide 6`
79
- => #<RelatonCen::BibliographicItem:0x0000000112d81680
79
+ Relaton::Cen::Bibliography.get "CEN/CLC Guide 6"
80
+ [relaton-cen] INFO: (CEN/CLC Guide 6) Fetching from standards.cencenelec.eu ...
81
+ [relaton-cen] INFO: (CEN/CLC Guide 6) Found: `CEN/CLC Guide 6:2014`
82
+ => #<Relaton::Cen::ItemData:0x000000012759a010
80
83
  ...
81
84
 
82
85
  # To keep the year in ID use `keep_year` option
83
86
  > RelatonCen::CenBibliography.get "CEN/CLC Guide 6", nil, keep_year: true
84
- [relaton-cen] (CEN/CLC Guide 6) Fetching from standards.cencenelec.eu ...
85
- [isoics] code not found in ICS list
86
- [relaton-cen] (CEN/CLC Guide 6) Found: `CEN/CLC Guide 6:2014`
87
- => #<RelatonCen::BibliographicItem:0x0000000112d8b400
87
+ [relaton-cen] INFO: (CEN/CLC Guide 6) Fetching from standards.cencenelec.eu ...
88
+ [relaton-cen] INFO: (CEN/CLC Guide 6) Found: `CEN/CLC Guide 6`
89
+ => #<Relaton::Cen::ItemData:0x000000012c629760
88
90
  ...
89
91
  ----
90
92
 
@@ -93,9 +95,9 @@ RelatonCen::CenBibliography.get "EN 10160", "1999"
93
95
  [source,ruby]
94
96
  ----
95
97
  item.to_xml
96
- => "<bibitem id="CENISO/TS21003-7-2019" type="standard" schema-version="v1.2.1">
97
- <fetched>2022-12-03</fetched>
98
- <title type="title-main" format="text/plain" language="en" script="Latn">Multilayer piping systems for hot and cold water installations inside buildings</title>
98
+ => "<bibitem id="CENISOTS2100372019" type="standard" schema-version="v1.4.1">
99
+ <fetched>2025-12-15</fetched>
100
+ <title language="en" script="Latn" type="title-main">Multilayer piping systems for hot and cold water installations inside buildings</title>
99
101
  ...
100
102
  </bibitem>"
101
103
  ----
@@ -106,54 +108,51 @@ element added.
106
108
  [source,ruby]
107
109
  ----
108
110
  item.to_xml bibdata: true
109
- => "<bibdata type="standard" schema-version="v1.2.1">
110
- <fetched>2022-12-03</fetched>
111
- <title type="title-main" format="text/plain" language="en" script="Latn">Multilayer piping systems for hot and cold water installations inside buildings</title>
111
+ => "<bibdata type="standard" schema-version="v1.4.1">
112
+ <fetched>2025-12-15</fetched>
113
+ <title language="en" script="Latn" type="title-main">Multilayer piping systems for hot and cold water installations inside buildings</title>
112
114
  ...
113
115
  <ext schema-version="v1.0.1">
114
116
  <doctype>international-standard</doctype>
115
- ...
117
+ <flavor>cen</flavor>
118
+ <ics>
119
+ <code>23.040.20</code>
120
+ <text>Plastics pipes</text>
121
+ </ics>
122
+ <ics>
123
+ <code>91.140.60</code>
124
+ <text>Water supply systems</text>
125
+ </ics>
126
+ <structuredidentifier>
127
+ <agency>CEN</agency>
128
+ <docnumber>21003</docnumber>
129
+ <partnumber>7</partnumber>
130
+ </structuredidentifier>
116
131
  </ext>
117
132
  </bibdata>"
118
133
  ----
119
134
 
120
135
  === Typed links
121
136
 
122
- Each CEN document has `src` type link.
137
+ Each CEN document has `src` type source.
123
138
 
124
139
  [source,ruby]
125
140
  ----
126
- item.link
127
- => [#<RelatonBib::TypedUri:0x00007f865cf9a328 @content=#<Addressable::URI:0xbea0 URI:https://standards.cencenelec.eu/dyn/www/f?p=CEN:110:0::::FSP_PROJECT,FSP_ORG_ID:68120,6137&cs=19764D9131733FD9E70037E7A6E6740B2>, @type="src">]
128
- ----
129
-
130
- === Get code, and year
131
-
132
- [source,ruby]
133
- ----
134
- RelatonCen::CenBibliography.get "CEN ISO/TS 21003-7:2019"
135
- [relaton-cen] (CEN ISO/TS 21003-7) Fetching from standards.cencenelec.eu ...
136
- [relaton-cen] (CEN ISO/TS 21003-7) Found: CEN `ISO/TS 21003-7:2019`
137
- => #<RelatonIsoBib::IsoBibliographicItem:0x00007fadcd596c58
138
- ...
139
-
140
- RelatonCen::CenBibliography.get "CEN ISO/TS 21003-7", "2019"
141
- [relaton-cen] (CEN ISO/TS 21003-7) Fetching from standards.cencenelec.eu ...
142
- [relaton-cen] (CEN ISO/TS 21003-7) Found: CEN `ISO/TS 21003-7:2019`
143
- => #<RelatonIsoBib::IsoBibliographicItem:0x00007fadcd5df9f8
144
- ...
141
+ item.source
142
+ => [#<Relaton::Bib::Uri:0x0000000126a80878
143
+ @content="https://standards.cencenelec.eu/ords/f?p=CEN:110:::::FSP_PROJECT,FSP_ORG_ID:68120,6137&cs=1AD0C0DDDE4500D5B9BFB0BCE76BB63F9",
144
+ @language=nil,
145
+ @locale=nil,
146
+ @script=nil,
147
+ @type="src">]
145
148
  ----
146
149
 
147
150
  === Create bibliographic item form YAML
148
151
 
149
152
  [source,ruby]
150
153
  ----
151
- hash = YAML.load_file 'spec/fixtures/bibdata.yaml'
152
- => {"id"=>"CENISO/TS21003-7-2019",
153
- ...
154
-
155
- RelatonCen::BibliographicItem.from_hash hash
156
- => #<RelatonCen::BibliographicItem:0x00007f9d0118cb58
154
+ Relaton::Cen::Item.from_yaml File.read('spec/fixtures/item.yaml')
155
+ => #<Relaton::Cen::ItemData:0x00000001292f71d0
157
156
  ...
158
157
  ----
159
158
 
@@ -161,8 +160,8 @@ hash = YAML.load_file 'spec/fixtures/bibdata.yaml'
161
160
 
162
161
  [source,ruby]
163
162
  ----
164
- RelatonCen::XMLParser.from_xml File.read("spec/fixtures/bibdata.xml", encoding: "UTF-8")
165
- => #<RelatonCen::BibliographicItem:0x00007f9cf12bc5b0
163
+ Relaton::Cen::Item.from_xml File.read("spec/fixtures/bibdata.xml")
164
+ => #<Relaton::Cen::ItemData:0x0000000129353fc0
166
165
  ...
167
166
  ----
168
167
 
data/bin/console CHANGED
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "bundler/setup"
5
- require "relaton_cen"
5
+ require "relaton/cen"
6
6
 
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.