relaton-bib 1.9.7 → 1.9.8

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: bfd2b1c32cf6112b7afbf78584182ca256e7f2404a60c74247da9c7aef1df7c0
4
- data.tar.gz: b39864d2a0b19aaec7bf6d59a2122ca3374bc6eb11030c4c78dd4ba3dbf73ce3
3
+ metadata.gz: cea4f63e62a2c6abff013361c4851294799cee45bcbe44a52ee8158501505f5f
4
+ data.tar.gz: 1d973d98047232ff7167257beafc0ed339177b27eb878918d9bcf0cc8f7d7301
5
5
  SHA512:
6
- metadata.gz: d392e4fb2558ccf8f3ac2d814061944cf7bb0bc94bb5afd17183146ec49082d54847bbb9ec9cefa0d98b1be0f487e46d6faed3989036930467645d424ef479fc
7
- data.tar.gz: 970106fad0a8c7799351529c61070ec7a451f6c610b8f78620f282f6b174c184dd759bc740938c3b3eb84217256399f7080dcd5ebc184343b95e928808c458e6
6
+ metadata.gz: e21ef90933920055d91d952e2b5513279d4dd61559ead7aebef9db0d7df4b15283bdd5d2cf77decb16d4e4f8d573f38c4c872582dfcdfbd0899703e4b8a9b152
7
+ data.tar.gz: 471d57586461900b6805df5c8d536591a2d0377e3da455af5708dbfa37aa13a4960bdee00f7c54de052763332de81b31f862dc9b4acc21a9992c3c52eba08d7a
data/.rubocop.yml CHANGED
@@ -2,6 +2,8 @@
2
2
  # https://github.com/riboseinc/oss-guides
3
3
  # All project-specific additions and overrides should be specified in this file.
4
4
 
5
+ require: rubocop-rails
6
+
5
7
  inherit_from:
6
8
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
9
  AllCops:
@@ -159,10 +159,11 @@ module RelatonBib
159
159
  # @option copyright [String, NilClass] :to
160
160
  # @option copyright [String, NilClass] :scope
161
161
  #
162
- # @param date [Array<Hash>]
162
+ # @param date [Array<Hash, RelatonBib::BibliographicDate>]
163
163
  # @option date [String] :type
164
- # @option date [String] :from
165
- # @option date [String] :to
164
+ # @option date [String, nil] :from required if :on is nil
165
+ # @option date [String, nil] :to
166
+ # @option date [String, nil] :on required if :from is nil
166
167
  #
167
168
  # @param contributor [Array<Hash>]
168
169
  # @option contributor [RealtonBib::Organization, RelatonBib::Person]
@@ -176,7 +177,7 @@ module RelatonBib
176
177
  # @option abstract [String] :content
177
178
  # @option abstract [String] :language
178
179
  # @option abstract [String] :script
179
- # @option abstract [String] :type
180
+ # @option abstract [String] :format
180
181
  #
181
182
  # @param relation [Array<Hash>]
182
183
  # @option relation [String] :type
@@ -67,11 +67,12 @@ module RelatonBib
67
67
  #
68
68
  def docids(reference, ver) # rubocop:disable Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/AbcSize
69
69
  ret = []
70
- sfid = reference.at("./seriesInfo[@name='#{self::FLAVOR}']", "./front/seriesInfo[@name='#{self::FLAVOR}']")
70
+ sfid = reference.at("./seriesInfo[@name='#{self::FLAVOR}']",
71
+ "./front/seriesInfo[@name='#{self::FLAVOR}']")
71
72
  if sfid
72
73
  ret << DocumentIdentifier.new(type: sfid[:name], id: sfid[:value])
73
74
  elsif self::FLAVOR && (id = (reference[:anchor] || reference[:docName] || reference[:number]))
74
- ret << DocumentIdentifier.new( type: self::FLAVOR, id: id.sub(/^(RFC)/, "\\1 "))
75
+ ret << DocumentIdentifier.new(type: self::FLAVOR, id: id.sub(/^(RFC)/, "\\1 "))
75
76
  end
76
77
  if (id = reference[:anchor])
77
78
  ret << DocumentIdentifier.new(type: "rfc-anchor", id: id)
@@ -288,6 +289,8 @@ module RelatonBib
288
289
  d = [date[:year], month(date[:month]), (date[:day] || 1)].compact.join "-"
289
290
  date = Time.parse(d).strftime "%Y-%m-%d"
290
291
  [BibliographicDate.new(type: "published", on: date)]
292
+ rescue ArgumentError
293
+ []
291
294
  end
292
295
 
293
296
  # @param reference [Nokogiri::XML::Element]
@@ -82,6 +82,8 @@ module RelatonBib
82
82
 
83
83
  # @param entity [RelatonBib::Person, RelatonBib::Organization]
84
84
  # @param role [Array<Hash>]
85
+ # @option role [String] :type
86
+ # @option role [Array<String>] :description
85
87
  def initialize(entity:, role: [])
86
88
  if role.empty?
87
89
  role << { type: entity.is_a?(Person) ? "author" : "publisher" }
@@ -94,7 +96,7 @@ module RelatonBib
94
96
  # @option opts [Nokogiri::XML::Builder] :builder XML builder
95
97
  # @option opts [String, Symbol] :lang language
96
98
  def to_xml(**opts)
97
- entity.to_xml **opts
99
+ entity.to_xml(**opts)
98
100
  end
99
101
 
100
102
  # @return [Hash]
@@ -35,7 +35,7 @@ module RelatonBib
35
35
 
36
36
  # @return [true]
37
37
  def presence?
38
- true
38
+ technical_committee.any?
39
39
  end
40
40
  end
41
41
  end
@@ -5,7 +5,7 @@ module RelatonBib
5
5
  class TypedUri
6
6
  # @return [Symbol] :src/:obp/:rss
7
7
  attr_reader :type
8
- # @retutn [URI]
8
+ # @retutn [Addressable::URI]
9
9
  attr_reader :content
10
10
 
11
11
  # @param type [String, NilClass] src/obp/rss
@@ -37,7 +37,7 @@ module RelatonBib
37
37
  # @param count [Integer] number of links
38
38
  # @return [String]
39
39
  def to_asciibib(prefix = "", count = 1)
40
- pref = prefix.empty? ? "link" : prefix + ".link"
40
+ pref = prefix.empty? ? "link" : "#{prefix}.link"
41
41
  out = count > 1 ? "#{pref}::\n" : ""
42
42
  out += "#{pref}.type:: #{type}\n" if type
43
43
  out += "#{pref}.content:: #{content}\n"
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "1.9.7".freeze
2
+ VERSION = "1.9.8".freeze
3
3
  end
data/lib/relaton_bib.rb CHANGED
@@ -14,9 +14,9 @@ module RelatonBib
14
14
  class RequestError < StandardError; end
15
15
 
16
16
  class << self
17
- # @param date [String, Integer, Date]
18
- # @param str [Boolean]
19
- # @return [Date, nil]
17
+ # @param date [String, Integer, Date] date
18
+ # @param str [Boolean] return string or Date
19
+ # @return [Date, String, nil] date
20
20
  def parse_date(date, str = true) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity,Metrics/AbcSize
21
21
  return date if date.is_a?(Date)
22
22
 
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.9.7
4
+ version: 1.9.8
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-19 00:00:00.000000000 Z
11
+ date: 2021-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug