relaton-bib 1.20.5 → 1.20.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7b8865d38da2d8dc42dd43d568c9e3a47b8f44d02cb7167ea9549b5da512a97
4
- data.tar.gz: 67d76a17b863cd5f30cc853bc7a04bfb8c982cc1c56753bf4df615e58acabb48
3
+ metadata.gz: 7bc5e6c64aa25f0c7245308561141432ff9d68d856f065c53db7661f38fd2e90
4
+ data.tar.gz: 514edda2458f4a4478b84b86bd897c24b2f7fe79e9e05ce31a37874921f14d32
5
5
  SHA512:
6
- metadata.gz: 9297ecc429a49152ec493ff9288d6f97d778cdfda002f025c5a9acb81b74e15cf40e17acabe0fec9721bef5ad32927c9c38255262c64bff3d966893a6f7fb322
7
- data.tar.gz: 4b97cde41ba3aec85543f3e78a159948c4328a63657f1a4c36b196bc03ff01aa4e28d8690b55b23eb5a784cc7c8a89429da8e8ed47cdaa8d539c56e197467e4f
6
+ metadata.gz: a9e626d6446310ca6e2e7fb1f97f0454d725feb68ec798a2caa7785be1442892ae88832b048f76892724c92fe915a4c7f6e07b573cd0424c92dd77ad78dc302d
7
+ data.tar.gz: 9d13c7ae5c4037d5e30f5abe61fc3c2598512b4310cd6b6dcb07afc5346934c8b039e13b65cf1d17e2f7da137308b741aee28352457e2113a878d1a35f884d1e
@@ -233,7 +233,7 @@ module RelatonBib
233
233
  a.is_a?(Hash) ? FormattedString.new(**a) : a
234
234
  end
235
235
 
236
- @copyright = args.fetch(:copyright, []).map do |c|
236
+ @copyright = (args[:copyright] || []).map do |c|
237
237
  c.is_a?(Hash) ? CopyrightAssociation.new(**c) : c
238
238
  end
239
239
 
@@ -248,31 +248,31 @@ module RelatonBib
248
248
  Edition.new(content: args[:edition].to_s)
249
249
  when Edition then args[:edition]
250
250
  end
251
- @version = args.fetch :version, []
252
- @biblionote = args.fetch :biblionote, BiblioNoteCollection.new([])
253
- @language = args.fetch :language, []
254
- @script = args.fetch :script, []
251
+ @version = args[:version] || []
252
+ @biblionote = args[:biblionote] || BiblioNoteCollection.new([])
253
+ @language = args[:language] || []
254
+ @script = args[:script] || []
255
255
  @status = args[:docstatus]
256
256
  @relation = DocRelationCollection.new(args[:relation] || [])
257
- @link = args.fetch(:link, []).map do |s|
257
+ @link = (args[:link] || []).map do |s|
258
258
  case s
259
259
  when Hash then TypedUri.new(**s)
260
260
  when String then TypedUri.new(content: s)
261
261
  else s
262
262
  end
263
263
  end
264
- @series = args.fetch :series, []
264
+ @series = args[:series] || []
265
265
  @medium = args[:medium]
266
- @place = args.fetch(:place, []).map do |pl|
266
+ @place = (args[:place] || []).map do |pl|
267
267
  pl.is_a?(String) ? Place.new(name: pl) : pl
268
268
  end
269
269
  @extent = args[:extent] || []
270
270
  @size = args[:size]
271
- @accesslocation = args.fetch :accesslocation, []
272
- @classification = args.fetch :classification, []
271
+ @accesslocation = args[:accesslocation] || []
272
+ @classification = args[:classification] || []
273
273
  @validity = args[:validity]
274
274
  # we should pass the fetched arg from scrappers
275
- @fetched = args.fetch :fetched, nil
275
+ @fetched = args[:fetched]
276
276
  @keyword = (args[:keyword] || []).map do |kw|
277
277
  case kw
278
278
  when Hash then LocalizedString.new(kw[:content], kw[:language], kw[:script])
@@ -280,11 +280,11 @@ module RelatonBib
280
280
  else kw
