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 +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 +3 -3
- 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 +2 -2
- metadata +7 -8
- 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: 2459fc2f244a3c6bfbb9d5dbd035c2399475b75b4d21e12c6b53a9f66fa9864f
|
4
|
+
data.tar.gz: c8ea59704044ff2592469fcc54c59bfa6445d6c38e5a88a05bd61fbdefdd6815
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
|
@@ -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
@@ -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.
|
31
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
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.
|
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-
|
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.
|
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.
|
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.
|
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
|
@@ -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.
|
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
|