relaton-cie 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: 77819e2a66f24e47e3f6243e78a1039479df977d0ad72092a60578061b5910f7
4
- data.tar.gz: bd90bc7f6825c106daf9b8b850540616e0584ccaa184bb1585c7c707f6fe780f
3
+ metadata.gz: b4142b95abcc0f744193c75ef4e3ecb8b29948385646984a24fec705ad67a0f8
4
+ data.tar.gz: 7de37e66804ad9a8d1c499fee44074257c3644dd031728d736576d985aa4291f
5
5
  SHA512:
6
- metadata.gz: cd8746ae6e0a79a8b8529d5632b321ae5f6178278f95fe2c5d9490d72911a4b4c11636f020108ec457fb9e6fb597a9d705be81fafb7fbe41caa2812a9bbef353
7
- data.tar.gz: e121bbb8920727982b3d6732a276b278d72bfe30ee3bf74ed004234f9fe8d6c33119fd1e77acda206e629514069ce4a5a36c2db0855a4ea6dc9a55b901bdb1ce
6
+ metadata.gz: 07c7da3c87d3995c8bf4f75a80a05c4fe5d56263b8fb9b80c2ccc59c4d87accaa7b5875611f9a5c61185420c55f0db18a5372f6ada9fa2468d6ab05574100a44
7
+ data.tar.gz: d3bb0f001a1375c3e4a1db3f6ebf6dd4fcad476b0627d24c18b5f4bbb685d7592a6e5015d37308c15d3a105781cadef1e8abaf3b247c6d2040e578b73de5c81a
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,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.0".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.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
@@ -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