relaton-iho 1.2.3 → 1.3.0

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: 8a71904841f99ee9eab8d284e9834870734dbaa46c2dac616f3fd37a64c1dcfd
4
- data.tar.gz: 42ce621872f8df62d1af6faa4eb02237b11f37494b733609b72b80f04e4df54a
3
+ metadata.gz: 77ecf973a90c8af2ae4a0f67edc3f313f850afe7a2d99385923bf8e84cd05c6b
4
+ data.tar.gz: fd1ad0bd00a7cd28dcc5e1a44cf2dc1a71ffbfce90893f526bb0a80552bb4208
5
5
  SHA512:
6
- metadata.gz: d3fca909e02416984e999fc122916c143f7a9bcc6fc9d191541983e62b91ddb4212cf28563136b1ba82d53341c8c1465681fe16fd335567fe1ebcd85288c6cc1
7
- data.tar.gz: ef010c3146afc90870fe301e641848b0e37fd959b9dcda4c09ff16e556668f4174add4b0412122c450d1d7f553d05efb9a6926bfb5a3cb0e2bdd2d0cf7e0f97b
6
+ metadata.gz: 6ccb427bc61bf0b5550baad8cf0511086bc0c0ae5407ca60062f191edb31630a706f1b59d4d07c7564c550849fa9e83b627c70a76eda6c065003c6301ffa1f35
7
+ data.tar.gz: '08a06a4eff69ace8c8437916d8cd916cd7e48fdcd2208a47d0dc6fa2dc75db752d175d0d60b5df7003bb35e1bc65871a97c9e65b30031dfc4f82bf8bead3d52d'
@@ -5,6 +5,6 @@
5
5
  inherit_from:
6
6
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
7
  AllCops:
8
- TargetRubyVersion: 2.3
8
+ TargetRubyVersion: 2.4
9
9
  Rails:
10
- Enabled: true
10
+ Enabled: false
@@ -27,5 +27,15 @@ module RelatonIho
27
27
  hash["to"] = to.to_s if to
28
28
  hash
29
29
  end
30
+
31
+ # @param prefix [String]
32
+ # @return [String]
33
+ def to_asciibib(prefix)
34
+ pref = prefix.empty? ? prefix : prefix + "."
35
+ pref += "commentperiod"
36
+ out = "#{pref}.from:: #{from}\n"
37
+ out += "#{pref}.to:: #{to}\n" if to
38
+ out
39
+ end
30
40
  end
31
41
  end
@@ -5,7 +5,7 @@ module RelatonIho
5
5
 
6
6
  def_delegators :@collection, :first, :any?
7
7
 
8
- # @return [Array<RelatonIho::editorialgroup]
8
+ # @return [Array<RelatonIho::EditorialGroup]
9
9
  attr_reader :collection
10
10
 
11
11
  # @param collection [Array<RelatonIho::EditorialGroup>]
@@ -23,6 +23,12 @@ module RelatonIho
23
23
  single_element_array collection
24
24
  end
25
25
 
26
+ # @param prefix [String]
27
+ # @return [String]
28
+ def to_asciibib(prefix)
29
+ collection.map { |ed| ed.to_asciibib prefix, collection.size }.join
30
+ end
31
+
26
32
  # @return [Boolean]
27
33
  def presence?
28
34
  any?
@@ -60,5 +66,17 @@ module RelatonIho
60
66
  hash["workgroup"] = workgroup if workgroup
61
67
  hash
62
68
  end
69
+
70
+ # @param prefix [String]
71
+ # @param count [Integer]
72
+ # @return [Strin]
73
+ def to_asciibib(prefix, count)
74
+ pref = prefix.empty? ? prefix : prefix + "."
75
+ pref += "editorialgroup"
76
+ out = count > 1 ? "#{pref}::\n" : ""
77
+ out += "#{pref}.committee:: #{committee}\n"
78
+ out += "#{pref}.workgroup:: #{workgroup}\n" if workgroup
79
+ out
80
+ end
63
81
  end
64
82
  end
@@ -15,7 +15,7 @@ module RelatonIho
15
15
 
16
16
  # @param builder [Nokogiri::XML::Builder]
17
17
  # @param bibdata [TrueClasss, FalseClass, NilClass]
18
- def to_xml(builer = nil, **opts)
18
+ def to_xml(builer = nil, **opts) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
19
19
  opts[:ext] = !commentperiod.nil?
20
20
  super do |b|
21
21
  if opts[:bibdata] && (doctype || editorialgroup&.presence? ||
@@ -36,5 +36,13 @@ module RelatonIho
36
36
  hash["commentperiod"] = commentperiod.to_hash if commentperiod
37
37
  hash
38
38
  end
39
+
40
+ # @param prefix [String]
41
+ # @return [String]
42
+ def to_asciibib(prefix = "")
43
+ out = super
44
+ out += commentperiod.to_asciibib prefix if commentperiod
45
+ out
46
+ end
39
47
  end
40
48
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonIho
2
- VERSION = "1.2.3".freeze
2
+ VERSION = "1.3.0".freeze
3
3
  end
@@ -32,5 +32,5 @@ Gem::Specification.new do |s|
32
32
  s.add_development_dependency "vcr"
33
33
  s.add_development_dependency "webmock"
34
34
 
35
- s.add_dependency "relaton-bib", "~> 1.2.0"
35
+ s.add_dependency "relaton-bib", "~> 1.3.0"
36
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-08 00:00:00.000000000 Z
11
+ date: 2020-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.2.0
159
+ version: 1.3.0
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 1.2.0
166
+ version: 1.3.0
167
167
  description: 'RelatonIho: retrieve IHO Standards for bibliographic using the BibliographicItem
168
168
  model'
169
169
  email: