relaton-bib 1.14.2 → 1.14.3

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: 0dc6209c1ca723507ee58364eab5781bfd0735e7e48ca41caba930df28efafba
4
- data.tar.gz: 5b0a27ecae7862a71fffcd2dd6e07bbd80ead8ea5d8c28bc435e55df62d3a34b
3
+ metadata.gz: d2e95577c2faca4138cb7c099afafcc635f16284da3e146d45b32e3b8ad709a4
4
+ data.tar.gz: aa23275f02e5972cd67fa71804448fefda53c70d9ec8545eca3775974292e8d2
5
5
  SHA512:
6
- metadata.gz: f5324c05eab02136412a48c51296cdd35e2a17e29ec2a8894a557863d9e75c1eda450214dea53cfd94445a8d1ca40c7e5af6d7e3b741b3f0f21d37df7f9a247d
7
- data.tar.gz: 9c101ac931e82526307cc39abf670bd57633cbb6d9293c6729acc16cd22231cb887485ab5e7a33bafdddab06eed8956a5baeb7a745a9c90e8df1ce43df56bd11
6
+ metadata.gz: 5733045f85f88d7b2339ead874e362d37dea6628a6263bb5a9339359fce67fe334b42612c4ad3346844dbfe80e0b043cafded930c3113e8bd7a6d2ce012a6d0b
7
+ data.tar.gz: f89db90f0bfb097670d2d1f6342359c40a7a94cb5bb1dba0532ad52c50441b96e2fc9163ad0fee7afddee51db9be67b542fc88f1d262dad9b9be6337e410d5cd
@@ -27,14 +27,14 @@ module RelatonBib
27
27
  end
28
28
 
29
29
  class BiblioNote < FormattedString
30
- # @return [String, NilClass]
30
+ # @return [String, nil]
31
31
  attr_reader :type
32
32
 
33
33
  # @param content [String]
34
- # @param type [String, NilClass]
35
- # @param language [String, NilClass] language code Iso639
36
- # @param script [String, NilClass] script code Iso15924
37
- # @param format [String, NilClass] the content format
34
+ # @param type [String, nil]
35
+ # @param language [String, nil] language code Iso639
36
+ # @param script [String, nil] script code Iso15924
37
+ # @param format [String, nil] the content format
38
38
  def initialize(content:, type: nil, language: nil, script: nil, format: nil)
39
39
  @type = type
40
40
  super content: content, language: language, script: script, format: format
@@ -149,7 +149,7 @@ module RelatonBib
149
149
  # @param version [Array<RelatonBib::BibliographicItem::Version>]
150
150
  # @param biblionote [RelatonBib::BiblioNoteCollection]
151
151
  # @param series [Array<RelatonBib::Series>]
152
- # @param medium [RelatonBib::Medium, NilClas]
152
+ # @param medium [RelatonBib::Medium, nil]
153
153
  # @param place [Array<String, RelatonBib::Place>]
154
154
  # @param extent [Array<Relaton::Locality, RelatonBib::LocalityStack>]
155
155
  # @param accesslocation [Array<String>]
@@ -44,7 +44,7 @@ module RelatonBib
44
44
  end
45
45
 
46
46
  # @param bibtex [BibTeX::Entry]
47
- # @return [String, NilClass]
47
+ # @return [String, nil]
48
48
  def fetch_fetched(bibtex)
49
49
  Date.parse(bibtex.timestamp.to_s) if bibtex["timestamp"]
50
50
  end
@@ -225,7 +225,7 @@ module RelatonBib
225
225
  end
226
226
 
227
227
  # @param bibtex [BibTeX::Entry]
228
- # @return [RelatonBib::Classification, NilClass]
228
+ # @return [RelatonBib::Classification, nil]
229
229
  def fetch_classification(bibtex)
230
230
  cls = []
231
231
  cls << Classification.new(type: "type", value: bibtex["type"].to_s) if bibtex["type"]
@@ -1,12 +1,12 @@
1
1
  module RelatonBib
2
2
  class Classification
3
- # @return [String, NilClass]
3
+ # @return [String, nil]
4
4
  attr_reader :type
5
5
 
6
6
  # @return [String]
7
7
  attr_reader :value
8
8
 
9
- # @param type [String, NilClass]
9
+ # @param type [String, nil]
10
10
  # @param value [String]
11
11
  def initialize(type: nil, value:)
12
12
  @type = type
@@ -120,7 +120,7 @@ module RelatonBib
120
120
  class Affiliation
121
121
  include RelatonBib
122
122
 
123
- # @return [RelatonBib::LocalizedString, NilClass]
123
+ # @return [RelatonBib::LocalizedString, nil]
124
124
  attr_reader :name
125
125
 
126
126
  # @return [Array<RelatonBib::FormattedString>]
@@ -130,7 +130,7 @@ module RelatonBib
130
130
  attr_reader :organization
131
131
 
132
132
  # @param organization [RelatonBib::Organization]
133
- # @param name [RelatonBib::LocalizedString, NilClass]
133
+ # @param name [RelatonBib::LocalizedString, nil]
134
134
  # @param description [Array<RelatonBib::FormattedString>]
135
135
  def initialize(organization:, name: nil, description: [])
136
136
  @name = name
@@ -186,7 +186,7 @@ module RelatonBib
186
186
  # @return [Array<RelatonBib::Address, RelatonBib::Contact>]
187
187
  attr_reader :contact
188
188
 
189
- # @param url [String, NilClass]
189
+ # @param url [String, nil]
190
190
  # @param contact [Array<RelatonBib::Address, RelatonBib::Contact>]
191
191
  def initialize(url: nil, contact: [])
192
192
  @uri = URI url if url
