relaton-ogc 0.7.2 → 0.7.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: 6bd13cc6c208a1cfa5cef0c34536b744046ce13cba6e8d460d9dbd1e4821bb29
4
- data.tar.gz: 295fc39aa2d090bd95d4f2158a6e2269c5be71de6acb071e977e996997b3bf7f
3
+ metadata.gz: b0588bbb11ac1d847d00506794072698ff2290d74d8808aa7459e098ea9d8d6b
4
+ data.tar.gz: beef430cb8f52f468882efaf7c978476051848580f844ce30adb9e4479a5bb0a
5
5
  SHA512:
6
- metadata.gz: 8a57516d421c810c881958c5d411c66cf48e78fc113a4350b1c786be50c7b23e14b13d2aa021a6462e22e79898fa7b2a15d455f44b98ccd3f9398e024d1c9bfb
7
- data.tar.gz: 5226393c8c7612e76b689849e4b6453f944d407ce20f0ee6bbee0314927db4c4c7a96dff29bb7d2fdd381c04627fb986ca7a05d1cbc9ed2744ef9c575d1e6f95
6
+ metadata.gz: 9296b53dbbd307564ca9c104164c51e03ec08ede9e26c625da4b1343a17db2eb54afac023cfabe203253aecc9e1a6772fb4ff373d920756a4c4501e7eb17fed9
7
+ data.tar.gz: 713270bf7321e4b03b8a963f3a69a36940ed00d3f3819a30dad93e046e4f8778bcd44e89d42b1cccacace34c64c090ebc2276aa6ab4f5227d9b70b24d28af859
@@ -16,7 +16,11 @@ module RelatonOgc
16
16
  def initialize(ref, year = nil)
17
17
  super
18
18
  @array = from_json(ref).sort_by do |hit|
19
- hit.hit["date"] ? Date.parse(hit.hit["date"]) : Date.new
19
+ begin
20
+ hit.hit["date"] ? Date.parse(hit.hit["date"]) : Date.new
21
+ rescue ArgumentError
22
+ Date.parse "0000-01-01"
23
+ end
20
24
  end.reverse
21
25
  end
22
26
 
@@ -27,7 +31,9 @@ module RelatonOgc
27
31
  #
28
32
  # @param docid [String]
29
33
  def from_json(docid, **_opts)
30
- ref = docid.sub /^OGC\s/, ""
34
+ ref = docid.sub(/^OGC\s/, "").strip
35
+ return [] if ref.empty?
36
+
31
37
  data.select do |_k, doc|
32
38
  doc["type"] != "CC" && doc["identifier"].include?(ref)
33
39
  end.map { |_k, h| Hit.new(h, self) }
@@ -1,3 +1,3 @@
1
1
  module RelatonOgc
2
- VERSION = "0.7.2".freeze
2
+ VERSION = "0.7.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.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: 2020-04-18 00:00:00.000000000 Z
11
+ date: 2020-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase