relaton-bib 1.7.1 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 [Array<self>]
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)
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "1.7.1".freeze
2
+ VERSION = "1.8.0".freeze
3
3
  end
@@ -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").reduce([]) do |a, d|
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, Metrics/MethodLength, Metrics/CyclomaticComplexity
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
- spec.add_development_dependency "debase"
27
+ # ec.add_development_dependency "debase"
28
28
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
29
- spec.add_development_dependency "rake", "~> 10.0"
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.1
4
+ version: 1.8.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-12-23 00:00:00.000000000 Z
11
+ date: 2021-05-17 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: '10.0'
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: '10.0'
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/macos.yml"
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"
@@ -263,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
233
  - !ruby/object:Gem::Version
264
234
  version: '0'
265
235
  requirements: []
266
- rubygems_version: 3.0.6
236
+ rubygems_version: 3.2.3
267
237
  signing_key:
268
238
  specification_version: 4
269
239
  summary: 'RelatonBib: Ruby XMLDOC impementation.'
@@ -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