relaton-ietf 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0082697b1d652caba7ebe1bbc65cee01d5577ce3bee47495a812c29dc795a0ea'
4
- data.tar.gz: 791a22989f337071fec4deb1fe54fe88ea1f0633ba23fdae22f995137ae5e040
3
+ metadata.gz: bfc51d85c3388e1f2d4f1b4bd530ee4c36b10f60906b742eec812f313d9ec1cf
4
+ data.tar.gz: 961323b40d233d6dd662f2f9fb98590bb39f649067d7efaf6de642a2ec3ae204
5
5
  SHA512:
6
- metadata.gz: a876551c178f85e8c8f86c8a80adf75d3448fa25b14a138b914c88d584cc9a3c187fc277c0ed4ec3ddff40c77b41433c03a570c23a69364889f8a3545ca7f0a9
7
- data.tar.gz: c8bbc988a93108be2218e6a7b29bb28ac72caf8b17e03ce7ac0886f0cb9433b93beb5725bf86495dea59d14910ece127252af0b509bec361d7a773630d484505
6
+ metadata.gz: c96ccb8c67e97d5023823b6b45d6ecc2323ffc599de7f3306948d1f92e1e4840c7c9d4dbf6161248d5cf5f0c23adcefa13afb7e7065e2077e4df6573bacb09e5
7
+ data.tar.gz: 34759601e2ac3d273815cf87f54674daff30f9b1136b091e4b7af326f0a569b11370af17f9ead8f128c22b51ff070f9f9904b77fca5f16ec917c1d32a5566a32
@@ -204,12 +204,12 @@ module RelatonIetf
204
204
 
205
205
  # @return [Array<Hash{Symbol=>RelatonBib::Organization,Symbol=>Array<String>}>]
206
206
  def organizations(reference)
207
- reference.xpath("./seriesinfo").map do |si|
208
- next unless si[:stream]
207
+ publisher = { entity: new_org, role: [type: "publisher"] }
208
+ reference.xpath("./seriesinfo").reduce([publisher]) do |mem, si|
209
+ next mem unless si[:stream]
209
210
 
210
- entity = RelatonBib::Organization.new name: si[:stream]
211
- { entity: entity, role: [type: "author"] }
212
- end.compact
211
+ mem << { entity: new_org(si[:stream]), role: [type: "author"] }
212
+ end
213
213
  end
214
214
 
215
215
  # @param author [Nokogiri::XML::Document]
@@ -267,13 +267,18 @@ module RelatonIetf
267
267
  # @return [RelatonBib::Affiliation]
268
268
  def affiliation(author)
269
269
  organization = author.at("./organization")
270
- org = RelatonBib::Organization.new(
271
- name: organization.nil? || organization&.text&.empty? ? "IETF" : organization.text,
272
- abbreviation: organization.nil? ? "IETF" : (organization[:abbrev] || "IETF"),
273
- )
270
+ org = if organization.nil? || organization&.text&.empty?
271
+ new_org
272
+ else
273
+ new_org organization.text, organization[:abbrev]
274
+ end
274
275
  RelatonBib::Affiliation.new organization: org
275
276
  end
276
277
 
278
+ def new_org(name = "Internet Engineering Task Force", abbr = "IETF")
279
+ RelatonBib::Organization.new name: name, abbreviation: abbr
280
+ end
281
+
277
282
  # @param author [Nokogiri::XML::Document]
278
283
  # @return [Hash]
279
284
  def contributor_role(author)
@@ -1,3 +1,3 @@
1
1
  module RelatonIetf
2
- VERSION = "1.0.2".freeze
2
+ VERSION = "1.0.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ietf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.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: 2020-05-20 00:00:00.000000000 Z
11
+ date: 2020-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase