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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77819e2a66f24e47e3f6243e78a1039479df977d0ad72092a60578061b5910f7
4
- data.tar.gz: bd90bc7f6825c106daf9b8b850540616e0584ccaa184bb1585c7c707f6fe780f
3
+ metadata.gz: 627b1bcb3a18832150a60b686359abb325bdaa25301642e70dcfbc42d002f18e
4
+ data.tar.gz: 3bdf913d421a7e46a36104b2a11a3ae64a4fd0c1f64ca683c9530eced7562a05
5
5
  SHA512:
6
- metadata.gz: cd8746ae6e0a79a8b8529d5632b321ae5f6178278f95fe2c5d9490d72911a4b4c11636f020108ec457fb9e6fb597a9d705be81fafb7fbe41caa2812a9bbef353
7
- data.tar.gz: e121bbb8920727982b3d6732a276b278d72bfe30ee3bf74ed004234f9fe8d6c33119fd1e77acda206e629514069ce4a5a36c2db0855a4ea6dc9a55b901bdb1ce
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
- === Configuration
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.
@@ -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"/>
@@ -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.warn "(#{code}) Fetching from Relaton repository ..."
18
+ Util.info "Fetching from Relaton repository ...", key: code
19
19
  result = search code
20
20
  if result
21
- Util.warn "(#{code}) Found: `#{result.docidentifier.first.id}`"
21
+ Util.info "Found: `#{result.docidentifier.first.id}`", key: code
22
22
  else
23
- Util.warn "(#{code}) Not found."
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 "File #{file} exists. Docid: #{bib.docidentifier[0].id}"
173
- warn "Link: #{bib.link.detect { |l| l.type == 'src' }.content}"
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
- warn "Document: #{url}"
203
- warn e.message
204
- warn e.backtrace
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)
@@ -1,6 +1,6 @@
1
1
  module RelatonCie
2
2
  module Scrapper
3
- ENDPOINT = "https://raw.githubusercontent.com/relaton/relaton-data-cie/master/".freeze
3
+ ENDPOINT = "https://raw.githubusercontent.com/relaton/relaton-data-cie/main/".freeze
4
4
  INDEX_FILE = "index-v1.yaml".freeze
5
5
 
6
6
  class << self
@@ -1,9 +1,6 @@
1
1
  module RelatonCie
2
2
  module Util
3
3
  extend RelatonBib::Util
4
-
5
- def self.logger
6
- RelatonCie.configuration.logger
7
- end
4
+ PROGNAME = "relaton-cie".freeze
8
5
  end
9
6
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonCie
2
- VERSION = "1.18.1".freeze
2
+ VERSION = "1.19.1".freeze
3
3
  end
data/lib/relaton_cie.rb CHANGED
@@ -5,7 +5,6 @@ require "relaton/index"
5
5
  require "relaton_bib"
6
6
  # require "relaton_bib/name_parser"
7
7
  require "relaton_cie/version"
8
- require "relaton_cie/config"
9
8
  require "relaton_cie/util"
10
9
  require "relaton_cie/bibliographic_item"
11
10
  require "relaton_cie/cie_bibliography"
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.18.0"
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.18.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-06-19 00:00:00.000000000 Z
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.18.0
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.18.0
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
@@ -1,10 +0,0 @@
1
- module RelatonCie
2
- module Config
3
- include RelatonBib::Config
4
- end
5
- extend Config
6
-
7
- class Configuration < RelatonBib::Configuration
8
- PROGNAME = "relaton-cie".freeze
9
- end
10
- end