281
281
  end
282
282
  end
283
- @license = args.fetch :license, []
283
+ @license = args[:license] || []
284
284
  @doctype = args[:doctype]
285
285
  @subdoctype = args[:subdoctype]
286
286
  @editorialgroup = args[:editorialgroup]
287
- @ics = args.fetch :ics, []
287
+ @ics = args[:ics] || []
288
288
  @structuredidentifier = args[:structuredidentifier]
289
289
  end
290
290
  # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
@@ -26,7 +26,7 @@ module RelatonBib
26
26
  end
27
27
 
28
28
  @type = args[:type]
29
- @description = args.fetch(:description, []).map do |d|
29
+ @description = (args[:description] || []).map do |d|
30
30
  FormattedString.new content: d, format: nil
31
31
  end
32
32
  end
@@ -23,23 +23,25 @@ module RelatonBib
23
23
  # @param prefix [Array<RelatonBib::LocalizedString>] array of prefixes
24
24
  # @param completename [RelatonBib::LocalizedString, nil] completename or surname should be present
25
25
  #
26
- def initialize(**args) # rubocop:disable Metrics/AbcSize
26
+ def initialize(**args) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity
27
27
  unless args[:surname] || args[:completename]
28
28
  raise ArgumentError, "Should be given :surname or :completename"
29
29
  end
30
30
 
31
31
  @surname = args[:surname]
32
32
  @abbreviation = args[:abbreviation]
33
- @forename = args.fetch :forename, []
33
+ @forename = args[:forename] || []
34
34
  @initials = args[:initials].is_a?(String) ? LocalizedString.new(args[:initials]) : args[:initials]
35
- @addition = args.fetch :addition, []
36
- @prefix = args.fetch :prefix, []
35
+ @addition = args[:addition] || []
36
+ @prefix = args[:prefix] || []
37
37
  @completename = args[:completename]
38
38
  end
39
39
 
40
- def ==(other)
41
- surname == other.surname && abbreviation == other.abbreviation && completename == other.completename &&
42
- forename == other.forename && initials == other.initials && addition == other.addition && prefix == other.prefix
40
+ def ==(other) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity
41
+ surname == other.surname && abbreviation == other.abbreviation &&
42
+ completename == other.completename && forename == other.forename &&
43
+ initials == other.initials && addition == other.addition &&
44
+ prefix == other.prefix
43
45
  end
44
46
 
45
47
  # @param opts [Hash]
@@ -75,10 +75,10 @@ module RelatonBib
75
75
  # @param identifier [Array<RelatonBib::OrgIdentifier>]
76
76
  # @param contact [Array<RelatonBib::Address, RelatonBib::Contact>]
77
77
  # @param logo [RelatonBib::Image, nil]
78
- def initialize(**args) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
78
+ def initialize(**args) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
79
79
  raise ArgumentError, "missing keyword: name" unless args[:name]
80
80
 
81
- super(url: args[:url], contact: args.fetch(:contact, []))
81
+ super(url: args[:url], contact: args[:contact] || [])
82
82
 
83
83
  @name = if args[:name].is_a?(Array)
84
84
  args[:name].map { |n| localized_string(n) }
@@ -90,7 +90,7 @@ module RelatonBib
90
90
  @subdivision = (args[:subdivision] || []).map do |sd|
91
91
  localized_string sd
92
92
  end
93
- @identifier = args.fetch(:identifier, [])
93
+ @identifier = args[:identifier] || []
94
94
  @logo = args[:logo]
95
95
  end
96
96
 
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "1.20.5".freeze
2
+ VERSION = "1.20.6".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-bib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.5
4
+ version: 1.20.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-02-27 00:00:00.000000000 Z
11
+ date: 2025-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  - !ruby/object:Gem::Version
193
193
  version: '0'
194
194
  requirements: []
195
- rubygems_version: 3.3.27
195
+ rubygems_version: 3.5.22
196
196
  signing_key:
197
197
  specification_version: 4
198
198
  summary: 'RelatonBib: Ruby XMLDOC impementation.'