relaton-bsi 1.8.2 → 1.8.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: 13efd56cc3a6385fd5c2ce36e2d75ff8cd95b1710deaee698a7b2054579611c2
4
- data.tar.gz: e18d0accb3b0fb2cdde654641a518b1fb11f89048511f679410bc3c0eef79238
3
+ metadata.gz: 84f6c2293e2c3e5fce33f142ae0e5055f000c0066a19a030dc67e29f360424b6
4
+ data.tar.gz: 2c70d908fc92fc700695c967087f0eb4d9217e660ed997b270688269422fa58a
5
5
  SHA512:
6
- metadata.gz: 3d7c353a369903ef533bdd73e096aa9a977927cd41e5e604824c9cbd2fe92d343a8e5e5963eedc06b989eb8464bea3715ef6df2d95d29a15b6bd0aff19b42aad
7
- data.tar.gz: c2ffe98c30cf1f6962310c959b72f19a071ee0ed81f6dfce530a56f42bf77c635322f2a617cf78b5d873fcb32da5e1909c4c8d51ec9a64a033539e49494dd7a5
6
+ metadata.gz: 7b7e2d420bd3bb4b9da454e7b69cc78ec1d262b3918ba23b565ce43824e4092f5b6793dd7a5b7dc3ffc0d8f11fdc9d75012fac62dd0defa0f201da4c4e7016be
7
+ data.tar.gz: 2f11789f4274ff43ef07c8ddf44b141e6b524d76cd9fd53b996c6c1d6b22c17e31d649469a424b0b3e385caf1342a1c53fe5fb73e3b752106c591c9b3aa4163e
data/README.adoc CHANGED
@@ -33,7 +33,7 @@ Or install it yourself as:
33
33
  ----
34
34
  require 'relaton_bsi'
35
35
 
36
- hit_collection = RelatonBsi::BsiBibliography.search("BSI BS EN ISO 8848")
36
+ hit_collection = RelatonBsi::BsiBibliography.search("BS EN ISO 8848")
37
37
  => <RelatonBsi::HitCollection:0x007fead49fe1f8 @ref=BS EN ISO 8848 @fetched=false>
38
38
 
39
39
  item = hit_collection[1].fetch
@@ -118,15 +118,15 @@ item.to_xml bibdata: true
118
118
  [source,ruby]
119
119
  ----
120
120
  RelatonBsi::BsiBibliographicItem RelatonBsi::BsiBibliography
121
- [7] pry(main)> RelatonBsi::BsiBibliography.get "BSI BS EN ISO 8848:2021"
122
- [relaton-bsi] ("BSI BS EN ISO 8848:2021") fetching...
123
- [relaton-bsi] ("BSI BS EN ISO 8848:2021") found BS EN ISO 8848:2021
121
+ [7] pry(main)> RelatonBsi::BsiBibliography.get "BS EN ISO 8848:2021"
122
+ [relaton-bsi] ("BS EN ISO 8848:2021") fetching...
123
+ [relaton-bsi] ("BS EN ISO 8848:2021") found BS EN ISO 8848:2021
124
124
  => #<RelatonBsi::BsiBibliographicItem:0x007feb14814ca8
125
125
  ...
126
126
 
127
- RelatonBsi::BsiBibliography.get "BSI BS EN ISO 8848", "2021"
128
- [relaton-bsi] ("BSI BS EN ISO 8848") fetching...
129
- [relaton-bsi] ("BSI BS EN ISO 8848") found BS EN ISO 8848:2021
127
+ RelatonBsi::BsiBibliography.get "BS EN ISO 8848", "2021"
128
+ [relaton-bsi] ("BS EN ISO 8848") fetching...
129
+ [relaton-bsi] ("BS EN ISO 8848") found BS EN ISO 8848:2021
130
130
  => #<RelatonBsi::BsiBibliographicItem:0x007feaf59188a8
131
131
  ...
132
132
  ----
@@ -29,15 +29,9 @@ module RelatonBsi
29
29
  # @param opts [Hash] options; restricted to :all_parts if all-parts reference is required
30
30
  # @return [String] Relaton XML serialisation of reference
31
31
  def get(code, year = nil, opts = {}) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
32
- # if year.nil?
33
- # /^(?<code1>[^\s]+\s[^\s]+)\s\((\d{2}\/)?(?<year1>\d+)\)$/ =~ code
34
- # unless code1.nil?
35
- # code = code1
36
- # year = year1
37
- # end
38
- # end
39
-
40
- ret = bib_get1(code, year, opts)
32
+ c, y = code.split ':'
33
+ year ||= y
34
+ ret = bib_get1(c, year, opts)
41
35
  return nil if ret.nil?
42
36
 
43
37
  # ret = ret.to_most_recent_reference unless year || opts[:keep_year]
@@ -67,7 +61,8 @@ module RelatonBsi
67
61
  end
68
62
 
69
63
  def search_filter(code) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
70
- %r{^BSI\s(?<code1>[^:]+)} =~ code
64
+ # %r{^BSI\s(?<code1>[^:]+)} =~ code
65
+ code1 = code.sub(/^BSI\s/, "")
71
66
  warn "[relaton-bsi] (\"#{code}\") fetching..."
72
67
  return [] unless code1
73
68
 
@@ -5,7 +5,7 @@ module RelatonBsi
5
5
  def initialize
6
6
  @short = :relaton_bsi
7
7
  @prefix = "BSI"
8
- @defaultprefix = %r{^BSI\s}
8
+ @defaultprefix = %r{^(BSI|BS|PD)\s}
9
9
  @idtype = "BSI"
10
10
  end
11
11
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonBsi
4
- VERSION = "1.8.2"
4
+ VERSION = "1.8.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-bsi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.2
4
+ version: 1.8.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: 2021-06-22 00:00:00.000000000 Z
11
+ date: 2021-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml