relaton-iso 1.11.0 → 1.11.1

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: f7fa7c91589b331ac4748d70c790b814bd294b73c8c35c12a1e7a6a2fa54ca38
4
- data.tar.gz: 64ea8882a8c4ec26278f4bea0b8af25879b7ead65cc156117dadbeab8b606400
3
+ metadata.gz: 57aaa988aba37afa1e4cc8eced55b20d46eda761cad5fc8a68ac33c3793afb82
4
+ data.tar.gz: 0ff660f7a7ffb558659c9d8577f075cfea9e225c2d9a7bf44d209745b0d7fc76
5
5
  SHA512:
6
- metadata.gz: 1c8716c7c2ddb6fb8644b528cbddccf2c900897326b1f3897946247886e21c25452f71783cc696ba44cba7a2247b11577085c71f780c91fb060f4d72748c1af4
7
- data.tar.gz: 1a91a1433ddf1312edb01e15348207573ed30f5d022b376757b2fda69ad8ae4be62090e726a8baede35e1ff3cdf95dcf5146bd863c6758e5dea4ccc047309dd8
6
+ metadata.gz: 8ef87dc1073df8b8653989494fda55f54cdcd780aaaa9d16e0af6e0ec6778021d73a2e81b23b18b751e95b2c607f6c27a49af50d8df1bbb95c7d9b7df76e3977
7
+ data.tar.gz: 154c64258dfc69a6ae01822593e0e9759648cc2f773c126f4474cd0aad8483a16e208613ccd582e94f4ea38c4c996cee089c5d5b844782f93ae2ec33be17151c
data/Gemfile CHANGED
@@ -1,6 +1,3 @@
1
- Encoding.default_external = Encoding::UTF_8
2
- Encoding.default_internal = Encoding::UTF_8
3
-
4
1
  source "https://rubygems.org"
5
2
 
6
3
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
@@ -31,8 +31,7 @@ module RelatonIso
31
31
  def get(ref, year = nil, opts = {}) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity,Metrics/AbcSize
32
32
  code = ref.gsub(/\u2013/, "-")
33
33
  # %r{\s(?<num>\d+)(?:-(?<part>[\d-]+))?(?::(?<year1>\d{4}))?} =~ code
34
- _, _part, year1, = ref_components ref
35
- year ||= year1
34
+ year ||= publish_year ref
36
35
  code.sub! " (all parts)", ""
37
36
  opts[:all_parts] ||= $~ && opts[:all_parts].nil?
38
37
  # opts[:keep_year] ||= opts[:keep_year].nil?
@@ -41,7 +40,7 @@ module RelatonIso
41
40
  # return RelatonIec::IecBibliography.get(code, year, opts)
42
41
  # end
43
42
 
44
- ret = isobib_get1(code, year, opts)
43
+ ret = isobib_get(code, year, opts)
45
44
  return nil if ret.nil?
46
45
 
47
46
  if (year && opts[:keep_year].nil?) || opts[:keep_year] || opts[:all_parts]
@@ -166,7 +165,8 @@ module RelatonIso
166
165
  def isobib_results_filter(result, year, opts)
167
166
  missed_years = []
168
167
  hits = result.reduce!([]) do |hts, h|
169
- if !year || (%r{:(?<iyear>\d{4})(?!.*:\d{4})} =~ h.hit[:title] && iyear == year)
168
+ iyear = publish_year h.hit[:title]
169
+ if !year || iyear == year
170
170
  hts << h
171
171
  else
172
172
  missed_years << iyear
@@ -183,10 +183,15 @@ module RelatonIso
183
183
  end
184
184
  # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
185
185
 
186
+ def publish_year(ref)
187
+ %r{:(?<year>\d{4})(?!.*:\d{4})} =~ ref
188
+ year
189
+ end
190
+
186
191
  # @param code [String]
187
192
  # @param year [String, NilClass]
188
193
  # @param opts [Hash]
189
- def isobib_get1(code, year, opts)
194
+ def isobib_get(code, year, opts)
190
195
  # return iev(code) if /^IEC 60050-/.match code
191
196
  result = isobib_search_filter(code, opts) || return
192
197
  ret = isobib_results_filter(result, year, opts)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIso
4
- VERSION = "1.11.0"
4
+ VERSION = "1.11.1"
5
5
  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.11.0
4
+ version: 1.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-10 00:00:00.000000000 Z
11
+ date: 2022-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug