relaton-calconnect 1.18.0 → 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 +5 -12
- data/grammars/basicdoc.rng +3 -0
- data/lib/relaton_calconnect/cc_bibliography.rb +5 -5
- data/lib/relaton_calconnect/data_fetcher.rb +4 -4
- data/lib/relaton_calconnect/document_type.rb +1 -1
- data/lib/relaton_calconnect/util.rb +1 -4
- data/lib/relaton_calconnect/version.rb +1 -1
- data/lib/relaton_calconnect/xml_parser.rb +4 -0
- data/lib/relaton_calconnect.rb +0 -1
- data/relaton_calconnect.gemspec +1 -1
- metadata +5 -6
- data/lib/relaton_calconnect/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: bd60ab3efc7281239f73f1d9ef07ff12d82700f910565143e0ef7d436f00f247
|
4
|
+
data.tar.gz: '0715995eb6c988e1aeacee5c35ab35814fb372814b2d8c5cae03beb8b79caa4f'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e23094e1664dc435c5fe3d429ed4c2c53a48fe0515cec37403e4a779679dcb6d3992f935f7dc05be47a8d3354a41764e18c8e9bf487d1fcd10bf15836aecfe4
|
7
|
+
data.tar.gz: 1487f11339c8085668ab09624b2e891a4517250edc552e161e9a4dcf71c50165ef9cd7b0e646476efc1fe669bc591f8a3e56dd8628ab9ad8594aff2863f38d68
|
data/README.adoc
CHANGED
@@ -23,24 +23,13 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
== Usage
|
25
25
|
|
26
|
-
===
|
27
|
-
|
28
|
-
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 `RelatonCalconnect.configure` block.
|
26
|
+
=== Search for a standard using keywords
|
29
27
|
|
30
28
|
[source,ruby]
|
31
29
|
----
|
32
30
|
require 'relaton_calconnect'
|
33
31
|
=> true
|
34
32
|
|
35
|
-
RelatonCalconnect.configure do |config|
|
36
|
-
config.logger.level = Logger::DEBUG
|
37
|
-
end
|
38
|
-
----
|
39
|
-
|
40
|
-
=== Search for a standard using keywords
|
41
|
-
|
42
|
-
[source,ruby]
|
43
|
-
----
|
44
33
|
hits = RelatonCalconnect::CcBibliography.search("CC/DIR 10005:2019")
|
45
34
|
=> <RelatonCalconnect::HitCollection:0x007f98e34a8bb0 @ref=CC/DIR 10005:2019 @fetched=false>
|
46
35
|
|
@@ -147,6 +136,10 @@ Done in: 20 sec.
|
|
147
136
|
=> nil
|
148
137
|
----
|
149
138
|
|
139
|
+
=== Logging
|
140
|
+
|
141
|
+
RelatonCalconnect 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.
|
142
|
+
|
150
143
|
== Development
|
151
144
|
|
152
145
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/grammars/basicdoc.rng
CHANGED
@@ -29,14 +29,14 @@ module RelatonCalconnect
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
Util.
|
32
|
+
Util.info "Fetching from Relaton repository ...", key: ref
|
33
33
|
result = search(code, year, opts) || (return nil)
|
34
34
|
ret = bib_results_filter(result, year)
|
35
35
|
if ret[:ret]
|
36
|
-
Util.
|
36
|
+
Util.info "Found: `#{ret[:ret].docidentifier.first.id}`", key: ref
|
37
37
|
ret[:ret]
|
38
38
|
else
|
39
|
-
Util.
|
39
|
+
Util.info "No found.", key: ref
|
40
40
|
fetch_ref_err(code, year, ret[:years])
|
41
41
|
end
|
42
42
|
end
|
@@ -75,10 +75,10 @@ module RelatonCalconnect
|
|
75
75
|
# @param missed_years [Array<Strig>]
|
76
76
|
def fetch_ref_err(code, year, missed_years)
|
77
77
|
# id = year ? "`#{code}` year `#{year}`" : code
|
78
|
-
# Util.
|
78
|
+
# Util.info "WARNING: No match found online for #{id}. " \
|
79
79
|
# "The code must be exactly like it is on the standards website."
|
80
80
|
unless missed_years.empty?
|
81
|
-
Util.
|
81
|
+
Util.info "There was no match for `#{year}`, though there " \
|
82
82
|
"were matches found for `#{missed_years.join('`, `')}`."
|
83
83
|
end
|
84
84
|
nil
|
@@ -67,9 +67,9 @@ module RelatonCalconnect
|
|
67
67
|
write_doc doc["docid"]["id"], bib
|
68
68
|
true
|
69
69
|
rescue StandardError => e
|
70
|
-
warn "Document: #{doc['docid']['id']}"
|
71
|
-
warn e.message
|
72
|
-
warn e.backtrace[0..5].join("\n")
|
70
|
+
Util.warn "Document: #{doc['docid']['id']}"
|
71
|
+
Util.warn e.message
|
72
|
+
Util.warn e.backtrace[0..5].join("\n")
|
73
73
|
false
|
74
74
|
end
|
75
75
|
|
@@ -81,7 +81,7 @@ module RelatonCalconnect
|
|
81
81
|
end
|
82
82
|
file = File.join @output, "#{docid.upcase.gsub(%r{[/\s:]}, '_')}.#{@ext}"
|
83
83
|
if @files.include? file
|
84
|
-
warn "#{file} exist"
|
84
|
+
Util.warn "#{file} exist"
|
85
85
|
else
|
86
86
|
@files << file
|
87
87
|
end
|
data/lib/relaton_calconnect.rb
CHANGED
data/relaton_calconnect.gemspec
CHANGED
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
28
28
|
|
29
29
|
spec.add_dependency "faraday", "~> 2.7.0"
|
30
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
30
|
+
spec.add_dependency "relaton-bib", "~> 1.19.0"
|
31
31
|
spec.add_dependency "relaton-index", "~> 0.2.0"
|
32
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-calconnect
|
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: faraday
|
@@ -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
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: relaton-index
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,7 +80,6 @@ files:
|
|
80
80
|
- lib/relaton_calconnect.rb
|
81
81
|
- lib/relaton_calconnect/cc_bibliographic_item.rb
|
82
82
|
- lib/relaton_calconnect/cc_bibliography.rb
|
83
|
-
- lib/relaton_calconnect/config.rb
|
84
83
|
- lib/relaton_calconnect/data_fetcher.rb
|
85
84
|
- lib/relaton_calconnect/document_type.rb
|
86
85
|
- lib/relaton_calconnect/hash_converter.rb
|
@@ -112,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
111
|
- !ruby/object:Gem::Version
|
113
112
|
version: '0'
|
114
113
|
requirements: []
|
115
|
-
rubygems_version: 3.3.
|
114
|
+
rubygems_version: 3.3.27
|
116
115
|
signing_key:
|
117
116
|
specification_version: 4
|
118
117
|
summary: 'RelatonIso: retrieve CC Standards for bibliographic use using the IsoBibliographicItem
|