relaton-ieee 1.14.6 → 1.14.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +1 -0
- data/.github/workflows/release.yml +3 -2
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -1
- data/Gemfile +8 -0
- data/lib/relaton_ieee/data_fetcher.rb +3 -3
- data/lib/relaton_ieee/ieee_bibliography.rb +10 -6
- data/lib/relaton_ieee/processor.rb +7 -0
- data/lib/relaton_ieee/version.rb +1 -1
- data/lib/relaton_ieee.rb +1 -0
- data/relaton_ieee.gemspec +4 -11
- metadata +19 -103
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8500bb75c78bc6904e1dde9a154f9c72d8a2be249cc8b38ba03d55d94e986a5
|
4
|
+
data.tar.gz: 012cbab554ade90a6318fd71eaeccc696d91a32ee2421738dde463d00e0d559e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d28e213f967b4a130692feb59efafa02f56c6b1ed2e5e3058528725f750987efa107a308cc5828d8911c4de3d6d6668331ed6ff3a68f589fc5062f7a4fb8ba88
|
7
|
+
data.tar.gz: 752359a0e401653c9d74ad2d4cec62e72bc8eaba107c6a3f74922cf6d8d6d40e7d89f99891ca7f68112a7bdcb2266444f105065dc5ec6d55d5622e03c1f510f5
|
data/.github/workflows/rake.yml
CHANGED
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
@@ -31,7 +31,6 @@ module RelatonIeee
|
|
31
31
|
@ext = format.sub(/^bib/, "")
|
32
32
|
@crossrefs = {}
|
33
33
|
@backrefs = {}
|
34
|
-
# @normtitles = []
|
35
34
|
end
|
36
35
|
|
37
36
|
#
|
@@ -44,7 +43,7 @@ module RelatonIeee
|
|
44
43
|
def self.fetch(output: "data", format: "yaml")
|
45
44
|
t1 = Time.now
|
46
45
|
puts "Started at: #{t1}"
|
47
|
-
FileUtils.mkdir_p output
|
46
|
+
FileUtils.mkdir_p output
|
48
47
|
new(output, format).fetch
|
49
48
|
t2 = Time.now
|
50
49
|
puts "Stopped at: #{t2}"
|
@@ -99,7 +98,8 @@ module RelatonIeee
|
|
99
98
|
stdid = doc.at("./publicationinfo/standard_id")&.text
|
100
99
|
return if stdid == "0"
|
101
100
|
|
102
|
-
|
101
|
+
fetcher = DataParser.new doc, self
|
102
|
+
bib = fetcher.parse
|
103
103
|
if bib.docnumber.nil?
|
104
104
|
nt = doc&.at("./normtitle")&.text
|
105
105
|
warn "PubID parse error. Normtitle: #{nt}, file: #{filename}"
|
@@ -1,8 +1,9 @@
|
|
1
1
|
module RelatonIeee
|
2
2
|
class IeeeBibliography
|
3
|
-
|
4
|
-
|
3
|
+
GH_URL = "https://raw.githubusercontent.com/relaton/relaton-data-ieee/main/".freeze
|
4
|
+
INDEX_FILE = "index-v1.yaml".freeze
|
5
5
|
|
6
|
+
class << self
|
6
7
|
#
|
7
8
|
# Search IEEE bibliography item by reference.
|
8
9
|
#
|
@@ -10,10 +11,13 @@ module RelatonIeee
|
|
10
11
|
#
|
11
12
|
# @return [RelatonIeee::IeeeBibliographicItem]
|
12
13
|
#
|
13
|
-
def search(code)
|
14
|
-
ref = code.sub(/Std\s/i, "").gsub(/[\s,:\/]/, "_").squeeze("_").upcase
|
15
|
-
|
16
|
-
|
14
|
+
def search(code) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
15
|
+
ref = code.sub(/Std\s/i, "") # .gsub(/[\s,:\/]/, "_").squeeze("_").upcase
|
16
|
+
index = Relaton::Index.find_or_create :ieee, url: "#{GH_URL}index-v1.zip", file: INDEX_FILE
|
17
|
+
row = index.search(ref).min_by { |r| r[:id] }
|
18
|
+
return unless row
|
19
|
+
|
20
|
+
resp = Faraday.get "#{GH_URL}#{row[:file]}"
|
17
21
|
return unless resp.status == 200
|
18
22
|
|
19
23
|
hash = YAML.safe_load resp.body
|
@@ -49,5 +49,12 @@ module RelatonIeee
|
|
49
49
|
def grammar_hash
|
50
50
|
@grammar_hash ||= ::RelatonIeee.grammar_hash
|
51
51
|
end
|
52
|
+
|
53
|
+
#
|
54
|
+
# Remove index file
|
55
|
+
#
|
56
|
+
def remove_index_file
|
57
|
+
Relaton::Index.find_or_create(:ieee, url: true, file: IeeeBibliography::INDEX_FILE).remove_file
|
58
|
+
end
|
52
59
|
end
|
53
60
|
end
|
data/lib/relaton_ieee/version.rb
CHANGED
data/lib/relaton_ieee.rb
CHANGED
data/relaton_ieee.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
"use using the IeeeBibliographicItem model"
|
15
15
|
spec.homepage = "https://github.com/relaton/relaton-ieee"
|
16
16
|
spec.license = "BSD-2-Clause"
|
17
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
17
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
18
18
|
|
19
19
|
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
20
20
|
|
@@ -31,16 +31,9 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
32
32
|
spec.require_paths = ["lib"]
|
33
33
|
|
34
|
-
spec.
|
35
|
-
spec.
|
36
|
-
spec.add_development_dependency "ruby-jing"
|
37
|
-
spec.add_development_dependency "simplecov"
|
38
|
-
spec.add_development_dependency "vcr"
|
39
|
-
spec.add_development_dependency "webmock"
|
40
|
-
spec.add_development_dependency "webrick"
|
41
|
-
|
42
|
-
spec.add_dependency "faraday", "~> 1.0"
|
43
|
-
spec.add_dependency "mini_portile2"
|
34
|
+
spec.add_dependency "faraday", "~> 2.7.0"
|
35
|
+
spec.add_dependency "mini_portile2", "~> 2.8.0"
|
44
36
|
spec.add_dependency "relaton-bib", "~> 1.14.0"
|
37
|
+
spec.add_dependency "relaton-index", "~> 0.2.0"
|
45
38
|
spec.add_dependency "rubyzip", "~> 2.3.0"
|
46
39
|
end
|
metadata
CHANGED
@@ -1,155 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-ieee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.14.
|
4
|
+
version: 1.14.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
type: :
|
19
|
+
version: 2.7.0
|
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:
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: pry-byebug
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
26
|
+
version: 2.7.0
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: simplecov
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: vcr
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: webmock
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: webrick
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: faraday
|
28
|
+
name: mini_portile2
|
113
29
|
requirement: !ruby/object:Gem::Requirement
|
114
30
|
requirements:
|
115
31
|
- - "~>"
|
116
32
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
33
|
+
version: 2.8.0
|
118
34
|
type: :runtime
|
119
35
|
prerelease: false
|
120
36
|
version_requirements: !ruby/object:Gem::Requirement
|
121
37
|
requirements:
|
122
38
|
- - "~>"
|
123
39
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
40
|
+
version: 2.8.0
|
125
41
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
42
|
+
name: relaton-bib
|
127
43
|
requirement: !ruby/object:Gem::Requirement
|
128
44
|
requirements:
|
129
|
-
- - "
|
45
|
+
- - "~>"
|
130
46
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
47
|
+
version: 1.14.0
|
132
48
|
type: :runtime
|
133
49
|
prerelease: false
|
134
50
|
version_requirements: !ruby/object:Gem::Requirement
|
135
51
|
requirements:
|
136
|
-
- - "
|
52
|
+
- - "~>"
|
137
53
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
54
|
+
version: 1.14.0
|
139
55
|
- !ruby/object:Gem::Dependency
|
140
|
-
name: relaton-
|
56
|
+
name: relaton-index
|
141
57
|
requirement: !ruby/object:Gem::Requirement
|
142
58
|
requirements:
|
143
59
|
- - "~>"
|
144
60
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
61
|
+
version: 0.2.0
|
146
62
|
type: :runtime
|
147
63
|
prerelease: false
|
148
64
|
version_requirements: !ruby/object:Gem::Requirement
|
149
65
|
requirements:
|
150
66
|
- - "~>"
|
151
67
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
68
|
+
version: 0.2.0
|
153
69
|
- !ruby/object:Gem::Dependency
|
154
70
|
name: rubyzip
|
155
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -219,14 +135,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
219
135
|
requirements:
|
220
136
|
- - ">="
|
221
137
|
- !ruby/object:Gem::Version
|
222
|
-
version: 2.
|
138
|
+
version: 2.7.0
|
223
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
224
140
|
requirements:
|
225
141
|
- - ">="
|
226
142
|
- !ruby/object:Gem::Version
|
227
143
|
version: '0'
|
228
144
|
requirements: []
|
229
|
-
rubygems_version: 3.
|
145
|
+
rubygems_version: 3.3.26
|
230
146
|
signing_key:
|
231
147
|
specification_version: 4
|
232
148
|
summary: 'RelatonIeee: retrieve IEEE Standards for bibliographic use using the IeeeBibliographicItem
|