relaton-cie 1.18.1 → 1.19.1
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_cie/cie_bibliography.rb +3 -3
- data/lib/relaton_cie/data_fetcher.rb +7 -5
- data/lib/relaton_cie/scrapper.rb +1 -1
- data/lib/relaton_cie/util.rb +1 -4
- data/lib/relaton_cie/version.rb +1 -1
- data/lib/relaton_cie.rb +0 -1
- data/relaton_cie.gemspec +1 -1
- metadata +4 -5
- data/lib/relaton_cie/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: 627b1bcb3a18832150a60b686359abb325bdaa25301642e70dcfbc42d002f18e
|
4
|
+
data.tar.gz: 3bdf913d421a7e46a36104b2a11a3ae64a4fd0c1f64ca683c9530eced7562a05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50b3583178756e980ef3cf7e22deff8a960d6d5a962d1c50ecad44cff4a051b4786e37d5dc9cccc891809cf7ca7115cc29d5783808db43b8af7ad2a184512378
|
7
|
+
data.tar.gz: aa3b3187b62363dda6e32c5aa174f63fa0a337b3384d5e84307d5dbaffa5799fa274de0cc461987271207af7e457391ba32a0310d92d4156afc0167ff79f6b5b
|
data/README.adoc
CHANGED
@@ -29,24 +29,13 @@ Or install it yourself as:
|
|
29
29
|
|
30
30
|
== Usage
|
31
31
|
|
32
|
-
===
|
33
|
-
|
34
|
-
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 `RelatonCie.configure` block.
|
32
|
+
=== Search document
|
35
33
|
|
36
34
|
[source,ruby]
|
37
35
|
----
|
38
36
|
require 'relaton_cie'
|
39
37
|
=> true
|
40
38
|
|
41
|
-
RelatonCie.configure do |config|
|
42
|
-
config.logger.level = Logger::DEBUG
|
43
|
-
end
|
44
|
-
----
|
45
|
-
|
46
|
-
=== Search document
|
47
|
-
|
48
|
-
[source,ruby]
|
49
|
-
----
|
50
39
|
item = RelatonCie::CieBibliography.get 'CIE 001-1980'
|
51
40
|
[relaton-cie] (CIE 001-1980) Fetching from Realton repository ...
|
52
41
|
[relaton-cie] (CIE 001-1980) Found: `CIE 001-1980`
|
@@ -127,6 +116,10 @@ Done in: 684 sec.
|
|
127
116
|
=> nil
|
128
117
|
----
|
129
118
|
|
119
|
+
=== Logging
|
120
|
+
|
121
|
+
RelatonCie 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.
|
122
|
+
|
130
123
|
== Development
|
131
124
|
|
132
125
|
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
@@ -15,12 +15,12 @@ module RelatonCie
|
|
15
15
|
# @param opts [Hash] not used
|
16
16
|
# @return [RelatonCie::BibliographicItem] Relaton of reference
|
17
17
|
def get(code, _year = nil, _opts = {})
|
18
|
-
Util.
|
18
|
+
Util.info "Fetching from Relaton repository ...", key: code
|
19
19
|
result = search code
|
20
20
|
if result
|
21
|
-
Util.
|
21
|
+
Util.info "Found: `#{result.docidentifier.first.id}`", key: code
|
22
22
|
else
|
23
|
-
Util.
|
23
|
+
Util.info "Not found.", key: code
|
24
24
|
end
|
25
25
|
result
|
26
26
|
end
|
@@ -169,8 +169,10 @@ module RelatonCie
|
|
169
169
|
id = bib.docidentifier[0].id.gsub(%r{[/\s\-:.]}, "_")
|
170
170
|
file = "#{@output}/#{id.upcase}.#{@format}"
|
171
171
|
if @files.include? file
|
172
|
-
warn
|
173
|
-
|
172
|
+
Util.warn do
|
173
|
+
"File #{file} exists. Docid: #{bib.docidentifier[0].id}\n" \
|
174
|
+
"Link: #{bib.link.detect { |l| l.type == 'src' }.content}"
|
175
|
+
end
|
174
176
|
else @files << file
|
175
177
|
end
|
176
178
|
index.add_or_update bib.docidentifier[0].id, file
|
@@ -199,9 +201,9 @@ module RelatonCie
|
|
199
201
|
)
|
200
202
|
write_file item
|
201
203
|
rescue StandardError => e
|
202
|
-
|
203
|
-
|
204
|
-
|
204
|
+
Util.error do
|
205
|
+
"Document: #{url}\n#{e.message}\n#{e.backtrace}"
|
206
|
+
end
|
205
207
|
end
|
206
208
|
|
207
209
|
def fetch(url)
|
data/lib/relaton_cie/scrapper.rb
CHANGED
data/lib/relaton_cie/util.rb
CHANGED
data/lib/relaton_cie/version.rb
CHANGED
data/lib/relaton_cie.rb
CHANGED
data/relaton_cie.gemspec
CHANGED
@@ -31,6 +31,6 @@ Gem::Specification.new do |spec|
|
|
31
31
|
|
32
32
|
spec.add_dependency "mechanize", "~> 2.10"
|
33
33
|
spec.add_dependency "parslet", "~> 2.0.0"
|
34
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
34
|
+
spec.add_dependency "relaton-bib", "~> 1.19.0"
|
35
35
|
spec.add_dependency "relaton-index", "~> 0.2.0"
|
36
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-cie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.19.1
|
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-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.19.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.19.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: relaton-index
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,7 +95,6 @@ files:
|
|
95
95
|
- lib/relaton_cie.rb
|
96
96
|
- lib/relaton_cie/bibliographic_item.rb
|
97
97
|
- lib/relaton_cie/cie_bibliography.rb
|
98
|
-
- lib/relaton_cie/config.rb
|
99
98
|
- lib/relaton_cie/data_fetcher.rb
|
100
99
|
- lib/relaton_cie/hash_converter.rb
|
101
100
|
- lib/relaton_cie/name_parser.rb
|