relaton-iso 1.12.4 → 1.13.2

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: c89e5819f5ee242c8ff64f7d961a18f38af1b8652b8645fc41562b95fd8bd55d
4
- data.tar.gz: 777ef30bd94bf5a782edc673d58377dc9c52a1a85a203d684d844a0784bafc64
3
+ metadata.gz: d999763ca36d83d0332129d704f5f8989c1c606c2ae0037a8d07ee466a3e046e
4
+ data.tar.gz: 5aa8659bd16f7463f3a4d49f32a748b77c6cdded83dbac7feab12fca2d06c5a5
5
5
  SHA512:
6
- metadata.gz: 83a023461e1f6c98748a23bae33e9aaa8c745e397ac7adbc741060b6e370a94ca5a6055193e0c1abe6a259a4eff3693a2d1b8de27331152695329a83821b9ef2
7
- data.tar.gz: e58c71d35a9b23fd34a62c24b273eb104b7a577b6cf37315af3d46ef5dd1d1deb6a41c5f95fe543838f9a6dd9f2ebd30d3501ffd773647a8f98cf6ab2684056f
6
+ metadata.gz: d5ac24c248308871cfe2cc98f28e09401f1ee6c4eee6a399605a3d25c2cc19baa4cf4fa52b76c2b68ca84d8909355d6cc09a118d6a63dbb4e108b473c506f3a2
7
+ data.tar.gz: ece1fa36fe8dd5a8fd9dd2f826ee7c38114ec828f6d1151bd89ceab197623279f8940e33942eb664b6dbc4d44e8aca2d12aa377eb5e5ddcab58ed6d970d0db65
@@ -0,0 +1,22 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: release
4
+
5
+ on:
6
+ workflow_dispatch:
7
+ inputs:
8
+ next_version:
9
+ description: |
10
+ Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
11
+ required: true
12
+ default: 'skip'
13
+ push:
14
+ tags: [ v* ]
15
+
16
+ jobs:
17
+ release:
18
+ uses: relaton/support/.github/workflows/release.yml@master
19
+ with:
20
+ next_version: ${{ github.event.inputs.next_version }}
21
+ secrets:
22
+ rubygems-api-key: ${{ secrets.RELATON_CI_RUBYGEMS_API_KEY }}
@@ -58,6 +58,8 @@ module RelatonIso
58
58
  else
59
59
  ret.to_most_recent_reference
60
60
  end
61
+ rescue Pubid::Core::Errors::ParseError
62
+ warn "[relaton-iso] (\"#{code}\") is not recognized as a standards identifier."
61
63
  end
62
64
 
63
65
  # @param query_pubid [Pubid::Iso::Identifier]
@@ -60,8 +60,8 @@ module RelatonIso
60
60
  doc, url = get_page "#{hit.hit[:path].sub '/sites/isoorg', ''}.html"
61
61
 
62
62
  # Fetch edition.
63
- edition = doc&.xpath("//strong[contains(text(), 'Edition')]/..")
64
- &.children&.last&.text&.match(/\d+/)&.to_s
63
+ edition = doc.at("//div[div[.='Edition']]/text()[last()]")
64
+ &.text&.match(/\d+$/)&.to_s
65
65
  hit.pubid.edition = edition if edition
66
66
 
67
67
  titles, abstract, langs = fetch_titles_abstract(doc, lang)
@@ -239,21 +239,20 @@ module RelatonIso
239
239
  # @param doc [Nokogiri::HTML::Document]
240
240
  # @return [Hash]
241
241
  def fetch_workgroup(doc) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity
242
- wg_link = doc.css("div.entry-name.entry-block a")[0]
243
- # wg_url = DOMAIN + wg_link['href']
242
+ wg = doc.at("//div[@class='clearfix']")
243
+ wg_link = wg.at "span/a"
244
244
  workgroup = wg_link.text.split "/"
245
245
  type = workgroup[1]&.match(/^[A-Z]+/)&.to_s || "TC"
246
246
  {
247
247
  name: "International Organization for Standardization",
248
248
  abbreviation: "ISO",
249
249
  url: "www.iso.org",
250
- technical_committee: [{
251
- name: doc.css("div.entry-title")[0].text,
252
- identifier: wg_link.text,
253
- type: type,
254
- number: workgroup[1]&.match(/\d+/)&.to_s&.to_i,
255
- }],
256
250
  }
251
+ tc_numb = workgroup[1]&.match(/\d+/)&.to_s&.to_i
252
+ tc_name = wg.at("span[@class='entry-title']").text
253
+ tc = RelatonBib::WorkGroup.new(name: tc_name, identifier: wg_link.text,
254
+ type: type, number: tc_numb)
255
+ RelatonIsoBib::EditorialGroup.new(technical_committee: [tc])
257
256
  end
258
257
 
259
258
  # rubocop:disable Metrics/MethodLength
@@ -266,7 +265,7 @@ module RelatonIso
266
265
  doc.xpath("//ul[@class='steps']/li", "//div[@class='sub-step']").reduce([]) do |a, r|
267
266
  r_type = r.at("h4", "h5").text
268
267
  date = []
269
- type = case r_type
268
+ type = case r_type.strip
270
269
  when "Previously", "Will be replaced by" then "obsoletes"
271
270
  when "Corrigenda / Amendments", "Revised by", "Now confirmed"
272
271
  on = doc.xpath('//span[@class="stage-date"][contains(., "-")]').last
@@ -374,8 +373,7 @@ module RelatonIso
374
373
  # @param doc [Nokogiri::HTML::Document]
375
374
  # @return [Array<Hash>]
376
375
  def fetch_ics(doc)
377
- doc.xpath("//strong[contains(text(), "\
378
- "'ICS')]/../following-sibling::dd/div/a").map do |i|
376
+ doc.xpath("//dl[dt/strong[.='ICS']]/dd/span/a").map do |i|
379
377
  code = i.text.match(/[\d.]+/).to_s.split "."
380
378
  { field: code[0], group: code[1], subgroup: code[2] }
381
379
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIso
4
- VERSION = "1.12.4"
4
+ VERSION = "1.13.2"
5
5
  end
data/relaton_iso.gemspec CHANGED
@@ -40,5 +40,5 @@ Gem::Specification.new do |spec|
40
40
 
41
41
  spec.add_dependency "algolia"
42
42
  spec.add_dependency "pubid-iso", "~> 0.1.8"
43
- spec.add_dependency "relaton-iso-bib", "~> 1.12.0"
43
+ spec.add_dependency "relaton-iso-bib", "~> 1.13.0"
44
44
  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.12.4
4
+ version: 1.13.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-08-07 00:00:00.000000000 Z
11
+ date: 2022-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -198,14 +198,14 @@ dependencies:
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: 1.12.0
201
+ version: 1.13.0
202
202
  type: :runtime
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: 1.12.0
208
+ version: 1.13.0
209
209
  description: 'RelatonIso: retrieve ISO Standards for bibliographic use using the IsoBibliographicItem
210
210
  model'
211
211
  email:
@@ -215,6 +215,7 @@ extensions: []
215
215
  extra_rdoc_files: []
216
216
  files:
217
217
  - ".github/workflows/rake.yml"
218
+ - ".github/workflows/release.yml"
218
219
  - ".gitignore"
219
220
  - ".hound.yml"
220
221
  - ".rspec"