relaton-cen 1.18.1 → 1.19.0

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: f460a41043aba07a8ccd4b00edc6f4b5a9ee11d19b4063a33cd8f6b531f60cd9
4
- data.tar.gz: 3fa2143a6490a64d9b6011d0453bec3bf44245c15fe33e64dd407837762e1fd5
3
+ metadata.gz: 5c1cf521b45c1bc14c2b07022c245cac43d93d26ef72321db1f2cc62454ccd47
4
+ data.tar.gz: 6dffbdda4ab6263301982eeefbf1d79a18d94752142be1d8ef4249109dd8a6a4
5
5
  SHA512:
6
- metadata.gz: 3203cbfece71384aa1dd300d466b8e30f98b3723291074a021baad0ee6cd304b566c763c15af638d405f9c5984ddb9596d4cfea417ff9e375a7268205c0f4075
7
- data.tar.gz: 1da91851e10215b6fe045f2bcce09ddc0b23de2a67a2fa9cb82e47678cd257fea017dc8f6c349ca2503b7b7b4317461fd62fbcffbad819030b6a4d436e86a201
6
+ metadata.gz: ef2eb8b2ba57773d61ddc196d4f948a49b7e3fab66051661aa0918853ba50a5c2bec6f37157c5578f44b2cc30a6c295f66cdf233f0dd14378fd33104b5123332
7
+ data.tar.gz: d076629f32e60aea396c0b88a709a652f81db843ea75a3e8f01ef128e999273eb5ac4445bb89536351af158f041f7de5ad1dfb9d1ef2c14334915412f3a49ca6
data/README.adoc CHANGED
@@ -35,24 +35,13 @@ $ 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
- === 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.
38
+ === Search for a standard using keywords
41
39
 
42
40
  [source,ruby]
43
41
  ----
44
42
  require 'relaton_cen'
45
43
  => true
46
44
 
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
- ----
56
45
  hit_collection = RelatonCen::CenBibliography.search("CEN ISO/TS 21003-7")
57
46
  => <RelatonCen::HitCollection:0x00000000017de0 @ref=ISO/TS 21003-7 @fetched=false>
58
47
 
@@ -177,6 +166,9 @@ RelatonCen::XMLParser.from_xml File.read("spec/fixtures/bibdata.xml", encoding:
177
166
  ...
178
167
  ----
179
168
 
169
+ === Logging
170
+
171
+ RelatonCen uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation.
180
172
 
181
173
  == Development
182
174
 
@@ -244,6 +244,9 @@
244
244
  <data type="ID"/>
245
245
  </attribute>
246
246
  <attribute name="reviewer"/>
247
+ <optional>
248
+ <attribute name="type"/>
249
+ </optional>
247
250
  <optional>
248
251
  <attribute name="date">
249
252
  <data type="dateTime"/>
@@ -51,7 +51,7 @@ module RelatonCen
51
51
  # Util.warn "WARNING: No match found online for `#{id}`. " \
52
52
  # "The code must be exactly like it is on the standards website."
53
53
  unless missed_years.empty?
54
- Util.warn "There was no match for `#{year}`, though there " \
54
+ Util.info "There was no match for `#{year}`, though there " \
55
55
  "were matches found for `#{missed_years.join('`, `')}`."
56
56
  end
57
57
  # if /\d-\d/.match? code
@@ -102,15 +102,15 @@ module RelatonCen
102
102
 
103
103
  def bib_get(code, year, opts) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/MethodLength
104
104
  ref = year.nil? || code.match?(/:\d{4}/) ? code : "#{code}:#{year}"
105
- Util.warn "(#{ref}) Fetching from standards.cencenelec.eu ..."
105
+ Util.info "Fetching from standards.cencenelec.eu ...", key: ref
106
106
  result = search_filter(code) || return
107
107
  ret = isobib_results_filter(result, year)
108
108
  if ret[:ret]
109
109
  bib = year || opts[:keep_year] ? ret[:ret] : ret[:ret].to_most_recent_reference
110
- Util.warn "(#{ref}) Found: `#{bib.docidentifier.first&.id}`"
110
+ Util.info "Found: `#{bib.docidentifier.first&.id}`", key: ref
111
111
  bib
112
112
  else
113
- Util.warn "(#{ref}) No found."
113
+ Util.info "No found.", key: ref
114
114
  fetch_ref_err(code, year, ret[:years])
115
115
  end
116
116
  end
@@ -1,9 +1,6 @@
1
1
  module RelatonCen
2
2
  module Util
3
3
  extend RelatonBib::Util
4
-
5
- def self.logger
6
- RelatonCen.configuration.logger
7
- end
4
+ PROGNAME = "relaton-cen".freeze
8
5
  end
9
6
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonCen
4
- VERSION = "1.18.1"
4
+ VERSION = "1.19.0"
5
5
  end
data/lib/relaton_cen.rb CHANGED
@@ -5,15 +5,14 @@ require "mechanize"
5
5
  require "nokogiri"
6
6
  require "relaton_iso_bib"
7
7
  require_relative "relaton_cen/version"
8
- require "relaton_cen/config"
9
- require "relaton_cen/util"
10
- require "relaton_cen/biblographic_item"
11
- require "relaton_cen/scrapper"
12
- require "relaton_cen/hit_collection"
13
- require "relaton_cen/hit"
14
- require "relaton_cen/xml_parser"
15
- require "relaton_cen/hash_converter"
16
- require "relaton_cen/cen_bibliography"
8
+ require_relative "relaton_cen/util"
9
+ require_relative "relaton_cen/biblographic_item"
10
+ require_relative "relaton_cen/scrapper"
11
+ require_relative "relaton_cen/hit_collection"
12
+ require_relative "relaton_cen/hit"
13
+ require_relative "relaton_cen/xml_parser"
14
+ require_relative "relaton_cen/hash_converter"
15
+ require_relative "relaton_cen/cen_bibliography"
17
16
 
18
17
  module RelatonCen
19
18
  # Returns hash of XML greammar
data/relaton_cen.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.require_paths = ["lib"]
33
33
 
34
34
  spec.add_dependency "mechanize", "~> 2.10"
35
- spec.add_dependency "relaton-iso-bib", "~> 1.18.0"
35
+ spec.add_dependency "relaton-iso-bib", "~> 1.19.0"
36
36
 
37
37
  # For more information and examples about making a new gem, checkout our
38
38
  # guide at: https://bundler.io/guides/creating_gem.html
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.18.1
4
+ version: 1.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-19 00:00:00.000000000 Z
11
+ date: 2024-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.18.0
33
+ version: 1.19.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.18.0
40
+ version: 1.19.0
41
41
  description: 'RelatonCen: retrieve Cenelec Standards for bibliographic use using the
42
42
  IsoBibliographicItem model'
43
43
  email:
@@ -69,7 +69,6 @@ files:
69
69
  - lib/relaton_cen/biblographic_item.rb
70
70
  - lib/relaton_cen/cen_bibliography.rb
71
71
  - lib/relaton_cen/committees.yaml
72
- - lib/relaton_cen/config.rb
73
72
  - lib/relaton_cen/hash_converter.rb
74
73
  - lib/relaton_cen/hit.rb
75
74
  - lib/relaton_cen/hit_collection.rb
@@ -1,10 +0,0 @@
1
- module RelatonCen
2
- module Config
3
- include RelatonBib::Config
4
- end
5
- extend Config
6
-
7
- class Configuration < RelatonBib::Configuration
8
- PROGNAME = "relaton-cen".freeze
9
- end
10
- end