relaton-bsi 1.16.1 → 1.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +16 -5
- data/lib/relaton_bsi/bsi_bibliography.rb +9 -5
- data/lib/relaton_bsi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: beee0d1d60affb54c0d473077b8b792271bd773a89462aa9668794a47c8c37b4
|
4
|
+
data.tar.gz: 3f4a940e53481c52b6ff1d155a0ae1e9cccdc20a768753d59efb042beed7a80b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d890a38ea4d5ba876d4e6e8497347e45bb3067aca5796f8c574a8d7de9e337836655158d9f3ce1ed1d1687c923750ee570b80994ea238be9e32df156bc6fd808
|
7
|
+
data.tar.gz: c12c4a02bd22a07cd63378de4a2a701df11e119e12717e8e28d74b7c6ce453712c123b8b55a10675f3b78e7bce23aebbc0187bb79ef5366e43aab0de46e7e3a5
|
data/README.adoc
CHANGED
@@ -27,13 +27,24 @@ Or install it yourself as:
|
|
27
27
|
|
28
28
|
== Usage
|
29
29
|
|
30
|
-
===
|
30
|
+
=== Configuration
|
31
|
+
|
32
|
+
Configuration is optional. The available option is `logger` which is a `Logger` instance. By default, the logger is `Logger.new($stderr)` with `Logger::WARN` level. To change the logger level, use `RelatonBsi.configure` block.
|
31
33
|
|
32
34
|
[source,ruby]
|
33
35
|
----
|
34
36
|
require 'relaton_bsi'
|
35
37
|
=> true
|
36
38
|
|
39
|
+
RelatonBsi.configure do |config|
|
40
|
+
config.logger.level = Logger::DEBUG
|
41
|
+
end
|
42
|
+
----
|
43
|
+
|
44
|
+
=== Search for a standard using keywords
|
45
|
+
|
46
|
+
[source,ruby]
|
47
|
+
----
|
37
48
|
hit_collection = RelatonBsi::BsiBibliography.search("BS EN ISO 8848")
|
38
49
|
=> <RelatonBsi::HitCollection:0x007fead49fe1f8 @ref=BS EN ISO 8848 @fetched=false>
|
39
50
|
|
@@ -89,14 +100,14 @@ item.to_xml bibdata: true
|
|
89
100
|
[source,ruby]
|
90
101
|
----
|
91
102
|
RelatonBsi::BsiBibliography.get "BS EN ISO 8848:2021"
|
92
|
-
[relaton-bsi] (
|
93
|
-
[relaton-bsi] (
|
103
|
+
[relaton-bsi] (BS EN ISO 8848:2021) Fetching from shop.bsigroup.com ...
|
104
|
+
[relaton-bsi] (BS EN ISO 8848:2021) Found: `BS EN ISO 8848:2021`
|
94
105
|
=> #<RelatonBsi::BsiBibliographicItem:0x007feb14814ca8
|
95
106
|
...
|
96
107
|
|
97
108
|
RelatonBsi::BsiBibliography.get "BS EN ISO 8848", "2021"
|
98
|
-
[relaton-bsi] (
|
99
|
-
[relaton-bsi] (
|
109
|
+
[relaton-bsi] (BS EN ISO 8848) Fetching from shop.bsigroup.com ...
|
110
|
+
[relaton-bsi] (BS EN ISO 8848) Found: `BS EN ISO 8848:2021`
|
100
111
|
=> #<RelatonBsi::BsiBibliographicItem:0x007feaf59188a8
|
101
112
|
...
|
102
113
|
----
|
@@ -58,8 +58,8 @@ module RelatonBsi
|
|
58
58
|
Util.warn "WARNING: no match found online for `#{id}`. " \
|
59
59
|
"The code must be exactly like it is on the standards website."
|
60
60
|
unless missed_years.empty?
|
61
|
-
Util.warn "
|
62
|
-
"were matches found for `#{missed_years.join('`, `')}`.
|
61
|
+
Util.warn "There was no match for `#{year}`, though there " \
|
62
|
+
"were matches found for `#{missed_years.join('`, `')}`."
|
63
63
|
end
|
64
64
|
# if /\d-\d/.match? code
|
65
65
|
# warn "[relaton-bsi] The provided document part may not exist, or "\
|
@@ -82,8 +82,11 @@ module RelatonBsi
|
|
82
82
|
#
|
83
83
|
def search_filter(code)
|
84
84
|
cp = code_parts code
|
85
|
-
Util.warn "(#{code})
|
86
|
-
|
85
|
+
Util.warn "(#{code}) Fetching from shop.bsigroup.com ..."
|
86
|
+
unless cp
|
87
|
+
Util.warn "(#{code}) Could not parse the reference"
|
88
|
+
return []
|
89
|
+
end
|
87
90
|
|
88
91
|
search(code).filter_hits!(cp)
|
89
92
|
end
|
@@ -112,9 +115,10 @@ module RelatonBsi
|
|
112
115
|
result = search_filter(code) || return
|
113
116
|
ret = results_filter(result, year)
|
114
117
|
if ret[:ret]
|
115
|
-
Util.warn "(#{code})
|
118
|
+
Util.warn "(#{code}) Found: `#{ret[:ret].docidentifier.first&.id}`"
|
116
119
|
ret[:ret]
|
117
120
|
else
|
121
|
+
Util.warn "(#{code}) No found"
|
118
122
|
fetch_ref_err(code, year, ret[:years])
|
119
123
|
end
|
120
124
|
end
|
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.16.
|
4
|
+
version: 1.16.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: algolia
|