relaton-ecma 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: 5ad1b5760bbd62ed7fceda83fa93426cf8a4ec0b7f8cc1be1d2d9dfc0e922045
4
- data.tar.gz: 108120342cbf4d6c2b9039575fd5f14118f02295a2aab95032690f9703996e12
3
+ metadata.gz: 2459fc2f244a3c6bfbb9d5dbd035c2399475b75b4d21e12c6b53a9f66fa9864f
4
+ data.tar.gz: c8ea59704044ff2592469fcc54c59bfa6445d6c38e5a88a05bd61fbdefdd6815
5
5
  SHA512:
6
- metadata.gz: 5f7e8d6ce8bbbd09ed814427e1cc76306bb850db1254bcbe165271a157f3796765c845331b2baae29d2e4468634eb5e8a65904054020cb7c53d37af4c7162d82
7
- data.tar.gz: a51aab49fefb673d9870027f6ceb19cc0a37b180efff3c714e25dc58a2e74b55d9c20c89b8daac76ce508e09c1a3b865a3ab600165e5deceb545b68b084be8f8
6
+ metadata.gz: 1ffdc2e99026c310337e1c010af0c53d5ce7ca2386db3a1547fe022e826c18be6065846587eb0b73740c4fa57dbd52cb7e1dbdfb6bb853b5ab4f89ea91320569
7
+ data.tar.gz: 9c8290dd151dc1d4f327e20bb6ac985066d84e3ce7e2fc73400b10ef775d34ce4722e6c91e2e24f55a069dfe97fe40b976643ee3bb19c479c8e48828b4aafb39
data/README.adoc CHANGED
@@ -29,20 +29,6 @@ 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 `RelatonEcma.configure` block.
35
-
36
- [source,ruby]
37
- ----
38
- require 'relaton_ecma'
39
- => true
40
-
41
- RelatonEcma.configure do |config|
42
- config.logger.level = Logger::DEBUG
43
- end
44
- ----
45
-
46
32
  === Fetch documents
47
33
 
48
34
  Documents can be fetched by reference. The structure of the reference depends on the type of the document. There are three types of documents:
@@ -59,6 +45,9 @@ ECMA mementos have the following reference structure: `ECMA MEM/{YEAR}`. Where:
59
45
 
60
46
  [source,ruby]
61
47
  ----
48
+ require 'relaton_ecma'
49
+ => true
50
+
62
51
  # fetch ECMA standard
63
52
  item = RelatonEcma::EcmaBibliography.get 'ECMA-6'
64
53
  [relaton-ecma] (ECMA-6) Fetching from Relaton repository ...
@@ -185,6 +174,10 @@ Done in: 752 sec.
185
174
  => nil
186
175
  ----
187
176
 
177
+ === Logging
178
+
179
+ RelatonEcma 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.
180
+
188
181
  == Development
189
182
 
190
183
  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"/>
@@ -28,7 +28,7 @@ module RelatonEcma
28
28
  id += "-#{extent.reference_from}" if extent
29
29
  file = "#{@output}/#{id}.#{@ext}"
30
30
  if @files.include? file
31
- warn "Duplicate file #{file}"
31
+ Util.warn "Duplicate file #{file}"
32
32
  else
33
33
  @files << file
34
34
  File.write file, render_doc(bib), encoding: "UTF-8"
@@ -68,8 +68,7 @@ module RelatonEcma
68
68
  # workers << hit
69
69
  parse_page(hit)
70
70
  rescue StandardError => e
71
- warn e.message
72
- warn e.backtrace
71
+ Util.error { "#{e.message}\n#{e.backtrace}" }
73
72
  end
74
73
  end
75
74
 
@@ -42,7 +42,7 @@ module RelatonEcma
42
42
  doc = @agent.get url
43
43
  return doc
44
44
  rescue StandardError => e
45
- warn e.message
45
+ Util.error e.message
46
46
  end
47
47
  end
48
48
 
@@ -40,13 +40,13 @@ module RelatonEcma
40
40
  # @param opts [Hash] not used
41
41
  # @return [RelatonEcma::BibliographicItem] Relaton of reference
42
42
  def get(code, _year = nil, _opts = {})
43
- Util.warn "(#{code}) Fetching from Relaton repository ..."
43
+ Util.info "Fetching from Relaton repository ...", key: code
44
44
  result = fetch_doc(code)
45
45
  if result
46
- Util.warn "(#{code}) Found: `#{result.docidentifier.first.id}`"
46
+ Util.info "Found: `#{result.docidentifier.first.id}`", key: code
47
47
  # item
48
48
  else
49
- Util.warn "(#{code}) Not found."
49
+ Util.info "Not found.", key: code
50
50
  end
51
51
  result
52
52
  end
@@ -1,9 +1,6 @@
1
1
  module RelatonEcma
2
2
  module Util
3
3
  extend RelatonBib::Util
4
-
5
- def self.logger
6
- RelatonEcma.configuration.logger
7
- end
4
+ PROGNAME = "relaton-ecma".freeze
8
5
  end
9
6
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonEcma
2
- VERSION = "1.18.0".freeze
2
+ VERSION = "1.19.0".freeze
3
3
  end
data/lib/relaton_ecma.rb CHANGED
@@ -4,7 +4,6 @@ require "yaml"
4
4
  require "relaton/index"
5
5
  require "relaton_bib"
6
6
  require "relaton_ecma/version"
7
- require "relaton_ecma/config"
8
7
  require "relaton_ecma/util"
9
8
  require "relaton_ecma/bibliographic_item"
10
9
  require "relaton_ecma/xml_parser"
data/relaton_ecma.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
- spec.add_dependency "mechanize", "~> 2.8.0"
31
- spec.add_dependency "relaton-bib", "~> 1.18.0"
30
+ spec.add_dependency "mechanize", "~> 2.10"
31
+ spec.add_dependency "relaton-bib", "~> 1.19.0"
32
32
  spec.add_dependency "relaton-index", "~> 0.2.4"
33
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ecma
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,28 +16,28 @@ 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: relaton-bib
29
29
  requirement: !ruby/object:Gem::Requirement
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
@@ -79,7 +79,6 @@ files:
79
79
  - grammars/relaton-ecma.rng
80
80
  - lib/relaton_ecma.rb
81
81
  - lib/relaton_ecma/bibliographic_item.rb
82
- - lib/relaton_ecma/config.rb
83
82
  - lib/relaton_ecma/data_fetcher.rb
84
83
  - lib/relaton_ecma/data_parser.rb
85
84
  - lib/relaton_ecma/ecma_bibliography.rb
@@ -109,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
108
  - !ruby/object:Gem::Version
110
109
  version: '0'
111
110
  requirements: []
112
- rubygems_version: 3.3.26
111
+ rubygems_version: 3.3.27
113
112
  signing_key:
114
113
  specification_version: 4
115
114
  summary: 'RelatonIetf: retrieve ECMA Standards for bibliographic use using the BibliographicItem
@@ -1,10 +0,0 @@
1
- module RelatonEcma
2
- module Config
3
- include RelatonBib::Config
4
- end
5
- extend Config
6
-
7
- class Configuration < RelatonBib::Configuration
8
- PROGNAME = "relaton-ecma".freeze
9
- end
10
- end