relaton-iso 1.9.1 → 1.10.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: 29eb84a194e2b30d8c1c96245b684aa095db3e318bad16f2b79b5a5ac82d3b94
4
- data.tar.gz: 9ebd46ccc359db4e25d963569d489f2e8f9ae50e6c76fc3fb77e09ce947525cb
3
+ metadata.gz: cd281fdcf928bfe44ad8f9b162f09e75a9c25835c93625ed9416ebf60c0a7c8d
4
+ data.tar.gz: f24e00ea160d81d7c932f77b35639b119955f291ec4c5c0c60de64ab87fcce70
5
5
  SHA512:
6
- metadata.gz: a7f9ed212717dbf26fd10f8c041d4a182afa4212f9d961c1a7d8dfde3b41d6ad28123feddf2efb405223ae5aac3ec5e07ec12563c597ed2f03c5288270608fd5
7
- data.tar.gz: 117fb353efb5922529713e747a4ec6a1de144693ba5af0063b46a2b1ab7814631211a00659705ebc106a8d12b0a2fe338a5c0911ab6fee3b7b48bb41b4e6f727
6
+ metadata.gz: 5739dbe20f4fe2b841057b720569db621ac96e5aba68f2c1aedd7c3977a3e227c1d424f1c34d513c429b30e9eb0dd18fda807e4833bb0bc04f9d91a172c5ad2f
7
+ data.tar.gz: 59b4bb9fd476e1f2cf275001f0d799140782e79b539e5f8d4458c5849d36eda7aaac040a366b7803206ecd4c9906c994c1209d8dafce44d64d61cc997a22bd86
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIso
4
- VERSION = "1.9.1"
4
+ VERSION = "1.10.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.10.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.10.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-01-30 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.10.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.10.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
  - - ">="