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 +4 -4
- data/README.adoc +7 -14
- data/grammars/basicdoc.rng +3 -0
- data/lib/relaton_ecma/data_fetcher.rb +2 -3
- data/lib/relaton_ecma/data_parser.rb +1 -1
- data/lib/relaton_ecma/ecma_bibliography.rb +4 -4
- data/lib/relaton_ecma/util.rb +1 -4
- data/lib/relaton_ecma/version.rb +1 -1
- data/lib/relaton_ecma.rb +0 -1
- data/relaton_ecma.gemspec +1 -1
- metadata +4 -5
- data/lib/relaton_ecma/config.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c76a9be85115c22120dd98e42c4ea5c65b2fc90dd87d24110db4d9c0853ffe35
|
4
|
+
data.tar.gz: 3bf5ead68add0814f6c5cc317b6c8b57dde08bcda898ea48de317a90b9bd8ee0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
data/grammars/basicdoc.rng
CHANGED
@@ -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
|
-
|
72
|
-
warn e.backtrace
|
71
|
+
Util.error { "#{e.message}\n#{e.backtrace}" }
|
73
72
|
end
|
74
73
|
end
|
75
74
|
|
@@ -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/
|
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.
|
43
|
+
Util.info "Fetching from Relaton repository ...", key: code
|
44
44
|
result = fetch_doc(code)
|
45
45
|
if result
|
46
|
-
Util.
|
46
|
+
Util.info "Found: `#{result.docidentifier.first.id}`", key: code
|
47
47
|
# item
|
48
48
|
else
|
49
|
-
Util.
|
49
|
+
Util.info "Not found.", key: code
|
50
50
|
end
|
51
51
|
result
|
52
52
|
end
|
data/lib/relaton_ecma/util.rb
CHANGED
data/lib/relaton_ecma/version.rb
CHANGED
data/lib/relaton_ecma.rb
CHANGED
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.
|
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.
|
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-
|
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.
|
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.
|
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
|