relaton-bib 1.6.1 → 1.6.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/biblio_note.rb +4 -3
- data/lib/relaton_bib/contribution_info.rb +5 -2
- data/lib/relaton_bib/formatted_string.rb +2 -1
- data/lib/relaton_bib/localized_string.rb +5 -1
- data/lib/relaton_bib/typed_title_string.rb +1 -1
- 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: a7f6ef2eec280ac48d171fa25bc4c88d2df63692b5736823868f1751af971f3d
|
4
|
+
data.tar.gz: 78e4a52cb0e1d1ce66404af62d2e7f79f27634acbf84094a19e0f593affbdb5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 226ead0669d2f060d24b541c8e0eab0d9357b0a697b96572aed3b68b539b97d9f2662f76669a7e0167eedd3fcbc1bdf8ff65e3d3135facdb1531619749095cba
|
7
|
+
data.tar.gz: 2a333a1a1ba8aa6683a6abc6f97d521c3be510cbaa7455483266e62523764cf6e04de0b909a0109c21c0c1e5aab5fc224140f97b0f2b60c66d55535e5f434c12
|
@@ -62,9 +62,10 @@ module RelatonBib
|
|
62
62
|
# @return [String]
|
63
63
|
def to_asciibib(prefix = "", count = 1)
|
64
64
|
pref = prefix.empty? ? prefix : prefix + "."
|
65
|
-
|
66
|
-
out
|
67
|
-
out +=
|
65
|
+
has_attrs = !(type.nil? || type.empty?)
|
66
|
+
out = count > 1 && has_attrs ? "#{pref}biblionote::\n" : ""
|
67
|
+
out += "#{pref}biblionote.type:: #{type}\n" if type
|
68
|
+
out += super "#{pref}biblionote", 1, has_attrs
|
68
69
|
out
|
69
70
|
end
|
70
71
|
end
|
@@ -81,8 +81,11 @@ module RelatonBib
|
|
81
81
|
attr_reader :entity
|
82
82
|
|
83
83
|
# @param entity [RelatonBib::Person, RelatonBib::Organization]
|
84
|
-
# @param role [Array<
|
85
|
-
def initialize(entity:, role: [
|
84
|
+
# @param role [Array<Hash>]
|
85
|
+
def initialize(entity:, role: [])
|
86
|
+
if role.empty?
|
87
|
+
role << { type: entity.is_a?(Person) ? "author" : "publisher" }
|
88
|
+
end
|
86
89
|
@entity = entity
|
87
90
|
@role = role.map { |r| ContributorRole.new(**r) }
|
88
91
|
end
|
@@ -44,7 +44,8 @@ module RelatonBib
|
|
44
44
|
# @param prefix [String]
|
45
45
|
# @param count [Integer] number of elements
|
46
46
|
# @return [String]
|
47
|
-
def to_asciibib(prefix = "", count = 1)
|
47
|
+
def to_asciibib(prefix = "", count = 1, has_attrs = false)
|
48
|
+
has_attrs ||= !(format.nil? || format.empty?)
|
48
49
|
pref = prefix.empty? ? prefix : prefix + "."
|
49
50
|
# out = count > 1 ? "#{prefix}::\n" : ""
|
50
51
|
out = super
|
@@ -77,9 +77,13 @@ module RelatonBib
|
|
77
77
|
# @param prefix [String]
|
78
78
|
# @param count [Integer] number of elements
|
79
79
|
# @return [String]
|
80
|
-
def to_asciibib(prefix = "", count = 1) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
80
|
+
def to_asciibib(prefix = "", count = 1, has_attrs = false) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/MethodLength
|
81
81
|
pref = prefix.empty? ? prefix : prefix + "."
|
82
82
|
if content.is_a? String
|
83
|
+
unless language&.any? || script&.any? || has_attrs
|
84
|
+
return "#{prefix}:: #{content}\n"
|
85
|
+
end
|
86
|
+
|
83
87
|
out = count > 1 ? "#{prefix}::\n" : ""
|
84
88
|
out += "#{pref}content:: #{content}\n"
|
85
89
|
language&.each { |l| out += "#{pref}language:: #{l}\n" }
|
@@ -162,7 +162,7 @@ module RelatonBib
|
|
162
162
|
pref = prefix.empty? ? prefix : prefix + "."
|
163
163
|
out = count > 1 ? "#{pref}title::\n" : ""
|
164
164
|
out += "#{pref}title.type:: #{type}\n" if type
|
165
|
-
out += title.to_asciibib "#{pref}title"
|
165
|
+
out += title.to_asciibib "#{pref}title", 1, !(type.nil? || type.empty?)
|
166
166
|
out
|
167
167
|
end
|
168
168
|
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.6.
|
4
|
+
version: 1.6.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: 2020-11-
|
11
|
+
date: 2020-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|