@@ -12,14 +12,14 @@ module RelatonBib
12
12
  draftOf hasDraft editionOf hasEdition updates updatedBy derivedFrom
13
13
  derives describes describedBy catalogues cataloguedBy hasSuccessor
14
14
  successorOf adaptedFrom hasAdaptation adoptedFrom adoptedAs reviewOf
15
- hasReview commentaryOf hasCommentary related complements complementOf
15
+ hasReview commentaryOf hasCommentary related hasComplement complementOf
16
16
  obsoletes obsoletedBy cites isCitedIn
17
17
  ].freeze
18
18
 
19
19
  # @return [String]
20
20
  attr_accessor :type
21
21
 
22
- # @return [RelatonBib::FormattedString, NilClass]
22
+ # @return [RelatonBib::FormattedString, nil]
23
23
  attr_reader :description
24
24
 
25
25
  # @return [String]
@@ -36,7 +36,7 @@ module RelatonBib
36
36
  attr_reader :source_locality
37
37
 
38
38
  # @param type [String]
39
- # @param description [RelatonBib::FormattedString, NilClass]
39
+ # @param description [RelatonBib::FormattedString, nil]
40
40
  # @param bibitem [RelatonBib::BibliographicItem,
41
41
  # RelatonIso::IsoBibliographicItem]
42
42
  # @param locality [Array<RelatonBib::Locality, RelatonBib::LocalityStack>]
@@ -13,8 +13,8 @@ module RelatonBib
13
13
  attr_reader :format
14
14
 
15
15
  # @param content [String, Array<RelatonBib::LocalizedString>]
16
- # @param language [String, NilClass] language code Iso639
17
- # @param script [String, NilClass] script code Iso15924
16
+ # @param language [String, nil] language code Iso639
17
+ # @param script [String, nil] script code Iso15924
18
18
  # @param format [String] the content type
19
19
  def initialize(content:, language: nil, script: nil, format: "text/plain")
20
20
  # if format && !FORMATS.include?(format)
@@ -89,7 +89,8 @@ module RelatonBib
89
89
  def escp(str)
90
90
  return unless str
91
91
 
92
- HTMLEntities.new.encode str.dup.force_encoding("UTF-8")
92
+ coder = HTMLEntities.new
93
+ coder.encode coder.decode(str.dup.force_encoding("UTF-8"))
93
94
  end
94
95
 
95
96
  # @return [Hash, Array<Hash>]
@@ -76,7 +76,7 @@ module RelatonBib
76
76
  # @param affiliation [Array<RelatonBib::Affiliation>]
77
77
  # @param contact [Array<RelatonBib::Address, RelatonBib::Contact>]
78
78
  # @param identifier [Array<RelatonBib::PersonIdentifier>]
79
- # @param url [String, NilClass]
79
+ # @param url [String, nil]
80
80
  def initialize(name:, affiliation: [], contact: [], identifier: [],
81
81
  url: nil)
82
82
  super(contact: contact, url: url)
@@ -64,7 +64,7 @@ module RelatonBib
64
64
  # @return [Array<String>]
65
65
  attr_reader :agency
66
66
 
67
- # @return [String, NilClass]
67
+ # @return [String, nil]
68
68
  attr_reader :type, :klass, :partnumber, :edition, :version, :supplementtype,
69
69
  :supplementnumber, :language, :year
70
70
 
@@ -2,18 +2,18 @@ module RelatonBib
2
2
  class Validity
3
3
  FORMAT = "%Y-%m-%d %H:%M".freeze
4
4
 
5
- # @return [Time, NilClass]
5
+ # @return [Time, nil]
6
6
  attr_reader :begins
7
7
 
8
- # @return [Time, NilClass]
8
+ # @return [Time, nil]
9
9
  attr_reader :ends
10
10
 
11
- # @return [Time, NilClass]
11
+ # @return [Time, nil]
12
12
  attr_reader :revision
13
13
 
14
- # @param begins [Time, NilClass]
15
- # @param ends [Time, NilClass]
16
- # @param revision [Time, NilClass]
14
+ # @param begins [Time, nil]
15
+ # @param ends [Time, nil]
16
+ # @param revision [Time, nil]
17
17
  def initialize(begins: nil, ends: nil, revision: nil)
18
18
  @begins = begins
19
19
  @ends = ends
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "1.14.2".freeze
2
+ VERSION = "1.14.3".freeze
3
3
  end
@@ -566,7 +566,7 @@ module RelatonBib
566
566
  end
567
567
 
568
568
  # @param rel [Nokogiri::XML::Element]
569
- # @return [RelatonBib::FormattedString, NilClass]
569
+ # @return [RelatonBib::FormattedString, nil]
570
570
  def relation_description(rel)
571
571
  d = rel.at "./description"
572
572
  return unless d
@@ -635,7 +635,7 @@ module RelatonBib
635
635
  end
636
636
 
637
637
  # @param item [Nokogiri::XML::Element]
638
- # @return [RelatonBib::FormattedRef, NilClass]
638
+ # @return [RelatonBib::FormattedRef, nil]
639
639
  def fref(item)
640
640
  ident = item&.at("./formattedref")
641
641
  return unless ident
data/lib/relaton_bib.rb CHANGED
@@ -53,7 +53,7 @@ module RelatonBib
53
53
  str ? date.strftime(outformat || format) : date
54
54
  end
55
55
 
56
- # @param arr [NilClass, Array, #is_a?]
56
+ # @param arr [nil, Array, #is_a?]
57
57
  # @return [Array]
58
58
  def array(arr)
59
59
  return [] unless arr
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.14.2
4
+ version: 1.14.3
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-12-16 00:00:00.000000000 Z
11
+ date: 2022-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug