relaton-ecma 1.14.3 → 1.14.5

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: 355c4680079e9d9fb205ae1fe1cc426728017f12626731a54b8eafc29ee9e058
4
- data.tar.gz: 4e289a1a46651d8cce4032d4f80f85a7422210d631c8633ce01fde008a53e98e
3
+ metadata.gz: a3a17d2f8126423b0eae703e2717b2d4f38c00fa9304f8fd82243d90723f031f
4
+ data.tar.gz: bc243dd95f471d0dceb3c8cf0e3e822de4129878c27fad8af41527a6b13c5300
5
5
  SHA512:
6
- metadata.gz: 286412c6cf8fd5fff1ff6050f887b018746b448d0e3ed6342af7a21e94ece2d08d2e3b6fb8674bb8812442ad9eb3e4626950b2007cb8f7157ff91e8e491997ba
7
- data.tar.gz: 7f9a10cc5f80cc4151512fc70b206e72d3e1d4f83ec6ab636975dde118c1f99705ebdc9dd1aac4bfa47294e11e6a26a4d520c79e6881bec21ab0e071b7c98dca
6
+ metadata.gz: f8e0b3621f7a3eb7ed634def125212dcd6e16bf1a7ff00bbb294a4abfed259cce576ba095d96025649997233e7ec6df611dc053c12c5370727c626270ae1aa9f
7
+ data.tar.gz: ef34bbb342969706f7d8b9f49d0c69c35cf9a3a87929508f7e30aeb491f1404fb1457b0ec15f83ee426501d9b0824952cfde6e86da19c55776cabd33e7a54948
@@ -15,22 +15,22 @@ module RelatonEcma
15
15
  #
16
16
  def search(ref)
17
17
  refparts = parse_ref ref
18
- return false unless refparts
18
+ return [] unless refparts
19
19
 
20
20
  index = Relaton::Index.find_or_create :ECMA, url: "#{ENDPOINT}index.zip"
21
21
  index.search { |row| match_ref refparts, row }
22
22
  end
23
23
 
24
24
  def parse_ref(ref)
25
- %r{^
26
- (?<id>ECMA(?:[\d-]+|\s\w+/\d+))
25
+ %r{^ECMA[-\s]
26
+ (?<id>(?:\d[\d-]*|\w+/\d+))
27
27
  (?:\sed(?<ed>[\d.]+))?
28
28
  (?:\svol(?<vol>\d+))?
29
29
  }x.match ref
30
30
  end
31
31
 
32
- def match_ref(refparts, row)
33
- row[:id][:id] == refparts[:id] &&
32
+ def match_ref(refparts, row) # rubocop:disable Metrics/AbcSize
33
+ row[:id][:id].match?(/^ECMA[-\s]#{refparts[:id]}/) &&
34
34
  (refparts[:ed].nil? || row[:id][:ed] == refparts[:ed]) &&
35
35
  (refparts[:vol].nil? || row[:id][:vol] == refparts[:vol])
36
36
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonEcma
2
- VERSION = "1.14.3".freeze
2
+ VERSION = "1.14.5".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ecma
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.3
4
+ version: 1.14.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-20 00:00:00.000000000 Z
11
+ date: 2023-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize