relaton-cen 1.16.4 → 1.16.5

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: c14f063a878f0d9c6267fd71b74fad6cb2500e91c3bdfded0f3ccf3b1c920b76
4
- data.tar.gz: b744cd4445f3e322e07fa8a37cf5733efa9028a1a03269ad6992ef01f435abeb
3
+ metadata.gz: 6079f69f9e58fedf031d2d85222e60d80f8f058aa983e513ce3fa99870c161ce
4
+ data.tar.gz: 2d9452d07006067e4493307b2b7250b9509566f8e76e9e61a850b1ab2c01cba4
5
5
  SHA512:
6
- metadata.gz: 3fd672f854de8a98a20c471940b49e55b47a0b1a73f0d243bcbbc3de41b6899130201beefa6bc49995cf605d3a365959e6172336a07fd04e484e8c8841686462
7
- data.tar.gz: f89b16fb321f85aada7534f1b6b06b398170e06161992ef291a8a97e47c6b8da73ee50d6454c977b1bc4c6e473dbcfaa37e86fa66d6ebbfbb474158451b964b0
6
+ metadata.gz: 3b28ece46a42aef8b61eb82557a8dfe9e8ff577c2e5e69a72a2e30de3792cbc321b35e75ad3294e71f01579776d8ac3a5e2ccbd613136e4416d488c1b607b57d
7
+ data.tar.gz: 823edec6ef243205b5e58c3ecb2881f4ad0469f41d3ba9983c3fb7f0a1716b4be935c76227a20f7a912f42b7c841391424a3dfa5c69f8aa3485556f57afadc95
data/README.adoc CHANGED
@@ -35,13 +35,24 @@ $ gem install relaton-cen
35
35
 
36
36
  For CENELEC standards, use references with the prefix `CEN/CLC`. For example, `CEN/CLC Guide 6`.
37
37
 
38
- === Search for a standard using keywords
38
+ === Configuration
39
+
40
+ 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 `RelatonCen.configure` block.
39
41
 
40
42
  [source,ruby]
41
43
  ----
42
44
  require 'relaton_cen'
43
45
  => true
44
46
 
47
+ RelatonCen.configure do |config|
48
+ config.logger.level = Logger::DEBUG
49
+ end
50
+ ----
51
+
52
+ === Search for a standard using keywords
53
+
54
+ [source,ruby]
55
+ ----
45
56
  hit_collection = RelatonCen::CenBibliography.search("CEN ISO/TS 21003-7")
46
57
  => <RelatonCen::HitCollection:0x00000000017de0 @ref=ISO/TS 21003-7 @fetched=false>
47
58
 
@@ -63,8 +74,8 @@ Use `RelatonCen::CenBibliography.get(ref, year, options)` to get a standard by i
63
74
  ----
64
75
  # With year in reference
65
76
  RelatonCen::CenBibliography.get "EN 10160:1999"
66
- [relaton-cen] (EN 10160:1999) fetching...
67
- [relaton-cen] (EN 10160:1999) found `EN 10160:1999`
77
+ [relaton-cen] (EN 10160:1999) Fetching from standards.cencenelec.eu ...
78
+ [relaton-cen] (EN 10160:1999) Found: `EN 10160:1999`
68
79
  => #<RelatonCen::BibliographicItem:0x0000000112d8b900
69
80
  ...
70
81
 
@@ -73,17 +84,17 @@ RelatonCen::CenBibliography.get "EN 10160", "1999"
73
84
 
74
85
  # To get the most recent version of a standard by its code use reference without year
75
86
  > RelatonCen::CenBibliography.get "CEN/CLC Guide 6"
76
- [relaton-cen] (CEN/CLC Guide 6) fetching...
87
+ [relaton-cen] (CEN/CLC Guide 6) Fetching from standards.cencenelec.eu ...
77
88
  [isoics] code not found in ICS list
78
- [relaton-cen] (CEN/CLC Guide 6) found `CEN/CLC Guide 6`
89
+ [relaton-cen] (CEN/CLC Guide 6) Found: `CEN/CLC Guide 6`
79
90
  => #<RelatonCen::BibliographicItem:0x0000000112d81680
80
91
  ...
81
92
 
82
93
  # To keep the year in ID use `keep_year` option
83
94
  > RelatonCen::CenBibliography.get "CEN/CLC Guide 6", nil, keep_year: true
