relaton-iso 1.7.2 → 1.7.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: a0484edee8670c0f8b65c5f16dd01ea45e29a4ef5cdfe6dbf8372063004cee71
4
- data.tar.gz: 571928a396258e54eda1d06de63fa115adf16ba5be19461286bddd89e443681a
3
+ metadata.gz: d4a259567ff58157c4e2ce7cdb42516a5b48c38c48c06cf6babc2793b5705a5f
4
+ data.tar.gz: af7e308f2ef935198c892373f34c848e6adc9927416213e2332b1ee8e61e4915
5
5
  SHA512:
6
- metadata.gz: d3ef966a35e5adacf0238be0a30be5d259954507e08ffd0782e0fe3b5ba088e9a3535d22eb0377a3a15aa4393a157b8784184ec0d239af2d1268a8c09265c678
7
- data.tar.gz: 6bde0ed1d2b918db22c0bf012d982e763a0f0aa01bcc20728d13bd20f040c3d690e39b8ddb5dc188654575166b633dedce607497c413906cb0fe5d2e113e486a
6
+ metadata.gz: fb095cb68470acb96d7b9af3cb1401102fcb20dcbe77202667e97be6351c28f935b46429d38682bd3d95f7a345e27e8c805fbdc71460b06c5510437e6485db5a
7
+ data.tar.gz: c0ff98be71df26db50efb60ba616905e654466d0d761ea20319c0629d84edeef2fc25d0cb2405aef58a61df1f1e6c5c50227cca60c9c2f6121b5c9cc2300d44e
@@ -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/bin/racc ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'racc' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("racc", "racc")
@@ -33,7 +33,7 @@ module RelatonIso
33
33
 
34
34
  # @param lang [String, NilClass]
35
35
  # @return [RelatonIsoBib::IsoBibliographicItem]
36
- def to_all_parts(lang = nil)
36
+ def to_all_parts(lang = nil) # rubocop:disable Metrics/CyclomaticComplexity
37
37
  parts = @array.reject { |h| h.hit["docPart"]&.empty? }
38
38
  hit = parts.min_by { |h| h.hit["docPart"].to_i }
39
39
  return @array.first.fetch lang unless hit
@@ -42,10 +42,10 @@ module RelatonIso
42
42
  all_parts_item = bibitem.to_all_parts
43
43
  parts.reject { |h| h.hit["docRef"] == hit.hit["docRef"] }.each do |hi|
44
44
  isobib = RelatonIsoBib::IsoBibliographicItem.new(
45
- formattedref: RelatonBib::FormattedRef.new(content: hi.hit["docRef"]),
45
+ formattedref: RelatonBib::FormattedRef.new(content: hi.hit["docRef"])
46
46
  )
47
47
  all_parts_item.relation << RelatonBib::DocumentRelation.new(
48
- type: "instance", bibitem: isobib,
48
+ type: "instance", bibitem: isobib
49
49
  )
50
50
  end
51
51
  all_parts_item
@@ -37,5 +37,11 @@ module RelatonIso
37
37
  def grammar_hash
38
38
  @grammar_hash ||= ::RelatonIsoBib.grammar_hash
39
39
  end
40
+
41
+ # Returns number of workers
42
+ # @return [Integer]
43
+ def threads
44
+ 3
45
+ end
40
46
  end
41
47
  end
@@ -402,8 +402,7 @@ module RelatonIso
402
402
  owner_name = ref.match(/.*?(?=\s)/).to_s
403
403
  from = ref.match(/(?<=:)\d{4}/).to_s
404
404
  if from.empty?
405
- from = doc.xpath("//span[@itemprop='releaseDate']").text
406
- .match(/\d{4}/).to_s
405
+ from = doc.xpath("//span[@itemprop='releaseDate']").text.match(/\d{4}/).to_s
407
406
  end
408
407
  [{ owner: [{ name: owner_name }], from: from }]
409
408
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIso
4
- VERSION = "1.7.2"
4
+ VERSION = "1.7.3"
5
5
  end
data/relaton_iso.gemspec CHANGED
@@ -27,12 +27,12 @@ Gem::Specification.new do |spec|
27
27
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
28
28
 
29
29
  spec.add_development_dependency "byebug"
30
- spec.add_development_dependency "debase"
30
+ # spec.add_development_dependency "debase"
31
31
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
32
32
  spec.add_development_dependency "pry-byebug"
33
33
  spec.add_development_dependency "rake", "~> 10.0"
34
34
  spec.add_development_dependency "rspec", "~> 3.0"
35
- spec.add_development_dependency "ruby-debug-ide"
35
+ # spec.add_development_dependency "ruby-debug-ide"
36
36
  spec.add_development_dependency "simplecov"
37
37
  spec.add_development_dependency "vcr"
38
38
  spec.add_development_dependency "webmock"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.2
4
+ version: 1.7.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: 2021-01-21 00:00:00.000000000 Z
11
+ date: 2021-03-18 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
@@ -94,20 +80,6 @@ dependencies:
94
80
  - - "~>"
95
81
  - !ruby/object:Gem::Version
96
82
  version: '3.0'
97
- - !ruby/object:Gem::Dependency
98
- name: ruby-debug-ide
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
83
  - !ruby/object:Gem::Dependency
112
84
  name: simplecov
113
85
  requirement: !ruby/object:Gem::Requirement
@@ -186,9 +158,7 @@ executables: []
186
158
  extensions: []
187
159
  extra_rdoc_files: []
188
160
  files:
189
- - ".github/workflows/macos.yml"
190
- - ".github/workflows/ubuntu.yml"
191
- - ".github/workflows/windows.yml"
161
+ - ".github/workflows/rake.yml"
192
162
  - ".gitignore"
193
163
  - ".hound.yml"
194
164
  - ".rspec"
@@ -208,6 +178,7 @@ files:
208
178
  - bin/ldiff
209
179
  - bin/nokogiri
210
180
  - bin/pry
181
+ - bin/racc
211
182
  - bin/rake
212
183
  - bin/rdebug-ide
213
184
  - bin/rspec
@@ -1,34 +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: Use Ruby
22
- uses: actions/setup-ruby@v1
23
- with:
24
- ruby-version: ${{ matrix.ruby }}
25
- architecture: 'x64'
26
- - name: Update gems
27
- run: |
28
- sudo gem install bundler --force
29
- ruby -v | grep 2.5 && bundle config set build.debase --with-cflags="-Wno-error=implicit-function-declaration"
30
- ruby -v | grep 2.5 && bundle config set build.ruby-debug-ide --with-cflags="-Wno-error=implicit-function-declaration"
31
- bundle install --jobs 4 --retry 3
32
- - name: Run specs
33
- run: |
34
- bundle exec rake
@@ -1,32 +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: Use Ruby
22
- uses: actions/setup-ruby@v1
23
- with:
24
- ruby-version: ${{ matrix.ruby }}
25
- architecture: 'x64'
26
- - name: Update gems
27
- run: |
28
- gem install bundler
29
- bundle install --jobs 4 --retry 3
30
- - name: Run specs
31
- run: |
32
- bundle exec rake
@@ -1,35 +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: Use Ruby
22
- uses: actions/setup-ruby@v1
23
- with:
24
- ruby-version: ${{ matrix.ruby }}
25
- architecture: 'x64'
26
- - name: Update gems
27
- shell: pwsh
28
- run: |
29
- gem install bundler
30
- bundle config --local path vendor/bundle
31
- bundle update
32
- bundle install --jobs 4 --retry 3
33
- - name: Run specs
34
- run: |
35
- bundle exec rake