relaton-ieee 1.18.0 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- 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/data_parser.rb +1 -1
- data/lib/relaton_ieee/document_type.rb +1 -2
- data/lib/relaton_ieee/ieee_bibliography.rb +3 -3
- data/lib/relaton_ieee/rawbib_id_parser.rb +1 -1
- 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 -7
- data/3185.zip +0 -0
- 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: d868eabc41398aaf2703d4f318117057d4936e3a77f06c9cbdced96fa04445dc
|
4
|
+
data.tar.gz: 3aceeac56b681d0b327340ebdde53479a58b6f0d03404223ae33514202f28843
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91a548d6535f9267f818869ee32fbad3faa25831f658031f978ccbea2ef844046fd79a07501560cf0b193832557ee36c7d300a220b54b220453745afddefaafb
|
7
|
+
data.tar.gz: ed854341d691cff8777b91a82a2588ceb25fbac6b643adc5d14a27ebe0441253b14de1e76a615b426f27bd97e4578e2d424d75e9aa6cd685184e9cc4cae4b44b
|
data/.gitignore
CHANGED
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
|
@@ -69,7 +69,7 @@ module RelatonIeee
|
|
69
69
|
m = d.at("./month")&.text
|
70
70
|
if m
|
71
71
|
/^(?:(?<day>\d{1,2})\s)?(?<mon>\w+)/ =~ m
|
72
|
-
month = Date::ABBR_MONTHNAMES.index(mon) || m
|
72
|
+
month = Date::ABBR_MONTHNAMES.index(mon) || Date::MONTHNAMES.index(mon) || m
|
73
73
|
da << month.to_s.rjust(2, "0")
|
74
74
|
end
|
75
75
|
day = d.at("./day")&.text || day
|
@@ -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
|
@@ -456,7 +456,7 @@ module RelatonIeee
|
|
456
456
|
PubId.new(publisher: $1, number: $2)
|
457
457
|
|
458
458
|
else
|
459
|
-
Util.warn %{Use stdnumber "#{stdnumber}" for
|
459
|
+
Util.warn %{Use stdnumber "#{stdnumber}" for normtitle "#{normtitle}"}
|
460
460
|
PubId.new(publisher: "IEEE", number: stdnumber)
|
461
461
|
end
|
462
462
|
rescue ArgumentError => e
|
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.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-10-25 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
|
@@ -93,7 +93,6 @@ files:
|
|
93
93
|
- ".gitignore"
|
94
94
|
- ".rspec"
|
95
95
|
- ".rubocop.yml"
|
96
|
-
- 3185.zip
|
97
96
|
- Gemfile
|
98
97
|
- LICENSE.txt
|
99
98
|
- README.adoc
|
@@ -109,7 +108,6 @@ files:
|
|
109
108
|
- lib/relaton_ieee.rb
|
110
109
|
- lib/relaton_ieee/balloting_group.rb
|
111
110
|
- lib/relaton_ieee/bibxml_parser.rb
|
112
|
-
- lib/relaton_ieee/config.rb
|
113
111
|
- lib/relaton_ieee/data_fetcher.rb
|
114
112
|
- lib/relaton_ieee/data_parser.rb
|
115
113
|
- lib/relaton_ieee/document_status.rb
|
@@ -146,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
144
|
- !ruby/object:Gem::Version
|
147
145
|
version: '0'
|
148
146
|
requirements: []
|
149
|
-
rubygems_version: 3.3.
|
147
|
+
rubygems_version: 3.3.27
|
150
148
|
signing_key:
|
151
149
|
specification_version: 4
|
152
150
|
summary: 'RelatonIeee: retrieve IEEE Standards for bibliographic use using the IeeeBibliographicItem
|
data/3185.zip
DELETED
Binary file
|