relaton-ecma 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: 6dd48980d82c2a0b7769e8a60073312ee6d6cee0e652533513b874ef11c4670e
4
- data.tar.gz: 23e48982696f6fc8b58a86e13957c56f5a5b915eba225ff8619a6b1169405b27
3
+ metadata.gz: c76a9be85115c22120dd98e42c4ea5c65b2fc90dd87d24110db4d9c0853ffe35
4
+ data.tar.gz: 3bf5ead68add0814f6c5cc317b6c8b57dde08bcda898ea48de317a90b9bd8ee0
5
5
  SHA512:
6
- metadata.gz: 668a75602b15dd8b47f940ebf7858442d07ee42a7dcc5a6f78ae1dea8d8cb7051df39f9b93e892f6af1d025afa7d0dc2f6f54a9720c46a5d6d3a4ca47bb7e887
7
- data.tar.gz: 7199cc081f509cc68f7d5e41c9005e0942676094f9e32550f23db465201c0f0b09ce26838b534b9733040b5f5b49ecc10b274c5f36576a22943e9dbd9fca8755
6
+ metadata.gz: 1377d79ee251ed89fafcdff3652e2c73026e94c5b815105ad9797f567d79b34bcafbc173b76963c74bc0e0eb4b81c0ae1da89c30e788722ae9262893adcb1fda
7
+ data.tar.gz: 955138b12c78cb2f2c6b9d366b4cbffb44d4262d0e7e25436f6e4201068ad415f342041abba895bbdfe8a3ca7b745d18ce8f5690cc74041c25e355888012c90c
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
 
@@ -3,7 +3,7 @@
3
3
  module RelatonEcma
4
4
  # IETF bibliography module
5
5
  module EcmaBibliography
6
- ENDPOINT = "https://raw.githubusercontent.com/relaton/relaton-data-ecma/master/"
6
+ ENDPOINT = "https://raw.githubusercontent.com/relaton/relaton-data-ecma/main/"
7
7
 
8
8
  class << self
9
9
  #
@@ -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.1".freeze
2
+ VERSION = "1.19.1".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
@@ -28,6 +28,6 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
28
28
  spec.require_paths = ["lib"]
29
29
 
30
30
  spec.add_dependency "mechanize", "~> 2.10"
31
- spec.add_dependency "relaton-bib", "~> 1.18.0"
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.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
@@ -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
@@ -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
@@ -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