From 179c87d8762b0b1e1fc2262cc71a5ebb4c705f6f Mon Sep 17 00:00:00 2001 From: Andrei Kislichenko Date: Tue, 21 Feb 2023 13:12:36 -0500 Subject: [PATCH] fix issue #20 --- lib/relaton_bsi/scrapper.rb | 2 +- spec/fixtures/bibdata.xml | 8 ++++---- spec/fixtures/bibdata_year.xml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/relaton_bsi/scrapper.rb b/lib/relaton_bsi/scrapper.rb index f7c0f14..9d116fd 100644 --- a/lib/relaton_bsi/scrapper.rb +++ b/lib/relaton_bsi/scrapper.rb @@ -76,7 +76,7 @@ def parse_page(hit) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength fetched: Date.today.to_s, type: "standard", docid: fetch_docid(hit.hit[:code], data), - docnumber: hit.hit[:code].gsub(/[\s:-]+/, ""), + docnumber: hit.hit[:code].match(/\d+\S+/).to_s, language: ["en"], script: ["Latn"], title: fetch_titles(hit.hit[:title]), diff --git a/spec/fixtures/bibdata.xml b/spec/fixtures/bibdata.xml index dccd3bc..3391e76 100644 --- a/spec/fixtures/bibdata.xml +++ b/spec/fixtures/bibdata.xml @@ -1,11 +1,11 @@ - 2023-02-20 + 2023-02-21 Small craft. Remote mechanical steering systems Small craft. Remote mechanical steering systems https://shop.bsigroup.com/products/small-craft-remote-mechanical-steering-systems-2 BS EN ISO 8848 978 0 539 18833 2 - BSENISO88482022 + 8848:2022 @@ -31,13 +31,13 @@ - 2023-02-20 + 2023-02-21 Small craft. Remote mechanical steering systems Small craft. Remote mechanical steering systems https://shop.bsigroup.com/products/small-craft-remote-mechanical-steering-systems-2 BS EN ISO 8848:2022 978 0 539 18833 2 - BSENISO88482022 + 8848:2022 2022-08-31 diff --git a/spec/fixtures/bibdata_year.xml b/spec/fixtures/bibdata_year.xml index 38c2b72..020c179 100644 --- a/spec/fixtures/bibdata_year.xml +++ b/spec/fixtures/bibdata_year.xml @@ -1,11 +1,11 @@ - 2023-02-20 + 2023-02-21 Small craft. Remote mechanical steering systems Small craft. Remote mechanical steering systems https://shop.bsigroup.com/products/small-craft-remote-mechanical-steering-systems BS EN ISO 8848:2021 978 0 539 18833 2 - BSENISO88482021 + 8848:2021 2021-04-30