relaton-iso 1.9.1 → 1.11.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29eb84a194e2b30d8c1c96245b684aa095db3e318bad16f2b79b5a5ac82d3b94
4
- data.tar.gz: 9ebd46ccc359db4e25d963569d489f2e8f9ae50e6c76fc3fb77e09ce947525cb
3
+ metadata.gz: f7fa7c91589b331ac4748d70c790b814bd294b73c8c35c12a1e7a6a2fa54ca38
4
+ data.tar.gz: 64ea8882a8c4ec26278f4bea0b8af25879b7ead65cc156117dadbeab8b606400
5
5
  SHA512:
6
- metadata.gz: a7f9ed212717dbf26fd10f8c041d4a182afa4212f9d961c1a7d8dfde3b41d6ad28123feddf2efb405223ae5aac3ec5e07ec12563c597ed2f03c5288270608fd5
7
- data.tar.gz: 117fb353efb5922529713e747a4ec6a1de144693ba5af0063b46a2b1ab7814631211a00659705ebc106a8d12b0a2fe338a5c0911ab6fee3b7b48bb41b4e6f727
6
+ metadata.gz: 1c8716c7c2ddb6fb8644b528cbddccf2c900897326b1f3897946247886e21c25452f71783cc696ba44cba7a2247b11577085c71f780c91fb060f4d72748c1af4
7
+ data.tar.gz: 1a91a1433ddf1312edb01e15348207573ed30f5d022b376757b2fda69ad8ae4be62090e726a8baede35e1ff3cdf95dcf5146bd863c6758e5dea4ccc047309dd8
data/.rubocop.yml CHANGED
@@ -2,6 +2,8 @@
2
2
  # https://github.com/riboseinc/oss-guides
3
3
  # All project-specific additions and overrides should be specified in this file.
4
4
 
5
+ require: rubocop-rails
6
+
5
7
  inherit_from:
6
8
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
9
  AllCops:
@@ -23,8 +23,10 @@ module RelatonIso
23
23
  # @param ref [String] the ISO standard Code to look up (e..g "ISO 9000")
24
24
  # @param year [String, NilClass] the year the standard was published
25
25
  # @param opts [Hash] options; restricted to :all_parts if all-parts
26
- # reference is required, :keep_year if undated reference should
27
- # return actual reference with year
26
+ # @option opts [Boolean] :all_parts if all-parts reference is required
27
+ # @option opts [Boolean] :keep_year if undated reference should return
28
+ # actual reference with year
29
+ #
28
30
  # @return [String] Relaton XML serialisation of reference
29
31
  def get(ref, year = nil, opts = {}) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity,Metrics/AbcSize
30
32
  code = ref.gsub(/\u2013/, "-")
@@ -42,7 +44,7 @@ module RelatonIso
42
44
  ret = isobib_get1(code, year, opts)
43
45
  return nil if ret.nil?
44
46
 
45
- if year && opts[:keep_year].nil? || opts[:keep_year] || opts[:all_parts]
47
+ if (year && opts[:keep_year].nil?) || opts[:keep_year] || opts[:all_parts]
46
48
  ret
47
49
  else
48
50
  ret.to_most_recent_reference
@@ -143,7 +145,7 @@ module RelatonIso
143
145
  # @param code [String]
144
146
  # @param opts [Hash]
145
147
  # @return [RelatonIso::HitCollection]
146
- def search_code(result, code, opts) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,PerceivedComplexity
148
+ def search_code(result, code, opts) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
147
149
  code1, part1, _, corr1, coryear1 = ref_components code
148
150
  result.select do |i|
149
151
  code2, part2, _, corr2, coryear2 = ref_components i.hit[:title]
@@ -29,7 +29,7 @@ module RelatonIso
29
29
  # @return [RelatonIsoBib::IsoBibliographicItem]
30
30
  def hash_to_bib(hash)
31
31
  item_hash = ::RelatonIsoBib::HashConverter.hash_to_bib(hash)
32
- ::RelatonIsoBib::IsoBibliographicItem.new **item_hash
32
+ ::RelatonIsoBib::IsoBibliographicItem.new(**item_hash)
33
33
  end
34
34
 
35
35
  # Returns hash of XML grammar
@@ -152,7 +152,7 @@ module RelatonIso
152
152
  url = DOMAIN + path
153
153
  uri = URI url
154
154
  resp = Net::HTTP.get_response(uri) # .encode("UTF-8")
155
- when "404"
155
+ when "404", "302"
156
156
  raise RelatonBib::RequestError, "#{url} not found."
157
157
  end
158
158
  n = 0
@@ -176,7 +176,7 @@ module RelatonIso
176
176
  def fetch_docid(doc, edition, langs)
177
177
  pubid = item_ref doc
178
178
  [
179
- RelatonBib::DocumentIdentifier.new(id: pubid, type: "ISO"),
179
+ RelatonBib::DocumentIdentifier.new(id: pubid, type: "ISO", primary: true),
180
180
  RelatonBib::DocumentIdentifier.new(
181
181
  id: fetch_urn(doc, pubid, edition, langs), type: "URN",
182
182
  ),
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIso
4
- VERSION = "1.9.1"
4
+ VERSION = "1.11.0"
5
5
  end
data/relaton_iso.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.bindir = "exe"
25
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
26
  spec.require_paths = ["lib"]
27
- spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
27
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
28
28
 
29
29
  spec.add_development_dependency "byebug"
30
30
  # spec.add_development_dependency "debase"
@@ -42,5 +42,5 @@ Gem::Specification.new do |spec|
42
42
 
43
43
  # spec.add_dependency "relaton-iec", "~> 1.8.0"
44
44
  spec.add_dependency "algolia"
45
- spec.add_dependency "relaton-iso-bib", "~> 1.9.0"
45
+ spec.add_dependency "relaton-iso-bib", "~> 1.11.0"
46
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1
4
+ version: 1.11.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: 2021-10-28 00:00:00.000000000 Z
11
+ date: 2022-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 1.9.0
187
+ version: 1.11.0
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 1.9.0
194
+ version: 1.11.0
195
195
  description: 'RelatonIso: retrieve ISO Standards for bibliographic use using the IsoBibliographicItem
196
196
  model'
197
197
  email:
@@ -250,7 +250,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
250
250
  requirements:
251
251
  - - ">="
252
252
  - !ruby/object:Gem::Version
253
- version: 2.4.0
253
+ version: 2.5.0
254
254
  required_rubygems_version: !ruby/object:Gem::Requirement
255
255
  requirements:
256
256
  - - ">="