relaton-ieee 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 +5 -12
- data/grammars/basicdoc.rng +3 -0
- data/lib/relaton_ieee/balloting_group.rb +1 -1
- data/lib/relaton_ieee/data_fetcher.rb +6 -8
- data/lib/relaton_ieee/document_type.rb +1 -2
- data/lib/relaton_ieee/ieee_bibliography.rb +3 -3
- data/lib/relaton_ieee/util.rb +1 -4
- data/lib/relaton_ieee/version.rb +1 -1
- data/lib/relaton_ieee/xml_parser.rb +4 -0
- data/lib/relaton_ieee.rb +0 -1
- data/relaton_ieee.gemspec +1 -1
- metadata +5 -6
- data/lib/relaton_ieee/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: 4e671fb3b9fe9adc6d69c46f8d5757dd73e35dd324df9516eda63452ca5c3e8d
|
4
|
+
data.tar.gz: aa265d86a448bfdd00b893f93b8008f3fb22794419f6ecf63bcf0932bb4af46e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f690ba8cc419d3065b62bc2a5cc3dfd195a3d892219a05bf644e5a5e6f7ad081ce4d5486e5e65ee872a3640e709c1c0f639d7abd604139af5f18fd715591e0f
|
7
|
+
data.tar.gz: 5774082f3f48195883cdba7fa4d5cb9e092049405513f69c790db981ff159234827d16d698e4c57cc953eec0d4c15fe96359880e350eff21872f48af69768590
|
data/README.adoc
CHANGED
@@ -23,24 +23,13 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
== Usage
|
25
25
|
|
26
|
-
===
|
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 `RelatonIeee.configure` block.
|
26
|
+
=== Search for a standard using keywords
|
29
27
|
|
30
28
|
[source,ruby]
|
31
29
|
----
|
32
30
|
require 'relaton_ieee'
|
33
31
|
=> true
|
34
32
|
|
35
|
-
RelatonIeee.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
|
item = RelatonIeee::IeeeBibliography.search("IEEE 528-2019")
|
45
34
|
=> #<RelatonIeee::IeeeBibliographicItem:0x00007fe12ebc8cb8
|
46
35
|
...
|
@@ -139,6 +128,10 @@ Done in: 143 sec.
|
|
139
128
|
=> nil
|
140
129
|
----
|
141
130
|
|
131
|
+
=== Logging
|
132
|
+
|
133
|
+
RelatonIeee 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.
|
134
|
+
|
142
135
|
== Development
|
143
136
|
|
144
137
|
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
@@ -13,7 +13,7 @@ module RelatonIeee
|
|
13
13
|
#
|
14
14
|
def initialize(type:, content:)
|
15
15
|
unless TYPES.include?(type)
|
16
|
-
Util.warn "
|
16
|
+
Util.warn "type of Balloting group must be one of `#{TYPES.join('`, `')}`"
|
17
17
|
end
|
18
18
|
|
19
19
|
@type = type
|
@@ -61,9 +61,7 @@ module RelatonIeee
|
|
61
61
|
end
|
62
62
|
fetch_doc xml, f
|
63
63
|
rescue StandardError => e
|
64
|
-
|
65
|
-
warn e.message
|
66
|
-
warn e.backtrace
|
64
|
+
Util.error "File: #{f}\n#{e.message}\n#{e.backtrace}"
|
67
65
|
end
|
68
66
|
# File.write "normtitles.txt", @normtitles.join("\n")
|
69
67
|
update_relations
|
@@ -92,7 +90,7 @@ module RelatonIeee
|
|
92
90
|
def fetch_doc(xml, filename) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
93
91
|
doc = Nokogiri::XML(xml).at("/publication")
|
94
92
|
unless doc
|
95
|
-
warn "Empty file:
|
93
|
+
Util.warn "Empty file: `#{filename}`"
|
96
94
|
return
|
97
95
|
end
|
98
96
|
stdid = doc.at("./publicationinfo/standard_id")&.text
|
@@ -102,14 +100,14 @@ module RelatonIeee
|
|
102
100
|
bib = fetcher.parse
|
103
101
|
if bib.docnumber.nil?
|
104
102
|
nt = doc&.at("./normtitle")&.text
|
105
|
-
warn "PubID parse error. Normtitle:
|
103
|
+
Util.warn "PubID parse error. Normtitle: `#{nt}`, file: `#{filename}`"
|
106
104
|
return
|
107
105
|
end
|
108
106
|
amsid = doc.at("./publicationinfo/amsid").text
|
109
107
|
if backrefs.value?(bib.docidentifier[0].id) && /updates\.\d+/ !~ filename
|
110
108
|
oamsid = backrefs.key bib.docidentifier[0].id
|
111
|
-
warn "Document exists ID:
|
112
|
-
"
|
109
|
+
Util.warn "Document exists ID: `#{bib.docidentifier[0].id}` AMSID: " \
|
110
|
+
"`#{amsid}` source: `#{filename}`. Other AMSID: `#{oamsid}`"
|
113
111
|
if bib.docidentifier[0].id.include?(doc.at("./publicationinfo/stdnumber").text)
|
114
112
|
save_doc bib # rewrite file if the PubID matches to the stdnumber
|
115
113
|
backrefs[amsid] = bib.docidentifier[0].id
|
@@ -177,7 +175,7 @@ module RelatonIeee
|
|
177
175
|
save_doc bib
|
178
176
|
end
|
179
177
|
else
|
180
|
-
warn "Unresolved relation: '#{rf[:amsid]}' type: '#{rf[:type]}' for '#{dnum}'"
|
178
|
+
Util.warn "Unresolved relation: '#{rf[:amsid]}' type: '#{rf[:type]}' for '#{dnum}'"
|
181
179
|
end
|
182
180
|
end
|
183
181
|
end
|
@@ -9,8 +9,7 @@ module RelatonIeee
|
|
9
9
|
|
10
10
|
def check_type(type)
|
11
11
|
unless DOCTYPES.include? type
|
12
|
-
Util.warn "Invalid doctype: `#{type}`. "
|
13
|
-
"It should be one of: `#{DOCTYPES.join('`, `')}`."
|
12
|
+
Util.warn "Invalid doctype: `#{type}`. It should be one of: `#{DOCTYPES.join('`, `')}`."
|
14
13
|
end
|
15
14
|
end
|
16
15
|
end
|
@@ -38,13 +38,13 @@ module RelatonIeee
|
|
38
38
|
# if document is found else returns NilClass
|
39
39
|
#
|
40
40
|
def get(code, _year = nil, _opts = {}) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
41
|
-
Util.
|
41
|
+
Util.info "Fetching from Relaton repository ...", key: code
|
42
42
|
item = search(code)
|
43
43
|
if item
|
44
|
-
Util.
|
44
|
+
Util.info "Found: `#{item.docidentifier.first.id}`", key: code
|
45
45
|
item
|
46
46
|
else
|
47
|
-
Util.
|
47
|
+
Util.info "Not found.", key: code
|
48
48
|
nil
|
49
49
|
end
|
50
50
|
end
|
data/lib/relaton_ieee/util.rb
CHANGED
data/lib/relaton_ieee/version.rb
CHANGED
data/lib/relaton_ieee.rb
CHANGED
data/relaton_ieee.gemspec
CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
|
34
34
|
spec.add_dependency "faraday", "~> 2.7.0"
|
35
35
|
spec.add_dependency "mini_portile2", "~> 2.8.0"
|
36
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
36
|
+
spec.add_dependency "relaton-bib", "~> 1.19.0"
|
37
37
|
spec.add_dependency "relaton-index", "~> 0.2.0"
|
38
38
|
spec.add_dependency "rubyzip", "~> 2.3.0"
|
39
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-ieee
|
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: faraday
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.19.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.19.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: relaton-index
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,7 +109,6 @@ files:
|
|
109
109
|
- lib/relaton_ieee.rb
|
110
110
|
- lib/relaton_ieee/balloting_group.rb
|
111
111
|
- lib/relaton_ieee/bibxml_parser.rb
|
112
|
-
- lib/relaton_ieee/config.rb
|
113
112
|
- lib/relaton_ieee/data_fetcher.rb
|
114
113
|
- lib/relaton_ieee/data_parser.rb
|
115
114
|
- lib/relaton_ieee/document_status.rb
|
@@ -146,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
145
|
- !ruby/object:Gem::Version
|
147
146
|
version: '0'
|
148
147
|
requirements: []
|
149
|
-
rubygems_version: 3.3.
|
148
|
+
rubygems_version: 3.3.27
|
150
149
|
signing_key:
|
151
150
|
specification_version: 4
|
152
151
|
summary: 'RelatonIeee: retrieve IEEE Standards for bibliographic use using the IeeeBibliographicItem
|