relaton-cie 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0deac3779ff4dbc01a9d36816643325fa943b295b7b123ebeb7cbdad090d4992
4
- data.tar.gz: ffb9cd63167e41e9259f8302e674f2a23fced23a6b0361ecf1e55b00fe6960a0
3
+ metadata.gz: b4142b95abcc0f744193c75ef4e3ecb8b29948385646984a24fec705ad67a0f8
4
+ data.tar.gz: 7de37e66804ad9a8d1c499fee44074257c3644dd031728d736576d985aa4291f
5
5
  SHA512:
6
- metadata.gz: fdbcb9de17a34111038f68374e674774f2245a6086524130bacf06a63ab0b364b2b34f5c213a66e3e3ea2d03b9f92dd71a0b5a4472c116dd89693e8bd5c3a82d
7
- data.tar.gz: dd0550622ccec9e05dde4bbdc842147fbdced21e103d4c7a294fe2c0049d8a3dc8adf8ce5d7db43e2c6a6235168b1edc48bf0e9eabe9200b1036ee8963ae0f69
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.0".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
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
29
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ["lib"]
31
31
 
32
- spec.add_dependency "mechanize", "~> 2.8.0"
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.0
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-01-06 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
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.8.0
19
+ version: '2.10'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.8.0
26
+ version: '2.10'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: parslet
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -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
@@ -125,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
124
  - !ruby/object:Gem::Version
126
125
  version: '0'
127
126
  requirements: []
128
- rubygems_version: 3.3.26
127
+ rubygems_version: 3.3.27
129
128
  signing_key:
130
129
  specification_version: 4
131
130
  summary: 'RelatonEcma: retrieve CIE Standards for bibliographic use using the BibliographicItem
@@ -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