relaton-ieee 1.14.7 → 1.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ada9626ba7d42d2b18555142d178896b289c1d55910b64bd2de05e2be230aee8
4
- data.tar.gz: 696191fb9c3a4aa1f35b444e84a82aed4121a55ca599df6cad4428cdec0ce6fc
3
+ metadata.gz: 1b3158476d1e01a14fa8ca158d5216f0aa4f0f67a29ecb642a297dc60ff70e2d
4
+ data.tar.gz: 10a6247158f7f63edbfc26ba0598cb90fd9bee5413a533de18f1544a0d5c8210
5
5
  SHA512:
6
- metadata.gz: 4def0f35dcbbee001582ef10a9ae33c14421740c9e2c791df064c1e050adaff51419e80c13e6e2d5e16318eb850d8ed6325f63dbad39b0b15af029356fccd214
7
- data.tar.gz: 55c4b23088e260c7679e5dbaaf5283c222f45df06d61909c81cb3d6498e5652da2f751dba9ed8a1b9504c2e185172646c4b47463f85687997b7df0cc65b05de8
6
+ metadata.gz: dac9f194398e435db9884395e146beaf10932612b27cf29a7283779d761b7c120f8db2b35908bc70bf6b749004cf995745d34c92ea3e04854e3b54e246e1f2ff
7
+ data.tar.gz: 76fbc102622c419171bd15006722eaedfffa2ec70ee42f87f343960508309cfb439ad43dead51bc14dd3b6adeb9a0ace7e5a9085dfdb9e5e7ea197bcdea357d6
@@ -7,7 +7,8 @@ on:
7
7
  inputs:
8
8
  next_version:
9
9
  description: |
10
- Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
10
+ Next release version. Possible values: x.y.z, major, minor, patch (or pre|rc|etc).
11
+ Also, you can pass 'skip' to skip 'git tag' and do 'gem push' for the current version
11
12
  required: true
12
13
  default: 'skip'
13
14
  repository_dispatch:
data/.rubocop.yml CHANGED
@@ -7,6 +7,6 @@ require: rubocop-rails
7
7
  inherit_from:
8
8
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
9
9
  AllCops:
10
- TargetRubyVersion: 2.6
10
+ TargetRubyVersion: 2.7
11
11
  Rails:
12
12
  Enabled: false
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ gemspec
6
6
  gem "rake", "~> 13.0"
7
7
  gem "rspec", "~> 3.0"
8
8
 
9
+ gem "equivalent-xml", "~> 0.6"
9
10
  gem "pry-byebug"
10
11
  gem "ruby-jing"
11
12
  gem "simplecov"
data/grammars/biblio.rng CHANGED
@@ -1283,7 +1283,7 @@
1283
1283
  <value>mergedInto</value>
1284
1284
  <value>splits</value>
1285
1285
  <value>splitInto</value>
1286
- <value>instance</value>
1286
+ <value>instanceOf</value>
1287
1287
  <value>hasInstance</value>
1288
1288
  <value>exemplarOf</value>
1289
1289
  <value>hasExemplar</value>
@@ -31,7 +31,6 @@ module RelatonIeee
31
31
  @ext = format.sub(/^bib/, "")
32
32
  @crossrefs = {}
33
33
  @backrefs = {}
34
- @index = Relaton::Index.find_or_create :IEEE
35
34
  end
36
35
 
37
36
  #
@@ -1,8 +1,9 @@
1
1
  module RelatonIeee
2
2
  class IeeeBibliography
3
- class << self
4
- GH_URL = "https://raw.githubusercontent.com/relaton/relaton-data-ieee/main/data/".freeze
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
- url = "#{GH_URL}#{ref}.yaml"
16
- resp = Faraday.get url
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
@@ -1,3 +1,3 @@
1
1
  module RelatonIeee
2
- VERSION = "1.14.7".freeze
2
+ VERSION = "1.16.0".freeze
3
3
  end
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.6.0")
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,11 +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.add_development_dependency "equivalent-xml", "~> 0.6"
35
-
36
34
  spec.add_dependency "faraday", "~> 2.7.0"
37
35
  spec.add_dependency "mini_portile2", "~> 2.8.0"
38
- spec.add_dependency "relaton-bib", "~> 1.14.0"
36
+ spec.add_dependency "relaton-bib", "~> 1.16.0"
39
37
  spec.add_dependency "relaton-index", "~> 0.2.0"
40
38
  spec.add_dependency "rubyzip", "~> 2.3.0"
41
39
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ieee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.7
4
+ version: 1.16.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: 2023-05-20 00:00:00.000000000 Z
11
+ date: 2023-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: equivalent-xml
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '0.6'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '0.6'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: faraday
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +44,14 @@ dependencies:
58
44
  requirements:
59
45
  - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: 1.14.0
47
+ version: 1.16.0
62
48
  type: :runtime
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
52
  - - "~>"
67
53
  - !ruby/object:Gem::Version
68
- version: 1.14.0
54
+ version: 1.16.0
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: relaton-index
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -149,7 +135,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
149
135
  requirements:
150
136
  - - ">="
151
137
  - !ruby/object:Gem::Version
152
- version: 2.6.0
138
+ version: 2.7.0
153
139
  required_rubygems_version: !ruby/object:Gem::Requirement
154
140
  requirements:
155
141
  - - ">="