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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29cf9f52b83e9d40f821dbc17e7d9046a5b75daa74785eb42f86c34beb901326
4
- data.tar.gz: 826a7c557607895c288cc7fd1c533eff3e50305e7f5f53d4084ba5bdfbe94f0d
3
+ metadata.gz: 26f4ed095f846982958565c16856f12c681fb06f6b4dcdf6d9d51da5e122fda3
4
+ data.tar.gz: 9d6d6de7f5ecc68aa0133460e80070e79cf4d58e167ac546dbeb2eb3e18ba537
5
5
  SHA512:
6
- metadata.gz: a1cd3fc598455e728ebcecff28c24292da8d88540c9c482f1b0f1bcbc481ee31b82c3db4b0510cbb431c524ac8d6a20ecf85e7dbcc40afa1816836e2fa64f949
7
- data.tar.gz: ff4f56193ef6924948725a81bfc11319f059a4f3e73f8e1838c0a4ee43c7fe31ed204b085edf358c4d42f0643305a1417dbd7a124e2e033ac6586032af7b4b8b
6
+ metadata.gz: f9110c1ee9b89a7a31048cb3f57814f16ba0835135849db067e6f4970a63f5f9a3af18507d6a5b040fa4e4a239873264b34e85673abb0b034afc45ca78bbe9fe
7
+ data.tar.gz: c2384461bcfd0715d241e0e5cd91f1631158293a57e488acea984f1fbdb3033997fcface2580d04c07212bd1d6e548edfe332da369b21e41a132673848648d5e
data/Gemfile CHANGED
@@ -1,6 +1,3 @@
1
- Encoding.default_external = Encoding::UTF_8
2
- Encoding.default_internal = Encoding::UTF_8
3
-
4
1
  source "https://rubygems.org"
5
2
 
6
3
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
@@ -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.sub(/(^\w+)\//, '\1 '), year&.strip, part
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? /\s\(all parts\)/
36
- ref = code.sub /\s\(all parts\)/, ""
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+((?:-\w+)+)?)
95
- (:(?<year1>\d{4}))?
96
- (?<bundle>\+[^\s\/]+)?
97
- (\/(?<corr>AMD\s\d+))?
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! /((?:-\w+)+)/, ""
109
+ code&.sub!(/((?:-\w+)+)/, "")
110
110
  result.select do |i|
111
111
  %r{
112
- ^(?<code2>\S+[^\d]*\s\d+)((?:-\w+)+)?
113
- (:\d{4})?
114
- (?<bundle2>\+[^\s\/]+)?
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
@@ -1,3 +1,3 @@
1
1
  module RelatonIec
2
- VERSION = "1.11.0".freeze
2
+ VERSION = "1.11.1".freeze
3
3
  end
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", "~> 10.0"
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.0
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-10 00:00:00.000000000 Z
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: '10.0'
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: '10.0'
54
+ version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement