relaton-bib 1.7.0 → 1.7.5
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/.github/workflows/rake.yml +46 -0
- data/README.adoc +2 -8
- data/lib/relaton_bib/bibliographic_item.rb +13 -6
- data/lib/relaton_bib/bibtex_parser.rb +2 -2
- data/lib/relaton_bib/copyright_association.rb +1 -1
- data/lib/relaton_bib/document_relation_collection.rb +1 -1
- data/lib/relaton_bib/document_status.rb +2 -1
- data/lib/relaton_bib/hash_converter.rb +17 -17
- data/lib/relaton_bib/organization.rb +1 -1
- data/lib/relaton_bib/typed_title_string.rb +3 -3
- data/lib/relaton_bib/version.rb +1 -1
- data/lib/relaton_bib/xml_parser.rb +4 -4
- data/relaton-bib.gemspec +3 -3
- metadata +5 -35
- data/.github/workflows/macos.yml +0 -40
- data/.github/workflows/ubuntu.yml +0 -39
- data/.github/workflows/windows.yml +0 -41
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7f2991bdb522fb06fd4e985ef76cba4267d476533cf4b1079ace20914c471547
|
|
4
|
+
data.tar.gz: 4c7da990f58fbb41d9f1d47e3b15e87e33a9c47cc0cb699d773d54eb1b28dc21
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 42309dea6306924a4e9a32b75852bd160834304d93b31dd2646c993c4bf8b60c77874bd4a3e11bc7b9c5c00a2a1745fb58e38c319e8d4cd031205d1bcfbc7c40
|
|
7
|
+
data.tar.gz: 2bf64731bc36695c85c066ca51dbd1c42c5dfd1f3c78e5b90e191fc6c3894239ea76a7b80486ae68ce2e15d9652970fd0c53fcd877262950dc4e5edf1ed919ed
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
|
2
|
+
# See https://github.com/metanorma/cimas
|
|
3
|
+
name: rake
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches: [ master, main ]
|
|
8
|
+
tags: [ v* ]
|
|
9
|
+
pull_request:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
rake:
|
|
13
|
+
name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
continue-on-error: ${{ matrix.experimental }}
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
ruby: [ '2.7', '2.6', '2.5', '2.4' ]
|
|
20
|
+
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
|
21
|
+
experimental: [ false ]
|
|
22
|
+
include:
|
|
23
|
+
- ruby: '3.0'
|
|
24
|
+
os: 'ubuntu-latest'
|
|
25
|
+
experimental: true
|
|
26
|
+
- ruby: '3.0'
|
|
27
|
+
os: 'windows-latest'
|
|
28
|
+
experimental: true
|
|
29
|
+
- ruby: '3.0'
|
|
30
|
+
os: 'macos-latest'
|
|
31
|
+
experimental: true
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v2
|
|
34
|
+
with:
|
|
35
|
+
submodules: true
|
|
36
|
+
|
|
37
|
+
# https://github.com/ruby-debug/debase/issues/89#issuecomment-686827382
|
|
38
|
+
- if: matrix.os == 'macos-latest' && matrix.ruby == '2.5'
|
|
39
|
+
run: echo BUNDLE_BUILD__DEBASE="--with-cflags=\"-Wno-error=implicit-function-declaration\"" >> $GITHUB_ENV
|
|
40
|
+
|
|
41
|
+
- uses: ruby/setup-ruby@v1
|
|
42
|
+
with:
|
|
43
|
+
ruby-version: ${{ matrix.ruby }}
|
|
44
|
+
bundler-cache: true
|
|
45
|
+
|
|
46
|
+
- run: bundle exec rake
|
data/README.adoc
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
= RelatonBib
|
|
2
2
|
|
|
3
3
|
image:https://img.shields.io/gem/v/relaton-bib.svg["Gem Version", link="https://rubygems.org/gems/relaton-bib"]
|
|
4
|
-
image:https://github.com/relaton/relaton-bib/workflows/
|
|
5
|
-
image:https://github.com/relaton/relaton-bib/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/relaton/relaton-bib/actions?workflow=windows"]
|
|
6
|
-
image:https://github.com/relaton/relaton-bib/workflows/ubuntu/badge.svg["Build Status (Ubuntu)", link="https://github.com/relaton/relaton-bib/actions?workflow=ubuntu"]
|
|
4
|
+
image:https://github.com/relaton/relaton-bib/workflows/rake/badge.svg["Build Status", link="https://github.com/relaton/relaton-bib/actions?workflow=rake"]
|
|
7
5
|
image:https://codeclimate.com/github/relaton/relaton-bib/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/relaton/relaton-bib"]
|
|
8
6
|
image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-bib.svg["Pull Requests", link="https://github.com/relaton/relaton-bib/pulls"]
|
|
9
7
|
image:https://img.shields.io/github/commits-since/relaton/relaton-bib/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-bib/releases"]
|
|
@@ -363,11 +361,7 @@ hash = YAML.load_file 'spec/examples/bib_item.yml'
|
|
|
363
361
|
=> {"id"=>"ISO/TC211",
|
|
364
362
|
...
|
|
365
363
|
|
|
366
|
-
|
|
367
|
-
=> {:id=>"ISO/TC211",
|
|
368
|
-
...
|
|
369
|
-
|
|
370
|
-
RelatonBib::BibliographicItem.new bib_hash
|
|
364
|
+
RelatonBib::BibliographicItem.from_hash hash
|
|
371
365
|
=> #<RelatonBib::BibliographicItem:0x007ff1524f8c88
|
|
372
366
|
...
|
|
373
367
|
----
|
|
@@ -197,23 +197,23 @@ module RelatonBib
|
|
|
197
197
|
@title = TypedTitleStringCollection.new(args[:title])
|
|
198
198
|
|
|
199
199
|
@date = (args[:date] || []).map do |d|
|
|
200
|
-
d.is_a?(Hash) ? BibliographicDate.new(d) : d
|
|
200
|
+
d.is_a?(Hash) ? BibliographicDate.new(**d) : d
|
|
201
201
|
end
|
|
202
202
|
|
|
203
203
|
@contributor = (args[:contributor] || []).map do |c|
|
|
204
204
|
if c.is_a? Hash
|
|
205
|
-
e = c[:entity].is_a?(Hash) ? Organization.new(c[:entity]) : c[:entity]
|
|
205
|
+
e = c[:entity].is_a?(Hash) ? Organization.new(**c[:entity]) : c[:entity]
|
|
206
206
|
ContributionInfo.new(entity: e, role: c[:role])
|
|
207
207
|
else c
|
|
208
208
|
end
|
|
209
209
|
end
|
|
210
210
|
|
|
211
211
|
@abstract = (args[:abstract] || []).map do |a|
|
|
212
|
-
a.is_a?(Hash) ? FormattedString.new(a) : a
|
|
212
|
+
a.is_a?(Hash) ? FormattedString.new(**a) : a
|
|
213
213
|
end
|
|
214
214
|
|
|
215
215
|
@copyright = args.fetch(:copyright, []).map do |c|
|
|
216
|
-
c.is_a?(Hash) ? CopyrightAssociation.new(c) : c
|
|
216
|
+
c.is_a?(Hash) ? CopyrightAssociation.new(**c) : c
|
|
217
217
|
end
|
|
218
218
|
|
|
219
219
|
@docidentifier = args[:docid] || []
|
|
@@ -229,7 +229,7 @@ module RelatonBib
|
|
|
229
229
|
@status = args[:docstatus]
|
|
230
230
|
@relation = DocRelationCollection.new(args[:relation] || [])
|
|
231
231
|
@link = args.fetch(:link, []).map do |s|
|
|
232
|
-
if s.is_a?(Hash) then TypedUri.new(s)
|
|
232
|
+
if s.is_a?(Hash) then TypedUri.new(**s)
|
|
233
233
|
elsif s.is_a?(String) then TypedUri.new(content: s)
|
|
234
234
|
else s
|
|
235
235
|
end
|
|
@@ -257,6 +257,13 @@ module RelatonBib
|
|
|
257
257
|
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
|
258
258
|
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
|
259
259
|
|
|
260
|
+
# @param hash [Hash]
|
|
261
|
+
# @return [RelatonBipm::BipmBibliographicItem]
|
|
262
|
+
def self.from_hash(hash)
|
|
263
|
+
item_hash = ::RelatonBib::HashConverter.hash_to_bib(hash)
|
|
264
|
+
new **item_hash
|
|
265
|
+
end
|
|
266
|
+
|
|
260
267
|
# @param lang [String] language code Iso639
|
|
261
268
|
# @return [RelatonBib::FormattedString, Array<RelatonBib::FormattedString>]
|
|
262
269
|
def abstract(lang: nil)
|
|
@@ -399,7 +406,7 @@ module RelatonBib
|
|
|
399
406
|
# @param type [Symbol] type of url, can be :src/:obp/:rss
|
|
400
407
|
# @return [String]
|
|
401
408
|
def url(type = :src)
|
|
402
|
-
@link.detect { |s| s.type == type.to_s }
|
|
409
|
+
@link.detect { |s| s.type == type.to_s }&.content&.to_s
|
|
403
410
|
end
|
|
404
411
|
|
|
405
412
|
def abstract=(value)
|
|
@@ -101,14 +101,14 @@ module RelatonBib
|
|
|
101
101
|
if bibtex["organization"]
|
|
102
102
|
contributor << {
|
|
103
103
|
entity: { name: bibtex.organization.to_s },
|
|
104
|
-
role: [{ type: "distributor", description: ["sponsor"] }]
|
|
104
|
+
role: [{ type: "distributor", description: ["sponsor"] }],
|
|
105
105
|
}
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
if bibtex["school"]
|
|
109
109
|
contributor << {
|
|
110
110
|
entity: { name: bibtex.school.to_s },
|
|
111
|
-
role: [{ type: "distributor", description: ["sponsor"] }]
|
|
111
|
+
role: [{ type: "distributor", description: ["sponsor"] }],
|
|
112
112
|
}
|
|
113
113
|
end
|
|
114
114
|
contributor
|
|
@@ -30,7 +30,7 @@ module RelatonBib
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
@owner = owner.map do |o|
|
|
33
|
-
o.is_a?(Hash) ? ContributionInfo.new(entity: Organization.new(o)) : o
|
|
33
|
+
o.is_a?(Hash) ? ContributionInfo.new(entity: Organization.new(**o)) : o
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
@from = Date.strptime(from.to_s, "%Y") if from.to_s.match? /\d{4}/
|
|
@@ -18,7 +18,7 @@ module RelatonBib
|
|
|
18
18
|
# RelatonBib::SourceLocalityStack>] :source_locality
|
|
19
19
|
# @option relation [RelatonBib::BibliographicItem, NillClass] :bibitem (nil)
|
|
20
20
|
def initialize(relation)
|
|
21
|
-
@array = relation.map { |r| r.is_a?(Hash) ? DocumentRelation.new(r) : r }
|
|
21
|
+
@array = relation.map { |r| r.is_a?(Hash) ? DocumentRelation.new(**r) : r }
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
# @todo We don't have replace type anymore. Suppose we should update this
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
module RelatonBib
|
|
3
4
|
# Document status.
|
|
4
5
|
class DocumentStatus
|
|
@@ -54,7 +55,7 @@ module RelatonBib
|
|
|
54
55
|
# @return [RelatonBib::DocumentStatus::Stage]
|
|
55
56
|
def stage_new(stg)
|
|
56
57
|
if stg.is_a?(Stage) then stg
|
|
57
|
-
elsif stg.is_a?(Hash) then Stage.new(stg)
|
|
58
|
+
elsif stg.is_a?(Hash) then Stage.new(**stg)
|
|
58
59
|
elsif stg.is_a?(String) then Stage.new(value: stg)
|
|
59
60
|
end
|
|
60
61
|
end
|
|
@@ -97,7 +97,7 @@ module RelatonBib
|
|
|
97
97
|
return unless ret[:place]
|
|
98
98
|
|
|
99
99
|
ret[:place] = array(ret[:place]).map do |pl|
|
|
100
|
-
pl.is_a?(String) ? Place.new(name: pl) : Place.new(pl)
|
|
100
|
+
pl.is_a?(String) ? Place.new(name: pl) : Place.new(**pl)
|
|
101
101
|
end
|
|
102
102
|
end
|
|
103
103
|
|
|
@@ -120,12 +120,12 @@ module RelatonBib
|
|
|
120
120
|
end
|
|
121
121
|
end
|
|
122
122
|
|
|
123
|
-
def docid_hash_to_bib(ret)
|
|
123
|
+
def docid_hash_to_bib(ret) # rubocop:disable Metrics/AbcSize
|
|
124
124
|
return unless ret[:docid]
|
|
125
125
|
|
|
126
126
|
ret[:docid] = array(ret[:docid])
|
|
127
127
|
ret[:docid]&.each_with_index do |id, i|
|
|
128
|
-
type = id[:type] || id[:id].match(/^\w
|
|
128
|
+
type = id[:type] || id[:id].match(/^\w+(?=\s)/)&.to_s
|
|
129
129
|
ret[:docid][i] = DocumentIdentifier.new(id: id[:id], type: type,
|
|
130
130
|
scope: id[:scope])
|
|
131
131
|
end
|
|
@@ -146,7 +146,7 @@ module RelatonBib
|
|
|
146
146
|
ret[:biblionote] = array(ret[:biblionote])
|
|
147
147
|
.reduce(BiblioNoteCollection.new([])) do |mem, n|
|
|
148
148
|
mem << if n.is_a?(String) then BiblioNote.new content: n
|
|
149
|
-
else BiblioNote.new(n)
|
|
149
|
+
else BiblioNote.new(**n)
|
|
150
150
|
end
|
|
151
151
|
end
|
|
152
152
|
end
|
|
@@ -219,7 +219,7 @@ module RelatonBib
|
|
|
219
219
|
)
|
|
220
220
|
end
|
|
221
221
|
|
|
222
|
-
def fullname_hash_to_bib(person) # rubocop:disable Metrics/AbcSize,
|
|
222
|
+
def fullname_hash_to_bib(person) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
|
223
223
|
n = person[:name]
|
|
224
224
|
FullName.new(
|
|
225
225
|
forename: array(n[:forename])&.map { |f| localname(f, person) },
|
|
@@ -247,10 +247,10 @@ module RelatonBib
|
|
|
247
247
|
script: d[:script], format: d[:format] }
|
|
248
248
|
else { content: d }
|
|
249
249
|
end
|
|
250
|
-
FormattedString.new cnt
|
|
250
|
+
FormattedString.new **cnt
|
|
251
251
|
end
|
|
252
252
|
Affiliation.new(
|
|
253
|
-
organization: Organization.new(org_hash_to_bib(a[:organization])),
|
|
253
|
+
organization: Organization.new(**org_hash_to_bib(a[:organization])),
|
|
254
254
|
description: a[:description]
|
|
255
255
|
)
|
|
256
256
|
end
|
|
@@ -288,7 +288,7 @@ module RelatonBib
|
|
|
288
288
|
ret[:relation] = array(ret[:relation])
|
|
289
289
|
ret[:relation]&.each do |r|
|
|
290
290
|
if r[:description]
|
|
291
|
-
r[:description] = FormattedString.new r[:description]
|
|
291
|
+
r[:description] = FormattedString.new **r[:description]
|
|
292
292
|
end
|
|
293
293
|
relation_bibitem_hash_to_bib(r)
|
|
294
294
|
relation_locality_hash_to_bib(r)
|
|
@@ -309,7 +309,7 @@ module RelatonBib
|
|
|
309
309
|
# @param item_hash [Hash]
|
|
310
310
|
# @return [RelatonBib::BibliographicItem]
|
|
311
311
|
def bib_item(item_hash)
|
|
312
|
-
BibliographicItem.new item_hash
|
|
312
|
+
BibliographicItem.new **item_hash
|
|
313
313
|
end
|
|
314
314
|
|
|
315
315
|
# @param rel [Hash] relation
|
|
@@ -356,26 +356,26 @@ module RelatonBib
|
|
|
356
356
|
end
|
|
357
357
|
s[:abbreviation] &&
|
|
358
358
|
s[:abbreviation] = localizedstring(s[:abbreviation])
|
|
359
|
-
Series.new(s)
|
|
359
|
+
Series.new(**s)
|
|
360
360
|
end
|
|
361
361
|
end
|
|
362
362
|
|
|
363
363
|
# @param title [Hash]
|
|
364
364
|
# @return [RelatonBib::TypedTitleString]
|
|
365
365
|
def typed_title_strig(title)
|
|
366
|
-
TypedTitleString.new title
|
|
366
|
+
TypedTitleString.new **title
|
|
367
367
|
end
|
|
368
368
|
|
|
369
369
|
# @param ret [Hash]
|
|
370
370
|
def medium_hash_to_bib(ret)
|
|
371
|
-
ret[:medium] = Medium.new(ret[:medium]) if ret[:medium]
|
|
371
|
+
ret[:medium] = Medium.new(**ret[:medium]) if ret[:medium]
|
|
372
372
|
end
|
|
373
373
|
|
|
374
374
|
# @param ret [Hash]
|
|
375
375
|
def classification_hash_to_bib(ret)
|
|
376
376
|
if ret[:classification]
|
|
377
377
|
ret[:classification] = array(ret[:classification]).map do |cls|
|
|
378
|
-
Classification.new cls
|
|
378
|
+
Classification.new **cls
|
|
379
379
|
end
|
|
380
380
|
end
|
|
381
381
|
end
|
|
@@ -409,7 +409,7 @@ module RelatonBib
|
|
|
409
409
|
return unless ret[:editorialgroup]
|
|
410
410
|
|
|
411
411
|
technical_committee = array(ret[:editorialgroup]).map do |wg|
|
|
412
|
-
TechnicalCommittee.new WorkGroup.new(wg)
|
|
412
|
+
TechnicalCommittee.new WorkGroup.new(**wg)
|
|
413
413
|
end
|
|
414
414
|
ret[:editorialgroup] = EditorialGroup.new technical_committee
|
|
415
415
|
end
|
|
@@ -418,7 +418,7 @@ module RelatonBib
|
|
|
418
418
|
def ics_hash_to_bib(ret)
|
|
419
419
|
return unless ret[:ics]
|
|
420
420
|
|
|
421
|
-
ret[:ics] = array(ret[:ics]).map { |ics| ICS.new ics }
|
|
421
|
+
ret[:ics] = array(ret[:ics]).map { |ics| ICS.new **ics }
|
|
422
422
|
end
|
|
423
423
|
|
|
424
424
|
# @param ret [Hash]
|
|
@@ -427,7 +427,7 @@ module RelatonBib
|
|
|
427
427
|
|
|
428
428
|
sids = array(ret[:structuredidentifier]).map do |si|
|
|
429
429
|
si[:agency] = array si[:agency]
|
|
430
|
-
StructuredIdentifier.new si
|
|
430
|
+
StructuredIdentifier.new **si
|
|
431
431
|
end
|
|
432
432
|
ret[:structuredidentifier] = StructuredIdentifierCollection.new sids
|
|
433
433
|
end
|
|
@@ -485,7 +485,7 @@ module RelatonBib
|
|
|
485
485
|
# @return [RelatonBib::FormattedRef]
|
|
486
486
|
def formattedref(frf)
|
|
487
487
|
if frf.is_a?(Hash)
|
|
488
|
-
RelatonBib::FormattedRef.new(frf)
|
|
488
|
+
RelatonBib::FormattedRef.new(**frf)
|
|
489
489
|
else
|
|
490
490
|
RelatonBib::FormattedRef.new(content: frf)
|
|
491
491
|
end
|
|
@@ -8,7 +8,7 @@ module RelatonBib
|
|
|
8
8
|
# @param title [Array<RelatonBib::TypedTitleString, Hash>]
|
|
9
9
|
def initialize(title = [])
|
|
10
10
|
@array = (title || []).map do |t|
|
|
11
|
-
t.is_a?(Hash) ? TypedTitleString.new(t) : t
|
|
11
|
+
t.is_a?(Hash) ? TypedTitleString.new(**t) : t
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
@@ -96,12 +96,12 @@ module RelatonBib
|
|
|
96
96
|
fsargs = args.select do |k, _v|
|
|
97
97
|
%i[content language script format].include? k
|
|
98
98
|
end
|
|
99
|
-
@title = FormattedString.new(fsargs)
|
|
99
|
+
@title = FormattedString.new(**fsargs)
|
|
100
100
|
end
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
# @param title [String]
|
|
104
|
-
# @return [
|
|
104
|
+
# @return [TypedTitleStringCollection]
|
|
105
105
|
def self.from_string(title, lang = nil, script = nil)
|
|
106
106
|
types = %w[title-intro title-main title-part]
|
|
107
107
|
ttls = split_title(title)
|
data/lib/relaton_bib/version.rb
CHANGED
|
@@ -217,7 +217,7 @@ module RelatonBib
|
|
|
217
217
|
# @param node [Nokogiri::XML::Elemen]
|
|
218
218
|
# @return [Array<RelatonBib::BibliographicDate>]
|
|
219
219
|
def fetch_dates(item) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
|
220
|
-
item.xpath("./date").
|
|
220
|
+
item.xpath("./date").each_with_object([]) do |d, a|
|
|
221
221
|
type = d[:type].to_s.empty? ? "published" : d[:type]
|
|
222
222
|
if (on = d.at("on"))
|
|
223
223
|
a << RelatonBib::BibliographicDate.new(type: type, on: on.text,
|
|
@@ -326,7 +326,7 @@ module RelatonBib
|
|
|
326
326
|
|
|
327
327
|
# @param item [Nokogiri::XML::Element]
|
|
328
328
|
# @return [Array<RelatonBib::CopyrightAssociation>]
|
|
329
|
-
def fetch_copyright(item)
|
|
329
|
+
def fetch_copyright(item) # rubocop:disable Metrics/AbcSize
|
|
330
330
|
item.xpath("./copyright").map do |cp|
|
|
331
331
|
owner = cp.xpath("owner").map do |o|
|
|
332
332
|
ContributionInfo.new entity: get_org(o.at("organization"))
|
|
@@ -376,7 +376,7 @@ module RelatonBib
|
|
|
376
376
|
# @param item_hash [Hash]
|
|
377
377
|
# @return [RelatonBib::BibliographicItem]
|
|
378
378
|
def bib_item(item_hash)
|
|
379
|
-
BibliographicItem.new item_hash
|
|
379
|
+
BibliographicItem.new **item_hash
|
|
380
380
|
end
|
|
381
381
|
|
|
382
382
|
# @param rel [Nokogiri::XML::Element]
|
|
@@ -453,7 +453,7 @@ module RelatonBib
|
|
|
453
453
|
|
|
454
454
|
# @param ext [Nokogiri::XML::Element]
|
|
455
455
|
# @return [RelatonBib::StructuredIdentifierCollection]
|
|
456
|
-
def fetch_structuredidentifier(ext) # rubocop:disable Metrics/AbcSize,
|
|
456
|
+
def fetch_structuredidentifier(ext) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
|
457
457
|
return unless ext
|
|
458
458
|
|
|
459
459
|
sids = ext.xpath("structuredidentifier").map do |si|
|
data/relaton-bib.gemspec
CHANGED
|
@@ -24,11 +24,11 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
|
25
25
|
|
|
26
26
|
spec.add_development_dependency "byebug"
|
|
27
|
-
|
|
27
|
+
# ec.add_development_dependency "debase"
|
|
28
28
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
|
29
|
-
spec.add_development_dependency "rake", "~>
|
|
29
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
|
30
30
|
spec.add_development_dependency "rspec", "~> 3.0"
|
|
31
|
-
spec.add_development_dependency "ruby-debug-ide"
|
|
31
|
+
# spec.add_development_dependency "ruby-debug-ide"
|
|
32
32
|
spec.add_development_dependency "ruby-jing"
|
|
33
33
|
spec.add_development_dependency "simplecov"
|
|
34
34
|
|
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.7.
|
|
4
|
+
version: 1.7.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-04-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: byebug
|
|
@@ -24,20 +24,6 @@ dependencies:
|
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: debase
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - ">="
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0'
|
|
34
|
-
type: :development
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - ">="
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0'
|
|
41
27
|
- !ruby/object:Gem::Dependency
|
|
42
28
|
name: equivalent-xml
|
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -58,14 +44,14 @@ dependencies:
|
|
|
58
44
|
requirements:
|
|
59
45
|
- - "~>"
|
|
60
46
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '
|
|
47
|
+
version: '13.0'
|
|
62
48
|
type: :development
|
|
63
49
|
prerelease: false
|
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
51
|
requirements:
|
|
66
52
|
- - "~>"
|
|
67
53
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '
|
|
54
|
+
version: '13.0'
|
|
69
55
|
- !ruby/object:Gem::Dependency
|
|
70
56
|
name: rspec
|
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -80,20 +66,6 @@ dependencies:
|
|
|
80
66
|
- - "~>"
|
|
81
67
|
- !ruby/object:Gem::Version
|
|
82
68
|
version: '3.0'
|
|
83
|
-
- !ruby/object:Gem::Dependency
|
|
84
|
-
name: ruby-debug-ide
|
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
|
86
|
-
requirements:
|
|
87
|
-
- - ">="
|
|
88
|
-
- !ruby/object:Gem::Version
|
|
89
|
-
version: '0'
|
|
90
|
-
type: :development
|
|
91
|
-
prerelease: false
|
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
-
requirements:
|
|
94
|
-
- - ">="
|
|
95
|
-
- !ruby/object:Gem::Version
|
|
96
|
-
version: '0'
|
|
97
69
|
- !ruby/object:Gem::Dependency
|
|
98
70
|
name: ruby-jing
|
|
99
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -185,9 +157,7 @@ executables: []
|
|
|
185
157
|
extensions: []
|
|
186
158
|
extra_rdoc_files: []
|
|
187
159
|
files:
|
|
188
|
-
- ".github/workflows/
|
|
189
|
-
- ".github/workflows/ubuntu.yml"
|
|
190
|
-
- ".github/workflows/windows.yml"
|
|
160
|
+
- ".github/workflows/rake.yml"
|
|
191
161
|
- ".gitignore"
|
|
192
162
|
- ".gitmodules"
|
|
193
163
|
- ".hound.yml"
|
data/.github/workflows/macos.yml
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# Auto-generated by Cimas: Do not edit it manually!
|
|
2
|
-
# See https://github.com/metanorma/cimas
|
|
3
|
-
name: macos
|
|
4
|
-
|
|
5
|
-
on:
|
|
6
|
-
push:
|
|
7
|
-
branches: [ master ]
|
|
8
|
-
pull_request:
|
|
9
|
-
branches: [ '**' ]
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
test-macos:
|
|
13
|
-
name: Test on Ruby ${{ matrix.ruby }} macOS
|
|
14
|
-
runs-on: macos-latest
|
|
15
|
-
strategy:
|
|
16
|
-
fail-fast: false
|
|
17
|
-
matrix:
|
|
18
|
-
ruby: [ '2.6', '2.5', '2.4' ]
|
|
19
|
-
steps:
|
|
20
|
-
- uses: actions/checkout@master
|
|
21
|
-
- name: Checkout submodules
|
|
22
|
-
shell: bash
|
|
23
|
-
run: |
|
|
24
|
-
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
|
25
|
-
git submodule sync --recursive
|
|
26
|
-
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
|
27
|
-
- name: Use Ruby
|
|
28
|
-
uses: actions/setup-ruby@v1
|
|
29
|
-
with:
|
|
30
|
-
ruby-version: ${{ matrix.ruby }}
|
|
31
|
-
architecture: 'x64'
|
|
32
|
-
- name: Update gems
|
|
33
|
-
run: |
|
|
34
|
-
sudo gem install bundler --force
|
|
35
|
-
ruby -v | grep 2.5 && bundle config set build.debase --with-cflags="-Wno-error=implicit-function-declaration"
|
|
36
|
-
ruby -v | grep 2.5 && bundle config set build.ruby-debug-ide --with-cflags="-Wno-error=implicit-function-declaration"
|
|
37
|
-
bundle install --jobs 4 --retry 3
|
|
38
|
-
- name: Run specs
|
|
39
|
-
run: |
|
|
40
|
-
bundle exec rake
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# Auto-generated by Cimas: Do not edit it manually!
|
|
2
|
-
# See https://github.com/metanorma/cimas
|
|
3
|
-
name: ubuntu
|
|
4
|
-
|
|
5
|
-
on:
|
|
6
|
-
push:
|
|
7
|
-
branches: [ master ]
|
|
8
|
-
pull_request:
|
|
9
|
-
branches: [ '**' ]
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
test-linux:
|
|
13
|
-
name: Test on Ruby ${{ matrix.ruby }} Ubuntu
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
strategy:
|
|
16
|
-
fail-fast: false
|
|
17
|
-
matrix:
|
|
18
|
-
ruby: [ '2.6', '2.5', '2.4' ]
|
|
19
|
-
steps:
|
|
20
|
-
- uses: actions/checkout@master
|
|
21
|
-
- name: Checkout submodules
|
|
22
|
-
shell: bash
|
|
23
|
-
run: |
|
|
24
|
-
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
|
25
|
-
git submodule sync --recursive
|
|
26
|
-
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
|
27
|
-
- name: Use Ruby
|
|
28
|
-
uses: actions/setup-ruby@v1
|
|
29
|
-
with:
|
|
30
|
-
ruby-version: ${{ matrix.ruby }}
|
|
31
|
-
architecture: 'x64'
|
|
32
|
-
- name: Update gems
|
|
33
|
-
run: |
|
|
34
|
-
gem install bundler
|
|
35
|
-
bundle install --jobs 4 --retry 3
|
|
36
|
-
- name: Run specs
|
|
37
|
-
run: |
|
|
38
|
-
unset JAVA_TOOL_OPTIONS
|
|
39
|
-
bundle exec rake
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Auto-generated by Cimas: Do not edit it manually!
|
|
2
|
-
# See https://github.com/metanorma/cimas
|
|
3
|
-
name: windows
|
|
4
|
-
|
|
5
|
-
on:
|
|
6
|
-
push:
|
|
7
|
-
branches: [ master ]
|
|
8
|
-
pull_request:
|
|
9
|
-
branches: [ '**' ]
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
test-windows:
|
|
13
|
-
name: Test on Ruby ${{ matrix.ruby }} Windows
|
|
14
|
-
runs-on: windows-latest
|
|
15
|
-
strategy:
|
|
16
|
-
fail-fast: false
|
|
17
|
-
matrix:
|
|
18
|
-
ruby: [ '2.6', '2.5', '2.4' ]
|
|
19
|
-
steps:
|
|
20
|
-
- uses: actions/checkout@master
|
|
21
|
-
- name: Checkout submodules
|
|
22
|
-
shell: bash
|
|
23
|
-
run: |
|
|
24
|
-
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
|
25
|
-
git submodule sync --recursive
|
|
26
|
-
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
|
27
|
-
- name: Use Ruby
|
|
28
|
-
uses: actions/setup-ruby@v1
|
|
29
|
-
with:
|
|
30
|
-
ruby-version: ${{ matrix.ruby }}
|
|
31
|
-
architecture: 'x64'
|
|
32
|
-
- name: Update gems
|
|
33
|
-
shell: pwsh
|
|
34
|
-
run: |
|
|
35
|
-
gem install bundler
|
|
36
|
-
bundle config --local path vendor/bundle
|
|
37
|
-
bundle update
|
|
38
|
-
bundle install --jobs 4 --retry 3
|
|
39
|
-
- name: Run specs
|
|
40
|
-
run: |
|
|
41
|
-
bundle exec rake
|