relaton-etsi 1.19.0 → 1.20.1

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: 7e6de56729e08a6ed75056d304e5bf59b79882496c0e86edf99ba144ef56e3ac
4
- data.tar.gz: fc98cc4219dba9e46e33a25217eab20d2ce97512229b619bdf7984e8f8d078ba
3
+ metadata.gz: 7eb7d28bd38802dabf44bb9829c1fafcc0684d3ac1ebeadd42cce18cc7ecec87
4
+ data.tar.gz: 0e6496f3c29a8bc929ceacc333bb02d9edb87e2d795a4e91b55d525adbbc2d2c
5
5
  SHA512:
6
- metadata.gz: 45a0d19f40ad27cd253bbabdeeda09585df5354ffbcc5b24a92ece33a1afb3fa4c1ca77d58bae5d99fc71ef7c086f317a18236345d60cb0184bf79a33d91a861
7
- data.tar.gz: c7c6c1ea3ba9544809ea59b0c90b891efea0d6212c342788e8723c970a2321d3f9912395bd2ea86ecedf9f0db9e868ced450491039f2f479dad013e056c1d04b
6
+ metadata.gz: 859319f0d1eacbcde84a5e235ef697ef5dbe6e8edb147381b1f0c53610ea1417cf9fb200eaf3d3924de9ad8aa780118308bbcd512187e49936218076697e585e
7
+ data.tar.gz: c7cd3a40a80bc5a721b937a1be63b6d64e1214404fe5be06fade0ba4ee030c94952a836f3f6e4e4f3f0d21c8d7f04c59641aa42198c8d29c0220871509ad2ee7
@@ -55,13 +55,17 @@ module RelatonEtsi
55
55
 
56
56
  def to_hash # rubocop:disable Metrics/AbcSize
57
57
  hash = super
58
- hash["marker"] = marker if marker
59
- hash["frequency"] = frequency if frequency.any?
60
- hash["mandate"] = mandate if mandate.any?
61
- hash["custom_collection"] = custom_collection if custom_collection
58
+ hash["ext"]["marker"] = marker if marker
59
+ hash["ext"]["frequency"] = frequency if frequency.any?
60
+ hash["ext"]["mandate"] = mandate if mandate.any?
61
+ hash["ext"]["custom_collection"] = custom_collection if custom_collection
62
62
  hash
63
63
  end
64
64
 
65
+ def has_ext?
66
+ super || marker || frequency.any? || mandate.any? || custom_collection
67
+ end
68
+
65
69
  def to_asciibib(prefix = "") # rubocop:disable Metrics/AbcSize
66
70
  out = super
67
71
  pref = prefix.empty? ? prefix : "#{prefix}."
@@ -27,10 +27,13 @@ module RelatonEtsi
27
27
  end
28
28
 
29
29
  def fetch
30
+ time = Time.now
31
+ date = time.to_date + 1
32
+ timestamp = (time.to_f * 1000).to_i
30
33
  url = "https://www.etsi.org/?option=com_standardssearch&view=data&format=csv&includeScope=1&page=1&search=&" \
31
34
  "title=1&etsiNumber=1&content=1&version=0&onApproval=1&published=1&withdrawn=1&historical=1&isCurrent=1&" \
32
- "superseded=1&startDate=1988-01-15&endDate=2023-10-31&harmonized=0&keyword=&TB=&stdType=&frequency=&" \
33
- "mandate=&collection=&sort=1&x=1698720135146"
35
+ "superseded=1&startDate=1988-01-15&endDate=#{date}&harmonized=0&keyword=&TB=&stdType=&frequency=&" \
36
+ "mandate=&collection=&sort=1&x=#{timestamp}"
34
37
  csv = OpenURI.open_uri(url) { |f| f.readlines.join }
35
38
  CSV.parse(csv, headers: true, col_sep: ';', skip_lines: /sep=;/).each do |row|
36
39
  save DataParser.new(row).parse
@@ -3,6 +3,15 @@ module RelatonEtsi
3
3
  include RelatonBib::HashConverter
4
4
  extend self
5
5
 
6
+ def hash_to_bib(hash) # rubocop:disable Metrics/AbcSize
7
+ ret = super
8
+ ret[:marker] = hash["ext"]["marker"] if hash.dig("ext", "marker")
9
+ ret[:frequency] = hash["ext"]["frequency"] if hash.dig("ext", "frequency")
10
+ ret[:mandate] = hash["ext"]["mandate"] if hash.dig("ext", "mandate")
11
+ ret[:custom_collection] = hash["ext"]["custom_collection"] if hash.dig("ext", "custom_collection")
12
+ ret
13
+ end
14
+
6
15
  private
7
16
 
8
17
  # @param item_hash [Hash]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonEtsi
4
- VERSION = "1.19.0"
4
+ VERSION = "1.20.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-etsi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.0
4
+ version: 1.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-03 00:00:00.000000000 Z
11
+ date: 2025-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: csv
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.19.0
33
+ version: 1.20.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.19.0
40
+ version: 1.20.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: relaton-index
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -88,7 +88,7 @@ licenses:
88
88
  - BSD-2-Clause
89
89
  metadata:
90
90
  homepage_uri: https://github.com/relaton/relaton-etsi
91
- post_install_message:
91
+ post_install_message:
92
92
  rdoc_options: []
93
93
  require_paths:
94
94
  - lib
@@ -103,8 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubygems_version: 3.3.27
107
- signing_key:
106
+ rubygems_version: 3.5.22
107
+ signing_key:
108
108
  specification_version: 4
109
109
  summary: 'RelatonEtsi: retrieve ETSI Standards for bibliographic using the BibliographicItem
110
110
  model'