relaton-iho 1.14.0 → 1.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -0
- data/lib/relaton_iho/iho_bibliography.rb +15 -6
- data/lib/relaton_iho/version.rb +1 -1
- data/lib/relaton_iho.rb +1 -0
- data/relaton_iho.gemspec +3 -7
- metadata +11 -67
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cedc24e1c28d603fca983d0583096abcb2494ae9b99ea82a303c0511bcf92327
|
4
|
+
data.tar.gz: e04aaa92de968556c6a31476b769030e7f7b1754ff4558647b9c6022589c8e5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6256279250822eca30385189ec19ed0a931133d5a2e30b53b251dc0f01a29e551e16f96c05cdaae1bbb2677bd7669ec731ea45586ff3647bc5101e3856b806c8
|
7
|
+
data.tar.gz: 2cffb976d14dc3490cd1f9fb6dba613142296d45f0b9455e42cc5612c095c2d98864e83a31431d9b4cef4e47b1a031cc2aa1b14e77b2447747e8ed78c249d1c7
|
data/Gemfile
CHANGED
@@ -2,16 +2,25 @@ require "net/http"
|
|
2
2
|
|
3
3
|
module RelatonIho
|
4
4
|
class IhoBibliography
|
5
|
-
ENDPOINT = "https://raw.githubusercontent.com/relaton/relaton-data-iho/"\
|
6
|
-
"master/
|
5
|
+
ENDPOINT = "https://raw.githubusercontent.com/relaton/relaton-data-iho/" \
|
6
|
+
"master/".freeze
|
7
7
|
|
8
8
|
class << self
|
9
|
-
#
|
10
|
-
#
|
9
|
+
#
|
10
|
+
# Search for IHO standard by IHO standard Code
|
11
|
+
#
|
12
|
+
# @param text [String] the IHO standard Code to look up (e..g "IHO B-11")
|
13
|
+
#
|
14
|
+
# @return [RelatonIho::IhoBibliographicItem, nil] the IHO standard or nil if not found
|
15
|
+
#
|
11
16
|
def search(text, _year = nil, _opts = {}) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
12
17
|
warn "[relaton-iho] (\"#{text}\") fetching..."
|
13
|
-
ref = text.sub(/^IHO\s/, "").
|
14
|
-
|
18
|
+
ref = text.sub(/^IHO\s/, "").sub(/^([[:alpha:]]+)(\d+)/, '\1-\2')
|
19
|
+
index = Relaton::Index.find_or_create :IHO, url: "#{ENDPOINT}index.zip"
|
20
|
+
row = index.search(ref).max_by { |r| r[:id] }
|
21
|
+
return unless row
|
22
|
+
|
23
|
+
uri = URI("#{ENDPOINT}#{row[:file]}")
|
15
24
|
resp = Net::HTTP.get_response uri
|
16
25
|
return unless resp.code == "200"
|
17
26
|
|
data/lib/relaton_iho/version.rb
CHANGED
data/lib/relaton_iho.rb
CHANGED
data/relaton_iho.gemspec
CHANGED
@@ -9,9 +9,9 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.email = ["open.source@ribose.com"]
|
10
10
|
s.homepage = "https://github.com/relaton/relaton-iho"
|
11
11
|
s.licenses = "BSD-2-Clause"
|
12
|
-
s.summary = "RelatonIho: retrieve IHO Standards for bibliographic "\
|
12
|
+
s.summary = "RelatonIho: retrieve IHO Standards for bibliographic " \
|
13
13
|
"using the BibliographicItem model"
|
14
|
-
s.description = "RelatonIho: retrieve IHO Standards for bibliographic "\
|
14
|
+
s.description = "RelatonIho: retrieve IHO Standards for bibliographic " \
|
15
15
|
"using the BibliographicItem model"
|
16
16
|
|
17
17
|
s.files = Dir.chdir(File.expand_path(__dir__)) do
|
@@ -21,14 +21,10 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.require_paths = ["lib"]
|
22
22
|
s.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
|
23
23
|
|
24
|
-
s.add_development_dependency "byebug"
|
25
24
|
s.add_development_dependency "equivalent-xml", "~> 0.6"
|
26
25
|
s.add_development_dependency "rake", "~> 13.0"
|
27
26
|
s.add_development_dependency "rspec", "~> 3.0"
|
28
|
-
s.add_development_dependency "ruby-jing"
|
29
|
-
s.add_development_dependency "simplecov"
|
30
|
-
s.add_development_dependency "vcr"
|
31
|
-
s.add_development_dependency "webmock"
|
32
27
|
|
33
28
|
s.add_dependency "relaton-bib", "~> 1.14.0"
|
29
|
+
s.add_dependency "relaton-index", "~> 0.1.0"
|
34
30
|
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-iho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.14.
|
4
|
+
version: 1.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: byebug
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: equivalent-xml
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,75 +53,33 @@ dependencies:
|
|
67
53
|
- !ruby/object:Gem::Version
|
68
54
|
version: '3.0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
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: simplecov
|
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: vcr
|
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: webmock
|
56
|
+
name: relaton-bib
|
113
57
|
requirement: !ruby/object:Gem::Requirement
|
114
58
|
requirements:
|
115
|
-
- - "
|
59
|
+
- - "~>"
|
116
60
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
118
|
-
type: :
|
61
|
+
version: 1.14.0
|
62
|
+
type: :runtime
|
119
63
|
prerelease: false
|
120
64
|
version_requirements: !ruby/object:Gem::Requirement
|
121
65
|
requirements:
|
122
|
-
- - "
|
66
|
+
- - "~>"
|
123
67
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
68
|
+
version: 1.14.0
|
125
69
|
- !ruby/object:Gem::Dependency
|
126
|
-
name: relaton-
|
70
|
+
name: relaton-index
|
127
71
|
requirement: !ruby/object:Gem::Requirement
|
128
72
|
requirements:
|
129
73
|
- - "~>"
|
130
74
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
75
|
+
version: 0.1.0
|
132
76
|
type: :runtime
|
133
77
|
prerelease: false
|
134
78
|
version_requirements: !ruby/object:Gem::Requirement
|
135
79
|
requirements:
|
136
80
|
- - "~>"
|
137
81
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
82
|
+
version: 0.1.0
|
139
83
|
description: 'RelatonIho: retrieve IHO Standards for bibliographic using the BibliographicItem
|
140
84
|
model'
|
141
85
|
email:
|