relaton-iso 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f816fe256a883b565f7b3b1a41503cbb1718e19db7a4132b4bed7b6e11a67123
4
- data.tar.gz: 18f3d87e6637e20b1b54255df3d5f8576f661808d357e7161df7074777e3e035
3
+ metadata.gz: b16b6af64ff1681bb4e985e3b5170a4d4b08b17c7f58fceff2b345f0df4b7979
4
+ data.tar.gz: 84da898090219191be786c258eca5a49613f652b12aeb99fbeef90cfed7845b4
5
5
  SHA512:
6
- metadata.gz: 420603c2ec9fb866efb5da22e15706d2d7f54ec464723b7ddf76900461d6e59c717cf391312411cb12cb131997f28f1dfb561fc877381ea1df90bd034e4fcd4e
7
- data.tar.gz: bd25b7a40dbbd476ace3493515502229ba57375add1bc04c4b719eabf71983e3b2bef7b5f7c840d81ead394ac078f60c7bd7bbcf46077d7274937eb3561b0361
6
+ metadata.gz: 57c02f05704f77701284bbde97c9172c18e0ae89d04ca47ab800037a3852939c93cb86327fa1d1b3a82c47eb134efad061d79f63b80c4189947514e518277708
7
+ data.tar.gz: 914bc1702c9c70bc3e7d4b8adfa52e70086a8a6f24726f909661e28659f7e6768b9d5378e68b50e3e5658272710d1ddd5e7a2c1aa6ac6d7be25f67af22af7cc3
@@ -42,6 +42,9 @@ module RelatonIso
42
42
  # @return [Pubid::Iso::Identifier]
43
43
  def pubid
44
44
  @pubid ||= Pubid::Iso::Identifier.parse_from_title(hit[:title])
45
+ rescue Pubid::Iso::Errors::WrongTypeError => e
46
+ warn "[relaton-iso] unable to find an identifier in \"#{hit[:title]}\"."
47
+ warn "[relaton-iso] #{e.message}"
45
48
  end
46
49
  end
47
50
  end
@@ -100,7 +100,18 @@ module RelatonIso
100
100
  query_pubid.part == pubid.part
101
101
  end
102
102
 
103
+ #
104
+ # Matches base of query_pubid and pubid.
105
+ #
106
+ # @param [Pubid::Iso::Identifier] query_pubid pubid to match
107
+ # @param [Pubid::Iso::Identifier] pubid pubid to match
108
+ # @param [Boolean] any_types_stages match with any types and stages
109
+ #
110
+ # @return [<Type>] <description>
111
+ #
103
112
  def matches_base?(query_pubid, pubid, any_types_stages: false) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics?PerceivedComplexity
113
+ return unless pubid
114
+
104
115
  query_pubid.publisher == pubid.publisher &&
105
116
  query_pubid.number == pubid.number &&
106
117
  query_pubid.copublisher == pubid.copublisher &&
@@ -237,16 +237,18 @@ module RelatonIso
237
237
  # Fetch workgroup.
238
238
  # @param doc [Nokogiri::HTML::Document]
239
239
  # @return [Hash]
240
- def fetch_workgroup(doc) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity
240
+ def fetch_workgroup(doc) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
241
241
  wg = doc.at("//div[@class='clearfix']")
242
242
  wg_link = wg.at "span/a"
243
+ return unless wg_link
244
+
243
245
  workgroup = wg_link.text.split "/"
244
246
  type = workgroup[1]&.match(/^[A-Z]+/)&.to_s || "TC"
245
- {
246
- name: "International Organization for Standardization",
247
- abbreviation: "ISO",
248
- url: "www.iso.org",
249
- }
247
+ # {
248
+ # name: "International Organization for Standardization",
249
+ # abbreviation: "ISO",
250
+ # url: "www.iso.org",
251
+ # }
250
252
  tc_numb = workgroup[1]&.match(/\d+/)&.to_s&.to_i
251
253
  tc_name = wg.at("span[@class='entry-title']").text
252
254
  tc = RelatonBib::WorkGroup.new(name: tc_name, identifier: wg_link.text,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIso
4
- VERSION = "1.14.0"
4
+ VERSION = "1.14.2"
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.14.0
4
+ version: 1.14.2
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-12-05 00:00:00.000000000 Z
11
+ date: 2022-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug