relaton-iec 1.11.0 → 1.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -3
- data/lib/relaton_iec/hit_collection.rb +1 -1
- data/lib/relaton_iec/iec_bibliography.rb +11 -12
- data/lib/relaton_iec/version.rb +1 -1
- data/relaton_iec.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26f4ed095f846982958565c16856f12c681fb06f6b4dcdf6d9d51da5e122fda3
|
4
|
+
data.tar.gz: 9d6d6de7f5ecc68aa0133460e80070e79cf4d58e167ac546dbeb2eb3e18ba537
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9110c1ee9b89a7a31048cb3f57814f16ba0835135849db067e6f4970a63f5f9a3af18507d6a5b040fa4e4a239873264b34e85673abb0b034afc45ca78bbe9fe
|
7
|
+
data.tar.gz: c2384461bcfd0715d241e0e5cd91f1631158293a57e488acea984f1fbdb3033997fcface2580d04c07212bd1d6e548edfe332da369b21e41a132673848648d5e
|
data/Gemfile
CHANGED
@@ -31,7 +31,7 @@ module RelatonIec
|
|
31
31
|
all_parts_item = bibitem.to_all_parts
|
32
32
|
parts.reject { |h| h.hit[:code] == hit.hit[:code] }.each do |hi|
|
33
33
|
isobib = RelatonIec::IecBibliographicItem.new(
|
34
|
-
formattedref: RelatonBib::FormattedRef.new(content: hi.hit[:code])
|
34
|
+
formattedref: RelatonBib::FormattedRef.new(content: hi.hit[:code]),
|
35
35
|
)
|
36
36
|
all_parts_item.relation << RelatonBib::DocumentRelation.new(type: "partOf", bibitem: isobib)
|
37
37
|
end
|
@@ -21,7 +21,7 @@ module RelatonIec
|
|
21
21
|
# @param part [String, nil] search for packaged stndard if not nil
|
22
22
|
# @return [RelatonIec::HitCollection]
|
23
23
|
def search(text, year = nil, part = nil)
|
24
|
-
HitCollection.new text
|
24
|
+
HitCollection.new text&.sub(/(^\w+)\//, '\1 '), year&.strip, part
|
25
25
|
rescue SocketError, OpenURI::HTTPError, OpenSSL::SSL::SSLError
|
26
26
|
raise RelatonBib::RequestError, "Could not access http://www.iec.ch"
|
27
27
|
end
|
@@ -32,8 +32,8 @@ module RelatonIec
|
|
32
32
|
# reference is required
|
33
33
|
# @return [String] Relaton XML serialisation of reference
|
34
34
|
def get(code, year = nil, opts = {}) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
35
|
-
opts[:all_parts] ||= code.match?
|
36
|
-
ref = code.sub
|
35
|
+
opts[:all_parts] ||= code.match?(/\s\(all parts\)/)
|
36
|
+
ref = code.sub(/\s\(all parts\)/, "")
|
37
37
|
if year.nil?
|
38
38
|
/^(?<code1>[^:]+):(?<year1>[^:]+)/ =~ ref
|
39
39
|
unless code1.nil?
|
@@ -91,10 +91,10 @@ module RelatonIec
|
|
91
91
|
# @return [RelatonIec::HitCollection]
|
92
92
|
def search_filter(ref, year) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
93
93
|
%r{
|
94
|
-
^(?<code>\S+[^\d]*\s\d+(
|
95
|
-
(
|
96
|
-
(?<bundle>\+[^\s
|
97
|
-
(
|
94
|
+
^(?<code>\S+[^\d]*\s\d+(?:-\w+)*)
|
95
|
+
(?::(?<year1>\d{4}))?
|
96
|
+
(?<bundle>\+[^\s/]+)?
|
97
|
+
(?:/(?<corr>AMD\s\d+))?
|
98
98
|
}x =~ ref.upcase
|
99
99
|
year ||= year1
|
100
100
|
corr&.sub! " ", ""
|
@@ -106,13 +106,12 @@ module RelatonIec
|
|
106
106
|
end
|
107
107
|
result = search code if result.empty?
|
108
108
|
code = result.text.dup
|
109
|
-
code&.sub!
|
109
|
+
code&.sub!(/((?:-\w+)+)/, "")
|
110
110
|
result.select do |i|
|
111
111
|
%r{
|
112
|
-
^(?<code2>\S+[^\d]*\s\d+)(
|
113
|
-
(
|
114
|
-
(?<
|
115
|
-
(\/(?<corr2>AMD\d+))?
|
112
|
+
^(?<code2>\S+[^\d]*\s\d+)(?:-\w+)*(?::\d{4})?
|
113
|
+
(?<bundle2>\+[^\s/]+)?
|
114
|
+
(?:/(?<corr2>AMD\d+))?
|
116
115
|
}x =~ i.hit[:code]
|
117
116
|
code == code2 && bundle == bundle2 && corr == corr2
|
118
117
|
end
|
data/lib/relaton_iec/version.rb
CHANGED
data/relaton_iec.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
27
27
|
spec.add_development_dependency "pry-byebug"
|
28
|
-
spec.add_development_dependency "rake", "~>
|
28
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
29
29
|
spec.add_development_dependency "rspec", "~> 3.0"
|
30
30
|
spec.add_development_dependency "ruby-jing"
|
31
31
|
spec.add_development_dependency "simplecov"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-iec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '13.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '13.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|