relaton-bipm 1.14.7 → 1.14.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_bipm/bipm_bibliography.rb +5 -1
- data/lib/relaton_bipm/id_parser.rb +2 -1
- data/lib/relaton_bipm/processor.rb +7 -0
- data/lib/relaton_bipm/version.rb +1 -1
- data/relaton_bipm.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b0e032eaf9d9a650ce244375a26cdc085fd11fd2b47ee06989ed2bc4fa53539
|
4
|
+
data.tar.gz: 13bc2a98dba427df1fbf4e0d47745b062e17212fa7b6f9942418bfeb7bee2255
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45929b083ec8b3b7656e29245c42405c086cc21a72031e88181ee5ad80f2e1e0ac3e118cdac0f03f3e423a89333d0b97944f23747affeff75db1a7401074bc6b
|
7
|
+
data.tar.gz: 80ced073ec6d0527b7b2fe495abde01957c8e37ed98b79c646eb21fdcb0aee7516a72f64b1288e70061b7240c1e714b8417171d6fbefb3c8b765b5ef3fb9ab82
|
@@ -3,6 +3,7 @@ require "mechanize"
|
|
3
3
|
module RelatonBipm
|
4
4
|
class BipmBibliography
|
5
5
|
GH_ENDPOINT = "https://raw.githubusercontent.com/relaton/relaton-data-bipm/master/".freeze
|
6
|
+
INDEX_FILE = "index2.yaml".freeze
|
6
7
|
|
7
8
|
class << self
|
8
9
|
# @param text [String]
|
@@ -44,7 +45,6 @@ module RelatonBipm
|
|
44
45
|
# @return [RelatonBipm::BipmBibliographicItem]
|
45
46
|
def get_bipm(reference, agent) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
46
47
|
ref_id = Id.new reference
|
47
|
-
index = Relaton::Index.find_or_create :BIPM, url: "#{GH_ENDPOINT}index2.zip", file: "index2.yaml"
|
48
48
|
rows = index.search { |r| ref_id == r[:id] }
|
49
49
|
return unless rows.any?
|
50
50
|
|
@@ -58,6 +58,10 @@ module RelatonBipm
|
|
58
58
|
BipmBibliographicItem.new(**bib_hash)
|
59
59
|
end
|
60
60
|
|
61
|
+
def index
|
62
|
+
Relaton::Index.find_or_create :BIPM, url: "#{GH_ENDPOINT}index2.zip", file: INDEX_FILE
|
63
|
+
end
|
64
|
+
|
61
65
|
# def match_item(ids, ref_id)
|
62
66
|
# ids.find { |id| Id.new(id) == ref_id }
|
63
67
|
# end
|
@@ -51,5 +51,12 @@ module RelatonBipm
|
|
51
51
|
def grammar_hash
|
52
52
|
@grammar_hash ||= ::RelatonBipm.grammar_hash
|
53
53
|
end
|
54
|
+
|
55
|
+
#
|
56
|
+
# Remove index file
|
57
|
+
#
|
58
|
+
def remove_index_file
|
59
|
+
Relaton::Index.find_or_create(:BIPM, url: true, file: BipmBibliography::INDEX_FILE).remove_file
|
60
|
+
end
|
54
61
|
end
|
55
62
|
end
|
data/lib/relaton_bipm/version.rb
CHANGED
data/relaton_bipm.gemspec
CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
38
38
|
spec.add_dependency "mechanize", "~> 2.8.0"
|
39
39
|
spec.add_dependency "parslet", "~> 2.0.0"
|
40
40
|
spec.add_dependency "relaton-bib", "~> 1.14.0"
|
41
|
-
spec.add_dependency "relaton-index", "~> 0.
|
41
|
+
spec.add_dependency "relaton-index", "~> 0.2.0"
|
42
42
|
spec.add_dependency "rubyzip", "~> 2.3.0"
|
43
43
|
spec.add_dependency "serrano", "~> 1.0"
|
44
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-bipm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.14.
|
4
|
+
version: 1.14.9
|
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-
|
11
|
+
date: 2023-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
89
|
+
version: 0.2.0
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
96
|
+
version: 0.2.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rubyzip
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|