relaton-cen 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +10 -0
- data/lib/relaton_cen/cen_bibliography.rb +2 -2
- data/lib/relaton_cen/processor.rb +2 -2
- data/lib/relaton_cen/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz: '
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '081d36b18e6244bc5df7cc4c0a982bd06f320fec46a0dba61b539d4d24dd4e45'
|
4
|
+
data.tar.gz: 3858963049efe36e7547139aa1d83adcab5f2ad01abad114929cab64321b9bef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3cb4c16b429828002c5f3dbc8f2e345d72ed7494b6e8e98eab1d35a1e88cac3ed34a655a5e361fa2245a6b70db864ee406dd3230e9e4b0a9f24c6ecf0bb0855
|
7
|
+
data.tar.gz: 72e4202622d7c86491dc2d408f534c68c931da388a9bff2f1869efaa893ee36eb68b8fcbabf4fb1915211da1268f436c5b70b5939f91e2c097ccd7c2f47b5243
|
data/README.adoc
CHANGED
@@ -152,6 +152,16 @@ puts item.to_xml(bibdata: true)
|
|
152
152
|
</bibdata>"
|
153
153
|
----
|
154
154
|
|
155
|
+
=== Typed links
|
156
|
+
|
157
|
+
Each CEN document has `src` type link.
|
158
|
+
|
159
|
+
[source,ruby]
|
160
|
+
----
|
161
|
+
item.link
|
162
|
+
=> [#<RelatonBib::TypedUri:0x00007f865cf9a328 @content=#<Addressable::URI:0xbea0 URI:https://standards.cencenelec.eu/dyn/www/f?p=CEN:110:0::::FSP_PROJECT,FSP_ORG_ID:68120,6137&cs=19764D9131733FD9E70037E7A6E6740B2>, @type="src">]
|
163
|
+
----
|
164
|
+
|
155
165
|
=== Get code, and year
|
156
166
|
[source,ruby]
|
157
167
|
----
|
@@ -14,7 +14,7 @@ module RelatonCen
|
|
14
14
|
# @param text [String]
|
15
15
|
# @return [RelatonCen::HitCollection]
|
16
16
|
def search(text, year = nil)
|
17
|
-
/^
|
17
|
+
/^C?EN\s(?<code>.+)/ =~ text
|
18
18
|
HitCollection.new code, year
|
19
19
|
rescue Mechanize::ResponseCodeError => e
|
20
20
|
raise RelatonBib::RequestError, e.message
|
@@ -58,7 +58,7 @@ module RelatonCen
|
|
58
58
|
# @param code [String]
|
59
59
|
# @return [RelatonCen::HitCollection]
|
60
60
|
def search_filter(code) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
61
|
-
%r{^
|
61
|
+
%r{^C?EN\s(?<code1>[^-:]+)(?:-(?<part1>\d+))?} =~ code
|
62
62
|
warn "[relaton-cen] (\"#{code}\") fetching..."
|
63
63
|
result = search(code)
|
64
64
|
result.select do |i|
|
@@ -2,10 +2,10 @@ require "relaton/processor"
|
|
2
2
|
|
3
3
|
module RelatonCen
|
4
4
|
class Processor < Relaton::Processor
|
5
|
-
def initialize
|
5
|
+
def initialize # rubocop:disable Lint/MissingSuper
|
6
6
|
@short = :relaton_cen
|
7
7
|
@prefix = "CEN"
|
8
|
-
@defaultprefix = %r{^
|
8
|
+
@defaultprefix = %r{^C?EN\s}
|
9
9
|
@idtype = "CEN"
|
10
10
|
end
|
11
11
|
|
data/lib/relaton_cen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-cen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.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: 2021-
|
11
|
+
date: 2021-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|