84
- [relaton-cen] (CEN/CLC Guide 6) fetching...
95
+ [relaton-cen] (CEN/CLC Guide 6) Fetching from standards.cencenelec.eu ...
85
96
  [isoics] code not found in ICS list
86
- [relaton-cen] (CEN/CLC Guide 6) found `CEN/CLC Guide 6:2014`
97
+ [relaton-cen] (CEN/CLC Guide 6) Found: `CEN/CLC Guide 6:2014`
87
98
  => #<RelatonCen::BibliographicItem:0x0000000112d8b400
88
99
  ...
89
100
  ----
@@ -132,14 +143,14 @@ item.link
132
143
  [source,ruby]
133
144
  ----
134
145
  RelatonCen::CenBibliography.get "CEN ISO/TS 21003-7:2019"
135
- [relaton-cen] (CEN ISO/TS 21003-7) fetching...
136
- [relaton-cen] (CEN ISO/TS 21003-7) found CEN `ISO/TS 21003-7:2019`
146
+ [relaton-cen] (CEN ISO/TS 21003-7) Fetching from standards.cencenelec.eu ...
147
+ [relaton-cen] (CEN ISO/TS 21003-7) Found: CEN `ISO/TS 21003-7:2019`
137
148
  => #<RelatonIsoBib::IsoBibliographicItem:0x00007fadcd596c58
138
149
  ...
139
150
 
140
151
  RelatonCen::CenBibliography.get "CEN ISO/TS 21003-7", "2019"
141
- [relaton-cen] (CEN ISO/TS 21003-7) fetching...
142
- [relaton-cen] (CEN ISO/TS 21003-7) found CEN `ISO/TS 21003-7:2019`
152
+ [relaton-cen] (CEN ISO/TS 21003-7) Fetching from standards.cencenelec.eu ...
153
+ [relaton-cen] (CEN ISO/TS 21003-7) Found: CEN `ISO/TS 21003-7:2019`
143
154
  => #<RelatonIsoBib::IsoBibliographicItem:0x00007fadcd5df9f8
144
155
  ...
145
156
  ----
@@ -46,12 +46,12 @@ module RelatonCen
46
46
  private
47
47
 
48
48
  def fetch_ref_err(code, year, missed_years) # rubocop:disable Metrics/MethodLength
49
- id = year ? "#{code}:#{year}" : code
50
- Util.warn "WARNING: no match found online for `#{id}`. " \
51
- "The code must be exactly like it is on the standards website."
49
+ # id = year ? "#{code}:#{year}" : code
50
+ # Util.warn "WARNING: No match found online for `#{id}`. " \
51
+ # "The code must be exactly like it is on the standards website."
52
52
  unless missed_years.empty?
53
- Util.warn "(There was no match for `#{year}`, though there " \
54
- "were matches found for `#{missed_years.join('`, `')}`.)"
53
+ Util.warn "There was no match for `#{year}`, though there " \
54
+ "were matches found for `#{missed_years.join('`, `')}`."
55
55
  end
56
56
  # if /\d-\d/.match? code
57
57
  # warn "[relaton-cen] The provided document part may not exist, or "\
@@ -101,14 +101,15 @@ module RelatonCen
101
101
 
102
102
  def bib_get(code, year, opts) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/MethodLength
103
103
  ref = year.nil? || code.match?(/:\d{4}/) ? code : "#{code}:#{year}"
104
- Util.warn "(#{ref}) fetching..."
104
+ Util.warn "(#{ref}) Fetching from standards.cencenelec.eu ..."
105
105
  result = search_filter(code) || return
106
106
  ret = isobib_results_filter(result, year)
107
107
  if ret[:ret]
108
108
  bib = year || opts[:keep_year] ? ret[:ret] : ret[:ret].to_most_recent_reference
109
- Util.warn "(#{ref}) found `#{bib.docidentifier.first&.id}`"
109
+ Util.warn "(#{ref}) Found: `#{bib.docidentifier.first&.id}`"
110
110
  bib
111
111
  else
112
+ Util.warn "(#{ref}) No found."
112
113
  fetch_ref_err(code, year, ret[:years])
113
114
  end
114
115
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonCen
4
- VERSION = "1.16.4"
4
+ VERSION = "1.16.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-cen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.4
4
+ version: 1.16.5
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: mechanize