relaton-iec 0.9.0 → 0.10.0

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: f5bd7f61db81db9185f68ef6a40b7988e53363cb31d4b3e98210da625f1f408d
4
- data.tar.gz: 39f8464d2dad234528b42532a765627af36f1436065b53889c26a3765eb0603c
3
+ metadata.gz: 1b0d53d02ba697e7635c9373d8e9896b04a7803b1b292ae9a7fb4e6ecbf73806
4
+ data.tar.gz: a5dfb8cbde724c76d067b5685ccbca0bd4799eaa03fae6b57558f105cd910f65
5
5
  SHA512:
6
- metadata.gz: '0485d74b4bbbcea6244ae74cfd3b1d5901ea5a1b2695a7fa3dfae3516beb0dd7d73f9d7b923651ed2f9d3aa953632244d08541558a7cf0275e28ca8654fd9753'
7
- data.tar.gz: ff9fd992c3952c7f0544434a76460a3bbd3efbc98eb8c427c3ba188f2009e18d3dbfc673dea79d1009f5921a7c214ca9a958bae98c1ddb9252e3cd8c0cd2cd5f
6
+ metadata.gz: 41f34a9491e9da321863bbfaa19173bf334eda9233702f1805f9e396c120a70ac574a75ad0e1b4e8126e3752990c69ac96f41236538f6bcc22c3b18497df0c02
7
+ data.tar.gz: 383365645ac5b6d2d0bcd3ba3f8a55493515d39a368c5645c4ede49273f4b970477db456885fa24e13081598c61f500974012c41f3e9739d37f92295188f5a27
@@ -43,8 +43,8 @@ module RelatonIec
43
43
  ret = iecbib_get1(code, year, opts)
44
44
  return nil if ret.nil?
45
45
 
46
- ret.to_most_recent_reference unless year || opts[:keep_year]
47
- ret.to_all_parts if opts[:all_parts]
46
+ ret = ret.to_most_recent_reference unless year || opts[:keep_year]
47
+ ret = ret.to_all_parts if opts[:all_parts]
48
48
  ret
49
49
  end
50
50
 
@@ -52,15 +52,15 @@ module RelatonIec
52
52
 
53
53
  def fetch_ref_err(code, year, missed_years)
54
54
  id = year ? "#{code}:#{year}" : code
55
- warn "WARNING: no match found online for #{id}. "\
55
+ warn "[relaton-iec] WARNING: no match found online for #{id}. "\
56
56
  "The code must be exactly like it is on the standards website."
57
- warn "(There was no match for #{year}, though there were matches "\
57
+ warn "[relaton-iec] (There was no match for #{year}, though there were matches "\
58
58
  "found for #{missed_years.join(', ')}.)" unless missed_years.empty?
59
59
  if /\d-\d/ =~ code
60
- warn "The provided document part may not exist, or the document "\
60
+ warn "[relaton-iec] The provided document part may not exist, or the document "\
61
61
  "may no longer be published in parts."
62
62
  else
63
- warn "If you wanted to cite all document parts for the reference, "\
63
+ warn "[relaton-iec] If you wanted to cite all document parts for the reference, "\
64
64
  "use \"#{code} (all parts)\".\nIf the document is not a standard, "\
65
65
  "use its document type abbreviation (TS, TR, PAS, Guide)."
66
66
  end
@@ -78,7 +78,7 @@ module RelatonIec
78
78
  def isobib_search_filter(code)
79
79
  docidrx = %r{^(ISO|IEC)[^0-9]*\s[0-9-]+}
80
80
  corrigrx = %r{^(ISO|IEC)[^0-9]*\s[0-9-]+:[0-9]+/}
81
- warn "fetching #{code}..."
81
+ warn "[relaton-iec] (\"#{code}\") fetching..."
82
82
  result = search(code)
83
83
  result.select do |i|
84
84
  i.hit[:code] &&
@@ -147,9 +147,12 @@ module RelatonIec
147
147
 
148
148
  result = isobib_search_filter(code) || return
149
149
  ret = isobib_results_filter(result, year)
150
- return ret[:ret] if ret[:ret]
151
-
152
- fetch_ref_err(code, year, ret[:years])
150
+ if ret[:ret]
151
+ warn "[relaton-iec] (\"#{code}\") found #{ret[:ret].docidentifier.first.id}"
152
+ ret[:ret]
153
+ else
154
+ fetch_ref_err(code, year, ret[:years])
155
+ end
153
156
  end
154
157
  end
155
158
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonIec
2
- VERSION = "0.9.0".freeze
2
+ VERSION = "0.10.0".freeze
3
3
  end
data/relaton_iec.gemspec CHANGED
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency "webmock"
35
35
 
36
36
  spec.add_dependency "addressable"
37
- spec.add_dependency "relaton-iso-bib", "~> 0.8.0"
37
+ spec.add_dependency "relaton-iso-bib", "~> 0.9.0"
38
38
  end
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: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-25 00:00:00.000000000 Z
11
+ date: 2020-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 0.8.0
159
+ version: 0.9.0
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 0.8.0
166
+ version: 0.9.0
167
167
  description: 'RelatonIec: retrieve IEC Standards for bibliographic use using the IsoBibliographicItem
168
168
  model'
169
169
  email: