relaton-bsi 1.14.0 → 1.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_bsi/bsi_bibliographic_item.rb +16 -21
- data/lib/relaton_bsi/scrapper.rb +16 -1
- data/lib/relaton_bsi/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d1d349c3a444e58498a9de22311f8ac30a84053617638802ddb39919c66df6f
|
4
|
+
data.tar.gz: b7557ac28f3cf68ea359bc90cbc6f4f5e381b233924882868e8982c59defa6bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71fbb429501c5bc9156a2570f4816e73fc83fd2e29e9effbdffa8b4583e9e346aac3f25f18110d5b8d2b58487c98f43ef88e05372684ee92215002a5c7fe1594
|
7
|
+
data.tar.gz: 7743df4e7b460e4682f5d1bb7d8ad708bd280b12f4ff1114dfdded513e8cc6227551e28dd423be1e07fa4887d578b9edd5e37e520ac09de2690013d9543a9f9d
|
@@ -9,13 +9,7 @@ module RelatonBsi
|
|
9
9
|
|
10
10
|
SUBDOCTYPES = %w[specification method-of-test method-of-specifying vocabulary code-of-practice].freeze
|
11
11
|
|
12
|
-
# @params price_code [String, nil]
|
13
|
-
# @param cen_processing [Boolean, nil]
|
14
12
|
def initialize(**args) # rubocop:disable Metrics/AbcSize
|
15
|
-
# if args[:doctype] && !TYPES.include?(args[:doctype])
|
16
|
-
# warn "[relaton-bsi] WARNING: invalid doctype: #{args[:doctype]}"
|
17
|
-
# warn "[relaton-bsi] Allowed doctypes are: #{TYPES.join(', ')}"
|
18
|
-
# end
|
19
13
|
if args[:subdoctype] && !SUBDOCTYPES.include?(args[:subdoctype])
|
20
14
|
warn "[relaton-bsi] WARNING: invalid subdoctype: #{args[:subdoctype]}"
|
21
15
|
warn "[relaton-bsi] Allowed subdoctypes are: #{SUBDOCTYPES.join(', ')}"
|
@@ -37,21 +31,22 @@ module RelatonBsi
|
|
37
31
|
# @option opts [Boolean] :bibdata
|
38
32
|
# @option opts [String] :lang language
|
39
33
|
# @return [String] XML
|
40
|
-
def to_xml(**opts) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
34
|
+
# def to_xml(**opts) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
35
|
+
# super(**opts) do |b|
|
36
|
+
# if opts[:bibdata] && (has_ext_attrs? || price_code || !cen_processing.nil?)
|
37
|
+
# ext = b.ext do
|
38
|
+
# b.doctype doctype if doctype
|
39
|
+
# b.docsubtype subdoctype if subdoctype
|
40
|
+
# # b.horizontal horizontal unless horizontal.nil?
|
41
|
+
# editorialgroup&.to_xml b
|
42
|
+
# ics.each { |i| i.to_xml b }
|
43
|
+
# structuredidentifier&.to_xml b
|
44
|
+
# b.stagename stagename if stagename
|
45
|
+
# end
|
46
|
+
# ext["schema-version"] = ext_schema unless opts[:embeded]
|
47
|
+
# end
|
48
|
+
# end
|
49
|
+
# end
|
55
50
|
|
56
51
|
# @param hash [Hash]
|
57
52
|
# @return [RelatonBsi::BsiBibliographicItem]
|
data/lib/relaton_bsi/scrapper.rb
CHANGED
@@ -79,7 +79,7 @@ module RelatonBsi
|
|
79
79
|
language: ["en"],
|
80
80
|
script: ["Latn"],
|
81
81
|
title: fetch_titles(hit.hit[:title]),
|
82
|
-
doctype: hit
|
82
|
+
doctype: fetch_doctype(hit),
|
83
83
|
docstatus: fetch_status(hit.hit[:status]),
|
84
84
|
ics: fetch_ics(hit.hit[:ics]),
|
85
85
|
date: fetch_dates(hit),
|
@@ -174,6 +174,21 @@ module RelatonBsi
|
|
174
174
|
RelatonBib::TypedTitleString.from_string title, "en", "Latn"
|
175
175
|
end
|
176
176
|
|
177
|
+
#
|
178
|
+
# Fetch doctype.
|
179
|
+
#
|
180
|
+
# @param [RelatonBsi::Hit] hit hit
|
181
|
+
#
|
182
|
+
# @return [String] doctype
|
183
|
+
#
|
184
|
+
def fetch_doctype(hit)
|
185
|
+
case hit.hit[:code]
|
186
|
+
when /(^|\s)Flex\s/ then "flex-standard"
|
187
|
+
when /(^|\s)PAS\s/ then "publicly-available-specification"
|
188
|
+
else hit.hit[:doctype]
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
177
192
|
# Fetch dates
|
178
193
|
# @param hit [RelatonBsi:Hit]
|
179
194
|
# @return [Array<Hash>]
|
data/lib/relaton_bsi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-bsi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.14.
|
4
|
+
version: 1.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|
@@ -193,7 +193,7 @@ licenses:
|
|
193
193
|
metadata:
|
194
194
|
homepage_uri: https://github.com/metanorma/relaton-bsi
|
195
195
|
source_code_uri: https://github.com/metanorma/relaton-bsi
|
196
|
-
post_install_message:
|
196
|
+
post_install_message:
|
197
197
|
rdoc_options: []
|
198
198
|
require_paths:
|
199
199
|
- lib
|
@@ -208,8 +208,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
208
|
- !ruby/object:Gem::Version
|
209
209
|
version: '0'
|
210
210
|
requirements: []
|
211
|
-
rubygems_version: 3.
|
212
|
-
signing_key:
|
211
|
+
rubygems_version: 3.1.6
|
212
|
+
signing_key:
|
213
213
|
specification_version: 4
|
214
214
|
summary: 'RelatonBsi: retrieve BSI Standards for bibliographic use using the BibliographicItem
|
215
215
|
model'
|