relaton-iso 1.13.1 → 1.13.3

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: f7957abd3baa9506418de82f57fd7bdb8e007bd3db0319a8a4c3ce60620afab2
4
- data.tar.gz: a8757774fbcd0925f911e2e981972304bbdf19fb8f7da18827538edc2c2a1f31
3
+ metadata.gz: 36560c5f9f49d1ff9855a051c71b562bfddd82fc1c862cf08b35b1129ec69720
4
+ data.tar.gz: 4900a496e3b112b40dda6ab2acc4fe40db02084b01f42545de104a9c12dff922
5
5
  SHA512:
6
- metadata.gz: fe1eb0dc20bb16c7209d0339719ea7ea105e3942e6435231318f5791ebc404dd6aaede200296fbcc4ef545b561a5f9b993a1dd84dc7c6ee9e7e75b0b994a0715
7
- data.tar.gz: 04d922e293b122a75a5d07b0093c62e2a6fde2024c4ce92188d6dbae1a131aafcd7900f897e32309348f1cf7b9ed7be1eefe249f250836b266f1887c5bb26ecd
6
+ metadata.gz: 2bcea09926b89d5c6d3017376b75ee79916d9e5ace197592dc6d42cd77d715d4ad67896165c5a17a0b31e7d8ab45c9219f6713aea03f6c08d9dc622792bff074
7
+ data.tar.gz: 883976ba644b4ffae07292c4ad754fda13d195a3b34a6c03ffdc1382f44184bd0b0fd50ad270ae97ad69cf7d4d5c47e4f3d18098ed5bb6fcaa292deeb5c00e17
@@ -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 }}
@@ -92,13 +92,13 @@ module RelatonIso
92
92
 
93
93
  # filter by year
94
94
  hits = hit_collection.select do |hit|
95
- if hit.pubid.year == year
95
+ if hit.pubid.year.to_s == year.to_s
96
96
  true
97
97
  elsif hit.pubid.year.nil? && hit.hit[:year].to_s == year
98
98
  hit.pubid.year = year
99
99
  true
100
100
  else
101
- missed_year = hit.pubid.year || hit.hit[:year].to_s
101
+ missed_year = (hit.pubid.year || hit.hit[:year]).to_s
102
102
  if missed_year && !missed_year.empty? && !missed_years.include?(missed_year)
103
103
  missed_years << missed_year
104
104
  end
@@ -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.13.1"
4
+ VERSION = "1.13.3"
5
5
  end
data/relaton_iso.gemspec CHANGED
@@ -39,6 +39,6 @@ Gem::Specification.new do |spec|
39
39
  spec.add_development_dependency "webmock"
40
40
 
41
41
  spec.add_dependency "algolia"
42
- spec.add_dependency "pubid-iso", "~> 0.1.8"
42
+ spec.add_dependency "pubid-iso", "0.1.10"
43
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.13.1
4
+ version: 1.13.3
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-24 00:00:00.000000000 Z
11
+ date: 2022-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -182,16 +182,16 @@ dependencies:
182
182
  name: pubid-iso
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - "~>"
185
+ - - '='
186
186
  - !ruby/object:Gem::Version
187
- version: 0.1.8
187
+ version: 0.1.10
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: 0.1.8
194
+ version: 0.1.10
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: relaton-iso-bib
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -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"