relaton-calconnect 1.18.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ac031a527346a0fe8c93195fccb82c8f560916ceb677089b1d3acf4d734d816
4
- data.tar.gz: 69af72168bc0f701a12f45cf39e8a97e804451f7886cef5d35a897793144a79c
3
+ metadata.gz: bd60ab3efc7281239f73f1d9ef07ff12d82700f910565143e0ef7d436f00f247
4
+ data.tar.gz: '0715995eb6c988e1aeacee5c35ab35814fb372814b2d8c5cae03beb8b79caa4f'
5
5
  SHA512:
6
- metadata.gz: 4d44f4d1e9c069f95fc626bd624c09af792a40d201853bc508be30e2c91aba0c038e74a27f7fb3361bc94b64a44455ffd251de85c2272be81117ab9aa6e2ba72
7
- data.tar.gz: 8c1ec2768962fa88f10f40f3d01903bfb3fc09f99b2ac0eba8e77aa22bd3663738a271de669d811e58c835f24013122f6888e1c85cefc5ac68ae2bfe4288cf63
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
- === Configuration
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.
@@ -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"/>
@@ -29,14 +29,14 @@ module RelatonCalconnect
29
29
  end
30
30
  end
31
31
 
32
- Util.warn "(#{ref}) Fetching from Relaton repository ..."
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.warn "(#{ref}) Found: `#{ret[:ret].docidentifier.first.id}`"
36
+ Util.info "Found: `#{ret[:ret].docidentifier.first.id}`", key: ref
37
37
  ret[:ret]
38
38
  else
39
- Util.warn "(#{ref}) No found."
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.warn "WARNING: No match found online for #{id}. " \
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.warn "There was no match for `#{year}`, though there " \
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
@@ -12,7 +12,7 @@ module RelatonCalconnect
12
12
 
13
13
  def check_type(type)
14
14
  unless DOCTYPES.include? type
15
- Util.warn "WARNING: invalid doctype: `#{type}`"
15
+ Util.warn "Invalid doctype: `#{type}`"
16
16
  end
17
17
  end
18
18
  end
@@ -1,9 +1,6 @@
1
1
  module RelatonCalconnect
2
2
  module Util
3
3
  extend RelatonBib::Util
4
-
5
- def self.logger
6
- RelatonCalconnect.configuration.logger
7
- end
4
+ PROGNAME = "relaton-calconnect".freeze
8
5
  end
9
6
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonCalconnect
2
- VERSION = "1.18.0".freeze
2
+ VERSION = "1.19.0".freeze
3
3
  end
@@ -20,6 +20,10 @@ module RelatonCalconnect
20
20
  end
21
21
  RelatonBib::EditorialGroup.new eg if eg.any?
22
22
  end
23
+
24
+ def create_doctype(type)
25
+ DocumentType.new type: type.text, abbreviation: type[:abbreviation]
26
+ end
23
27
  end
24
28
  end
25
29
  end
@@ -1,7 +1,6 @@
1
1
  require "relaton/index"
2
2
  require "relaton_bib"
3
3
  require "relaton_calconnect/version"
4
- require "relaton_calconnect/config"
5
4
  require "relaton_calconnect/util"
6
5
  require "relaton_calconnect/document_type"
7
6
  require "relaton_calconnect/cc_bibliography"
@@ -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.18.0"
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.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: faraday
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.18.0
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.18.0
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.26
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
@@ -1,10 +0,0 @@
1
- module RelatonCalconnect
2
- module Config
3
- include RelatonBib::Config
4
- end
5
- extend Config
6
-
7
- class Configuration < RelatonBib::Configuration
8
- PROGNAME = "relaton-calconnect".freeze
9
- end
10
- end