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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 924c1178be50079233bcdaab53273e403db6d0b88eb52072dda0c35c407cbb1b
4
- data.tar.gz: aa998727f67bfa48b1f332727e1fcd528c0f875ea76ec14b581273ad17364f3f
3
+ metadata.gz: d699c8f7630bd78527f5b6af45de122d212b2b0aeaf6bab74c419413177b68e2
4
+ data.tar.gz: f2c1e08cc99f5fc8125bfe95c390e3ecf8e7db7a9231bcbd9570ace42bce7213
5
5
  SHA512:
6
- metadata.gz: 94db650838f6549d4d8d954e5a3af5e261dea2450638a3b6fc3b1a6c265b3f83888f2cace0043bad06b43f722b9aff9ed74f675a5bc0efe26d98d1f0dd74f19c
7
- data.tar.gz: 93bf2cf0b5a504e909ca03794fe27c53bc62c08b88c1d75be1be59681898b664e1c5bc39ccebc94f4b04d2888d9448da3a2dbe02a98dd08d3d82800d1418495c
6
+ metadata.gz: 187e612af0116057862eb237a9e65dfa7f44479646d4851fc6957d14b560ecedf7db65ef878a91406ae82c8716d9bcd6b41fa238c428ae993c687ad2ea3f7aca
7
+ data.tar.gz: f8e9ccdf0fc71f1cefde163d620db1c39a693d40737b336232f3388f2e69bbe8a4cbdea6a3adb4c703aded1f43eff9d0edb0b63b9701d01f625079a079ff773c
@@ -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::Affilation.new(
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::Affilation.new(
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
  )],
@@ -54,7 +54,7 @@ module RelatonBib
54
54
  attr_reader :docnumber
55
55
 
56
56
  # @return [Array<RelatonBib::BibliographicDate>]
57
- attr_reader :date
57
+ attr_accessor :date
58
58
 
59
59
  # @return [Array<RelatonBib::ContributionInfo>]
60
60
  attr_reader :contributor
@@ -82,8 +82,8 @@ module RelatonBib
82
82
  end
83
83
  end
84
84
 
85
- # Affilation.
86
- class Affilation
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
- Affilation.new(
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
@@ -120,7 +120,7 @@ module RelatonBib
120
120
  # @return [RelatonBib::FullName]
121
121
  attr_accessor :name
122
122
 
123
- # @return [Array<RelatonBib::Affilation>]
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
- def initialize(name:, affiliation: [], contact: [], identifier: [])
134
- super(contact: contact)
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
- warn %{[relaton-bib] title type "#{args[:type]}" is invalid.}
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.}
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "0.8.1".freeze
2
+ VERSION = "0.9.0".freeze
3
3
  end
@@ -199,13 +199,13 @@ module RelatonBib
199
199
  end
200
200
 
201
201
  def get_person(person)
202
- affilations = person.xpath("./affiliation").map do |a|
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
- Affilation.new organization: get_org(org), description: desc
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: affilations,
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.8.1
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-02-26 00:00:00.000000000 Z
11
+ date: 2020-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase