relaton-bib 0.8.1 → 0.9.0
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/README.adoc +2 -2
- data/lib/relaton_bib/bibliographic_item.rb +1 -1
- data/lib/relaton_bib/contributor.rb +3 -3
- data/lib/relaton_bib/hash_converter.rb +2 -2
- data/lib/relaton_bib/person.rb +4 -3
- data/lib/relaton_bib/typed_title_string.rb +4 -4
- data/lib/relaton_bib/version.rb +1 -1
- data/lib/relaton_bib/xml_parser.rb +3 -3
- 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: d699c8f7630bd78527f5b6af45de122d212b2b0aeaf6bab74c419413177b68e2
|
4
|
+
data.tar.gz: f2c1e08cc99f5fc8125bfe95c390e3ecf8e7db7a9231bcbd9570ace42bce7213
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 187e612af0116057862eb237a9e65dfa7f44479646d4851fc6957d14b560ecedf7db65ef878a91406ae82c8716d9bcd6b41fa238c428ae993c687ad2ea3f7aca
|
7
|
+
data.tar.gz: f8e9ccdf0fc71f1cefde163d620db1c39a693d40737b336232f3388f2e69bbe8a4cbdea6a3adb4c703aded1f43eff9d0edb0b63b9701d01f625079a079ff773c
|
data/README.adoc
CHANGED
@@ -85,7 +85,7 @@ item = RelatonBib::BibliographicItem.new(
|
|
85
85
|
name: RelatonBib::FullName.new(
|
86
86
|
completename: RelatonBib::LocalizedString.new("A. Bierman", "en"),
|
87
87
|
),
|
88
|
-
affiliation: [RelatonBib::
|
88
|
+
affiliation: [RelatonBib::Affiliation.new(
|
89
89
|
organization: RelatonBib::Organization.new(
|
90
90
|
name: "IETF",
|
91
91
|
abbreviation: RelatonBib::LocalizedString.new("IETF"),
|
@@ -119,7 +119,7 @@ item = RelatonBib::BibliographicItem.new(
|
|
119
119
|
addition: [RelatonBib::LocalizedString.new("Addition", "en")],
|
120
120
|
prefix: [RelatonBib::LocalizedString.new("Prefix", "en")],
|
121
121
|
),
|
122
|
-
affiliation: [RelatonBib::
|
122
|
+
affiliation: [RelatonBib::Affiliation.new(
|
123
123
|
organization: RelatonBib::Organization.new(name: "IETF", abbreviation: "IETF"),
|
124
124
|
description: [RelatonBib::LocalizedString.new("Description", "en")]
|
125
125
|
)],
|
@@ -82,8 +82,8 @@ module RelatonBib
|
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
|
-
#
|
86
|
-
class
|
85
|
+
# Affiliation.
|
86
|
+
class Affiliation
|
87
87
|
include RelatonBib
|
88
88
|
|
89
89
|
# @return [RelatonBib::LocalizedString, NilClass]
|
@@ -132,7 +132,7 @@ module RelatonBib
|
|
132
132
|
# @return [Array<RelatonBib::Address, RelatonBib::Contact>]
|
133
133
|
attr_reader :contact
|
134
134
|
|
135
|
-
# @param url [String]
|
135
|
+
# @param url [String, NilClass]
|
136
136
|
# @param contact [Array<RelatonBib::Address, RelatonBib::Contact>]
|
137
137
|
def initialize(url: nil, contact: [])
|
138
138
|
@uri = URI url if url
|
@@ -230,7 +230,7 @@ module RelatonBib
|
|
230
230
|
end
|
231
231
|
FormattedString.new cnt
|
232
232
|
end
|
233
|
-
|
233
|
+
Affiliation.new(
|
234
234
|
organization: Organization.new(org_hash_to_bib(a[:organization])),
|
235
235
|
description: a[:description],
|
236
236
|
)
|
@@ -269,7 +269,7 @@ module RelatonBib
|
|
269
269
|
if rel[:bibitem]
|
270
270
|
ret[:relation][idx][:bibitem] = bib_item(hash_to_bib(rel[:bibitem], true))
|
271
271
|
else
|
272
|
-
warn "bibitem missing: #{rel}"
|
272
|
+
warn "[relaton-bib] bibitem missing: #{rel}"
|
273
273
|
ret[:relation][idx][:bibitem] = nil
|
274
274
|
end
|
275
275
|
end
|
data/lib/relaton_bib/person.rb
CHANGED
@@ -120,7 +120,7 @@ module RelatonBib
|
|
120
120
|
# @return [RelatonBib::FullName]
|
121
121
|
attr_accessor :name
|
122
122
|
|
123
|
-
# @return [Array<RelatonBib::
|
123
|
+
# @return [Array<RelatonBib::Affiliation>]
|
124
124
|
attr_accessor :affiliation
|
125
125
|
|
126
126
|
# @return [Array<RelatonBib::PersonIdentifier>]
|
@@ -130,8 +130,9 @@ module RelatonBib
|
|
130
130
|
# @param affiliation [Array<RelatonBib::Affiliation>]
|
131
131
|
# @param contact [Array<RelatonBib::Address, RelatonBib::Contact>]
|
132
132
|
# @param identifier [Array<RelatonBib::PersonIdentifier>]
|
133
|
-
|
134
|
-
|
133
|
+
# @param url [String, NilClass]
|
134
|
+
def initialize(name:, affiliation: [], contact: [], identifier: [], url: nil)
|
135
|
+
super(contact: contact, url: url)
|
135
136
|
@name = name
|
136
137
|
@affiliation = affiliation
|
137
138
|
@identifier = identifier
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module RelatonBib
|
2
2
|
class TypedTitleString
|
3
|
-
TITLE_TYPES = %w[alternative original unofficial subtitle main].freeze
|
3
|
+
# TITLE_TYPES = %w[alternative original unofficial subtitle main].freeze
|
4
4
|
|
5
5
|
# @return [String]
|
6
6
|
attr_reader :type
|
@@ -16,9 +16,9 @@ module RelatonBib
|
|
16
16
|
# @param language [String]
|
17
17
|
# @param script [String]
|
18
18
|
def initialize(**args)
|
19
|
-
if args[:type] && !TITLE_TYPES.include?(args[:type])
|
20
|
-
|
21
|
-
end
|
19
|
+
# if args[:type] && !TITLE_TYPES.include?(args[:type])
|
20
|
+
# warn %{[relaton-bib] title type "#{args[:type]}" is invalid.}
|
21
|
+
# end
|
22
22
|
|
23
23
|
unless args[:title] || args[:content]
|
24
24
|
raise ArgumentError, %{Keyword "title" or "content" should be passed.}
|
data/lib/relaton_bib/version.rb
CHANGED
@@ -199,13 +199,13 @@ module RelatonBib
|
|
199
199
|
end
|
200
200
|
|
201
201
|
def get_person(person)
|
202
|
-
|
202
|
+
affiliations = person.xpath("./affiliation").map do |a|
|
203
203
|
org = a.at "./organization"
|
204
204
|
desc = a.xpath("./description").map do |e|
|
205
205
|
FormattedString.new(content: e.text, language: e[:language],
|
206
206
|
script: e[:script], format: e[:format])
|
207
207
|
end
|
208
|
-
|
208
|
+
Affiliation.new organization: get_org(org), description: desc
|
209
209
|
end
|
210
210
|
|
211
211
|
contact = person.xpath("./address | ./phone | ./email | ./uri").map do |c|
|
@@ -245,7 +245,7 @@ module RelatonBib
|
|
245
245
|
|
246
246
|
Person.new(
|
247
247
|
name: name,
|
248
|
-
affiliation:
|
248
|
+
affiliation: affiliations,
|
249
249
|
contact: contact,
|
250
250
|
identifier: identifier,
|
251
251
|
)
|
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: 0.
|
4
|
+
version: 0.9.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-
|
11
|
+
date: 2020-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase
|