relaton-iso 1.0.1 → 1.0.2

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: 0cbed7056136ece40250512abb969807dbec09fc8ccf7f35c0630cf2bb505930
4
- data.tar.gz: f102924d725dbf89310e7b834cff58eea44e4bf394e8e32afa9b896dc6a49f3b
3
+ metadata.gz: 726ca28930d18170b319b15d5409f51e7954951c8a527ec22643ebab2e484002
4
+ data.tar.gz: d063fdc6390a3ace1f03569bb97b85c9e56d7b1ee8d992e809a154ddaa847939
5
5
  SHA512:
6
- metadata.gz: 52e04fb0cc61407b669e0ad1cdc30220149efe16d72099ac97cca2503847e9d58e18cacd13703142a6bc654ce07c6d953e50640f9018849335b85782b700b840
7
- data.tar.gz: f54fc59412c41567637ab92df52dd528fd6c02e7699c5d89a9c385ea37c00e5fc8671581a46579580d467e6206b0f48782113f62a7a2bb163227ac3bc0bf349d
6
+ metadata.gz: cf93495c08d8f32b1d08e8c87b6bc8cf7175be8f2ce153862e930e48635f6e238471bd84fda2aa0877351755e973d6bb96e5f01023d23602e6b125fa1dfd333e
7
+ data.tar.gz: f007ab7035dbaaf3ff603afba1ac944a3b2f22eff1da682078db5f3272248202f4df9668c237e9e2f97b69bd49ee64a281a7a8335cbfe2d1823b5df62ad9c7d4
@@ -12,7 +12,7 @@ module RelatonIso
12
12
  # @param text [String]
13
13
  # @return [RelatonIso::HitCollection]
14
14
  def search(text)
15
- HitCollection.new text
15
+ HitCollection.new text.gsub(/\u2013/, "-")
16
16
  rescue SocketError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET,
17
17
  EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError,
18
18
  Net::ProtocolError, OpenSSL::SSL::SSLError, Errno::ETIMEDOUT
@@ -26,15 +26,15 @@ module RelatonIso
26
26
  # return actual reference with year
27
27
  # @return [String] Relaton XML serialisation of reference
28
28
  def get(ref, year = nil, opts = {})
29
- opts[:ref] = ref
29
+ opts[:ref] = ref.gsub(/\u2013/, "-")
30
30
 
31
31
  %r{
32
32
  ^(?<code1>[^\s]+\s[^/]+) # match code
33
33
  /?
34
34
  (?<corr>(Amd|DAmd|(CD|WD|AWI|NP)\sAmd|Cor|CD\sCor|FDAmd|PRF\sAmd)\s\d+ # correction name
35
35
  :?(\d{4})?(/Cor\s\d+:\d{4})?) # match correction year
36
- }x =~ ref
37
- code = code1 || ref
36
+ }x =~ opts[:ref]
37
+ code = code1 || opts[:ref]
38
38
 
39
39
  if year.nil?
40
40
  /^(?<code1>[^\s]+(\s\w+)?\s[\d-]+)(:(?<year1>\d{4}))?(?<code2>\s\w+)?/ =~ code
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIso
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
5
5
  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.0.1
4
+ version: 1.0.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: 2020-04-28 00:00:00.000000000 Z
11
+ date: 2020-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug