relaton-bib 1.8.1 → 1.8.2
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 +4 -4
- data/lib/relaton_bib/localized_string.rb +4 -6
- data/lib/relaton_bib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ff7b6717bb451df99444b58ca6caa1e233508925c6a2d9004c9eab3507beacb
|
4
|
+
data.tar.gz: 38c1a9fefa8fea1982ad942de7451f5c72abe2e793f7023c380bae55b6008a39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c8515678e6d72e526dcda4d0a49ba6ceb95aae3cb5d7b1ccabda2f67502217f2faf2adab888af887423add502fd84ec7ed39fdd9fc25e2fb1b4d4848b9abba3
|
7
|
+
data.tar.gz: b7c41cb0c51b5853a6f1d6b97b9c0dd1152896913d240bbdc3c76ce847fa4b0a75ddd29e62261ec61257757642dba40b842300dfe85b2e90fe6e619505be308d
|
@@ -18,12 +18,8 @@ module RelatonBib
|
|
18
18
|
# @param language [String] language code Iso639
|
19
19
|
# @param script [String] script code Iso15924
|
20
20
|
def initialize(content, language = nil, script = nil) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
21
|
-
if content.is_a?
|
22
|
-
|
23
|
-
end
|
24
|
-
unless content.is_a?(String) || inv&.none? && content.any?
|
25
|
-
klass = content.is_a?(Array) ? inv.first.class : content.class
|
26
|
-
raise ArgumentError, "invalid LocalizedString content type: #{klass}"
|
21
|
+
if content.is_a?(Array) && content.none?
|
22
|
+
raise ArgumentError, "LocalizedString content is empty"
|
27
23
|
end
|
28
24
|
@language = language.is_a?(String) ? [language] : language
|
29
25
|
@script = script.is_a?(String) ? [script] : script
|
@@ -31,6 +27,8 @@ module RelatonBib
|
|
31
27
|
content.map do |c|
|
32
28
|
if c.is_a?(Hash)
|
33
29
|
LocalizedString.new c[:content], c[:language], c[:script]
|
30
|
+
elsif c.is_a?(String)
|
31
|
+
LocalizedString.new c
|
34
32
|
else c
|
35
33
|
end
|
36
34
|
end
|
data/lib/relaton_bib/version.rb
CHANGED
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.8.
|
4
|
+
version: 1.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|