relaton-gb 1.7.0 → 1.7.1
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/lib/relaton_gb/gb_bibliographic_item.rb +2 -2
- data/lib/relaton_gb/gb_scrapper.rb +1 -1
- data/lib/relaton_gb/sec_scrapper.rb +1 -1
- data/lib/relaton_gb/t_scrapper.rb +1 -1
- data/lib/relaton_gb/version.rb +1 -1
- data/lib/relaton_gb/xml_parser.rb +1 -1
- data/relaton_gb.gemspec +2 -2
- metadata +3 -33
- data/.github/workflows/macos.yml +0 -34
- data/.github/workflows/ubuntu.yml +0 -33
- data/.github/workflows/windows.yml +0 -35
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6bace1b7a804bd668e60000515fdfc8b5d63264507f15962b89d01748a44282c
|
|
4
|
+
data.tar.gz: ba2cd2c3fe33796d692bbbe9be87fa00c2402367d99e8ea06f0d8e596976180a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d3f12296ffec4cd1684859be82b743328f64dabdac64b3db8a36f3006f780562a4244b67e1aabc4eef992d5e4da991b2d7ee7fededfdb9c2df2ac1cb78f85ff
|
|
7
|
+
data.tar.gz: 3e4cedf195effcb9a3bbb53f6dc758e4dcd1c8ae4a2753f041b3d10eab7136d255de35b1173221a3fa4a94b8369ad360fee6a7810f22795262b547de30f09807
|
|
@@ -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
|
|
@@ -31,9 +31,9 @@ module RelatonGb
|
|
|
31
31
|
|
|
32
32
|
def initialize(**args)
|
|
33
33
|
super
|
|
34
|
-
@committee = GbTechnicalCommittee.new args[:committee] if args[:committee]
|
|
34
|
+
@committee = GbTechnicalCommittee.new **args[:committee] if args[:committee]
|
|
35
35
|
@ccs = args[:ccs].map { |c| c.is_a?(Cnccs::Ccs) ? c : Cnccs.fetch(c) }
|
|
36
|
-
@gbtype = GbStandardType.new args[:gbtype]
|
|
36
|
+
@gbtype = GbStandardType.new **args[:gbtype]
|
|
37
37
|
@gbplannumber = args[:gbplannumber] ||
|
|
38
38
|
structuredidentifier&.project_number
|
|
39
39
|
end
|
|
@@ -37,7 +37,7 @@ module RelatonGb
|
|
|
37
37
|
def scrape_doc(hit)
|
|
38
38
|
src = "http://openstd.samr.gov.cn/bzgk/gb/newGbInfo?hcno=" + hit.pid
|
|
39
39
|
doc = Nokogiri::HTML OpenURI.open_uri(src)
|
|
40
|
-
GbBibliographicItem.new scrapped_data(doc, src, hit)
|
|
40
|
+
GbBibliographicItem.new **scrapped_data(doc, src, hit)
|
|
41
41
|
rescue OpenURI::HTTPError, SocketError, OpenSSL::SSL::SSLError
|
|
42
42
|
raise RelatonBib::RequestError, "Cannot access #{src}"
|
|
43
43
|
end
|
|
@@ -42,7 +42,7 @@ module RelatonGb
|
|
|
42
42
|
src = "http://hbba.sacinfo.org.cn/stdDetail/#{hit.pid}"
|
|
43
43
|
page_uri = URI src
|
|
44
44
|
doc = Nokogiri::HTML Net::HTTP.get(page_uri)
|
|
45
|
-
GbBibliographicItem.new scrapped_data(doc, src, hit)
|
|
45
|
+
GbBibliographicItem.new **scrapped_data(doc, src, hit)
|
|
46
46
|
rescue SocketError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
|
|
47
47
|
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
|
|
48
48
|
OpenSSL::SSL::SSLError, Errno::ETIMEDOUT
|
|
@@ -43,7 +43,7 @@ module RelatonGb
|
|
|
43
43
|
def scrape_doc(hit)
|
|
44
44
|
src = "http://www.ttbz.org.cn#{hit.pid}"
|
|
45
45
|
doc = Nokogiri::HTML OpenURI.open_uri(src), nil, Encoding::UTF_8.to_s
|
|
46
|
-
GbBibliographicItem.new scrapped_data(doc, src, hit)
|
|
46
|
+
GbBibliographicItem.new **scrapped_data(doc, src, hit)
|
|
47
47
|
rescue OpenURI::HTTPError, SocketError, OpenSSL::SSL::SSLError
|
|
48
48
|
raise RelatonBib::RequestError, "Cannot access #{src}"
|
|
49
49
|
end
|
data/lib/relaton_gb/version.rb
CHANGED
data/relaton_gb.gemspec
CHANGED
|
@@ -24,12 +24,12 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
spec.require_paths = ["lib"]
|
|
25
25
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
|
26
26
|
|
|
27
|
-
spec.add_development_dependency "debase"
|
|
27
|
+
# spec.add_development_dependency "debase"
|
|
28
28
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
|
29
29
|
spec.add_development_dependency "pry-byebug"
|
|
30
30
|
spec.add_development_dependency "rake", "~> 10.0"
|
|
31
31
|
spec.add_development_dependency "rspec", "~> 3.0"
|
|
32
|
-
spec.add_development_dependency "ruby-debug-ide"
|
|
32
|
+
# spec.add_development_dependency "ruby-debug-ide"
|
|
33
33
|
spec.add_development_dependency "ruby-jing"
|
|
34
34
|
spec.add_development_dependency "simplecov"
|
|
35
35
|
spec.add_development_dependency "vcr"
|
metadata
CHANGED
|
@@ -1,29 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relaton-gb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.7.
|
|
4
|
+
version: 1.7.1
|
|
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-03-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: debase
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - ">="
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - ">="
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0'
|
|
27
13
|
- !ruby/object:Gem::Dependency
|
|
28
14
|
name: equivalent-xml
|
|
29
15
|
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
|
|
@@ -200,9 +172,7 @@ executables: []
|
|
|
200
172
|
extensions: []
|
|
201
173
|
extra_rdoc_files: []
|
|
202
174
|
files:
|
|
203
|
-
- ".github/workflows/
|
|
204
|
-
- ".github/workflows/ubuntu.yml"
|
|
205
|
-
- ".github/workflows/windows.yml"
|
|
175
|
+
- ".github/workflows/rake.yml"
|
|
206
176
|
- ".gitignore"
|
|
207
177
|
- ".hound.yml"
|
|
208
178
|
- ".rspec"
|
data/.github/workflows/macos.yml
DELETED
|
@@ -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,33 +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
|
-
unset JAVA_TOOL_OPTIONS
|
|
33
|
-
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
|