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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 021f994bae1987a1d8dadd5b1c9425bdcb1aad9c69d62d3e4cb3d388d55bd6d7
4
- data.tar.gz: c96491e47dcd93b9281bd1deed2c5e0d1f72984c0aea401966e919dc4634b7a9
3
+ metadata.gz: beee0d1d60affb54c0d473077b8b792271bd773a89462aa9668794a47c8c37b4
4
+ data.tar.gz: 3f4a940e53481c52b6ff1d155a0ae1e9cccdc20a768753d59efb042beed7a80b
5
5
  SHA512:
6
- metadata.gz: e6b400c1153a40ede7766a6fce3be936114806d600d620eeaceb90ef521c439cb125ae3b53ca27df1dd536ed94366a33fce85e5aedfe0374ab0ebc7231a744e1
7
- data.tar.gz: 51bc43147ec74f564d0e37aa97c29622b46554e4d4adba720ef46f1271827e16efd4bd7c23a4c239151d9ff42c97cceee009d35c9a67c9358f967002549e960f
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
- === Search for a standard using keywords
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] ("BS EN ISO 8848:2021") fetching...
93
- [relaton-bsi] ("BS EN ISO 8848:2021") found BS EN ISO 8848:2021
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] ("BS EN ISO 8848") fetching...
99
- [relaton-bsi] ("BS EN ISO 8848") found BS EN ISO 8848:2021
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 "(There was no match for `#{year}`, though there " \
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}) fetching..."
86
- return [] unless cp
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}) found `#{ret[:ret].docidentifier.first&.id}`"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonBsi
4
- VERSION = "1.16.1"
4
+ VERSION = "1.16.2"
5
5
  end
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.1
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-09-20 00:00:00.000000000 Z
11
+ date: 2023-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: algolia