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 +4 -4
- data/README.adoc +4 -12
- data/grammars/basicdoc.rng +3 -0
- data/lib/relaton_cen/cen_bibliography.rb +4 -4
- data/lib/relaton_cen/util.rb +1 -4
- data/lib/relaton_cen/version.rb +1 -1
- data/lib/relaton_cen.rb +8 -9
- data/relaton_cen.gemspec +1 -1
- metadata +4 -5
- data/lib/relaton_cen/config.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c1cf521b45c1bc14c2b07022c245cac43d93d26ef72321db1f2cc62454ccd47
|
4
|
+
data.tar.gz: 6dffbdda4ab6263301982eeefbf1d79a18d94752142be1d8ef4249109dd8a6a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
===
|
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
|
|
data/grammars/basicdoc.rng
CHANGED
@@ -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.
|
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.
|
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.
|
110
|
+
Util.info "Found: `#{bib.docidentifier.first&.id}`", key: ref
|
111
111
|
bib
|
112
112
|
else
|
113
|
-
Util.
|
113
|
+
Util.info "No found.", key: ref
|
114
114
|
fetch_ref_err(code, year, ret[:years])
|
115
115
|
end
|
116
116
|
end
|
data/lib/relaton_cen/util.rb
CHANGED
data/lib/relaton_cen/version.rb
CHANGED
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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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.
|
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.
|
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-
|
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.
|
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.
|
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
|