relaton-iec 0.4.4 → 0.4.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/macos.yml +29 -0
- data/.github/workflows/ubuntu.yml +29 -0
- data/.github/workflows/windows.yml +32 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +10 -10
- data/lib/relaton_iec/iec_bibliography.rb +4 -3
- data/lib/relaton_iec/processor.rb +1 -1
- data/lib/relaton_iec/scrapper.rb +4 -3
- data/lib/relaton_iec/version.rb +1 -1
- metadata +6 -6
- data/.travis.yml +0 -18
- data/appveyor.yml +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6d7f75333f38690a37c1603db561839e6961d92cff1ba1a19686927b9c275956
|
4
|
+
data.tar.gz: 4f3ad3e8d68061752214bbbedf6b15b7ae4f76d24353b1bc8642780f79ac719e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62a41738294652537a9749c916da12ede2ef39818d22b362a36838295f411e284bc73b4a6f7d472b2fe2dcff3c5ddabd2eac2723290ca91350035960fbcaecb8
|
7
|
+
data.tar.gz: 22e6b926519024b7e7f768e784048f78dee7b7a4c5dd836bab818be3fad8c101dfd7b511f2ef432459f91370bdd742f462fea77bc77bd140f6c1a43cf4fc3a41
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Auto-generated !!! Do not edit it manually
|
2
|
+
# use ci-master https://github.com/metanorma/metanorma-build-scripts
|
3
|
+
name: macos
|
4
|
+
|
5
|
+
on: [push]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
test-macos:
|
9
|
+
name: Test on Ruby ${{ matrix.ruby }} macOS
|
10
|
+
runs-on: macos-latest
|
11
|
+
strategy:
|
12
|
+
matrix:
|
13
|
+
ruby: [ '2.6', '2.5', '2.4' ]
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@master
|
16
|
+
with:
|
17
|
+
submodules: recursive
|
18
|
+
- name: Use Ruby
|
19
|
+
uses: actions/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
architecture: 'x64'
|
23
|
+
- name: Update gems
|
24
|
+
run: |
|
25
|
+
sudo gem install bundler -v "~> 2" --force
|
26
|
+
bundle install --jobs 4 --retry 3
|
27
|
+
- name: Run specs
|
28
|
+
run: |
|
29
|
+
bundle exec rake
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Auto-generated !!! Do not edit it manually
|
2
|
+
# use ci-master https://github.com/metanorma/metanorma-build-scripts
|
3
|
+
name: ubuntu
|
4
|
+
|
5
|
+
on: [push]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
test-linux:
|
9
|
+
name: Test on Ruby ${{ matrix.ruby }} Ubuntu
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
strategy:
|
12
|
+
matrix:
|
13
|
+
ruby: [ '2.6', '2.5', '2.4' ]
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@master
|
16
|
+
with:
|
17
|
+
submodules: recursive
|
18
|
+
- name: Use Ruby
|
19
|
+
uses: actions/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
architecture: 'x64'
|
23
|
+
- name: Update gems
|
24
|
+
run: |
|
25
|
+
gem install bundler -v "~> 2"
|
26
|
+
bundle install --jobs 4 --retry 3
|
27
|
+
- name: Run specs
|
28
|
+
run: |
|
29
|
+
bundle exec rake
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Auto-generated !!! Do not edit it manually
|
2
|
+
# use ci-master https://github.com/metanorma/metanorma-build-scripts
|
3
|
+
name: windows
|
4
|
+
|
5
|
+
on: [push]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
test-windows:
|
9
|
+
name: Test on Ruby ${{ matrix.ruby }} Windows
|
10
|
+
runs-on: windows-latest
|
11
|
+
strategy:
|
12
|
+
matrix:
|
13
|
+
ruby: [ '2.6', '2.5', '2.4' ]
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@master
|
16
|
+
with:
|
17
|
+
submodules: recursive
|
18
|
+
- name: Use Ruby
|
19
|
+
uses: actions/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
architecture: 'x64'
|
23
|
+
- name: Update gems
|
24
|
+
shell: pwsh
|
25
|
+
run: |
|
26
|
+
gem install bundler -v "~> 2"
|
27
|
+
bundle config --local path vendor/bundle
|
28
|
+
bundle update
|
29
|
+
bundle install --jobs 4 --retry 3
|
30
|
+
- name: Run specs
|
31
|
+
run: |
|
32
|
+
bundle exec rake
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
relaton-iec (0.4.
|
4
|
+
relaton-iec (0.4.11)
|
5
5
|
addressable
|
6
6
|
relaton-iso-bib (~> 0.3.0)
|
7
7
|
|
@@ -14,15 +14,15 @@ GEM
|
|
14
14
|
coderay (1.1.2)
|
15
15
|
crack (0.4.3)
|
16
16
|
safe_yaml (~> 1.0.0)
|
17
|
-
debase (0.2.
|
17
|
+
debase (0.2.4.1)
|
18
18
|
debase-ruby_core_source (>= 0.10.2)
|
19
19
|
debase-ruby_core_source (0.10.5)
|
20
20
|
diff-lcs (1.3)
|
21
21
|
docile (1.3.2)
|
22
22
|
equivalent-xml (0.6.0)
|
23
23
|
nokogiri (>= 1.4.3)
|
24
|
-
hashdiff (0.
|
25
|
-
isoics (0.1.
|
24
|
+
hashdiff (1.0.0)
|
25
|
+
isoics (0.1.8)
|
26
26
|
json (2.2.0)
|
27
27
|
method_source (0.9.2)
|
28
28
|
mini_portile2 (2.4.0)
|
@@ -36,10 +36,10 @@ GEM
|
|
36
36
|
pry (~> 0.10)
|
37
37
|
public_suffix (4.0.1)
|
38
38
|
rake (10.5.0)
|
39
|
-
relaton-bib (0.3.
|
39
|
+
relaton-bib (0.3.12)
|
40
40
|
addressable
|
41
41
|
nokogiri
|
42
|
-
relaton-iso-bib (0.3.
|
42
|
+
relaton-iso-bib (0.3.12)
|
43
43
|
isoics (~> 0.1.6)
|
44
44
|
relaton-bib (~> 0.3.0)
|
45
45
|
ruby_deep_clone (~> 0.8.0)
|
@@ -47,7 +47,7 @@ GEM
|
|
47
47
|
rspec-core (~> 3.8.0)
|
48
48
|
rspec-expectations (~> 3.8.0)
|
49
49
|
rspec-mocks (~> 3.8.0)
|
50
|
-
rspec-core (3.8.
|
50
|
+
rspec-core (3.8.2)
|
51
51
|
rspec-support (~> 3.8.0)
|
52
52
|
rspec-expectations (3.8.4)
|
53
53
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -60,13 +60,13 @@ GEM
|
|
60
60
|
rake (>= 0.8.1)
|
61
61
|
ruby_deep_clone (0.8.0)
|
62
62
|
safe_yaml (1.0.5)
|
63
|
-
simplecov (0.
|
63
|
+
simplecov (0.17.0)
|
64
64
|
docile (~> 1.1)
|
65
65
|
json (>= 1.8, < 3)
|
66
66
|
simplecov-html (~> 0.10.0)
|
67
67
|
simplecov-html (0.10.2)
|
68
68
|
vcr (5.0.0)
|
69
|
-
webmock (3.
|
69
|
+
webmock (3.7.2)
|
70
70
|
addressable (>= 2.3.6)
|
71
71
|
crack (>= 0.3.2)
|
72
72
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -88,4 +88,4 @@ DEPENDENCIES
|
|
88
88
|
webmock
|
89
89
|
|
90
90
|
BUNDLED WITH
|
91
|
-
2.0.
|
91
|
+
2.0.2
|
@@ -29,7 +29,7 @@ module RelatonIec
|
|
29
29
|
# @return [String] Relaton XML serialisation of reference
|
30
30
|
def get(code, year = nil, opts = {})
|
31
31
|
if year.nil?
|
32
|
-
/^(?<code1>[^:]+):(?<year1>[^:]+)
|
32
|
+
/^(?<code1>[^:]+):(?<year1>[^:]+)/ =~ code
|
33
33
|
unless code1.nil?
|
34
34
|
code = code1
|
35
35
|
year = year1
|
@@ -38,7 +38,8 @@ module RelatonIec
|
|
38
38
|
|
39
39
|
return iev if code.casecmp("IEV").zero?
|
40
40
|
|
41
|
-
code
|
41
|
+
opts[:all_parts] ||= !(code = code.sub(" (all parts)", "")).nil?
|
42
|
+
# code += "-1" if opts[:all_parts]
|
42
43
|
ret = iecbib_get1(code, year, opts)
|
43
44
|
return nil if ret.nil?
|
44
45
|
|
@@ -81,7 +82,7 @@ module RelatonIec
|
|
81
82
|
result = search(code)
|
82
83
|
result.select do |i|
|
83
84
|
i.hit[:code] &&
|
84
|
-
i.hit[:code].match(docidrx).to_s
|
85
|
+
i.hit[:code].match(docidrx).to_s.include?(code) &&
|
85
86
|
corrigrx !~ i.hit[:code]
|
86
87
|
end
|
87
88
|
end
|
data/lib/relaton_iec/scrapper.rb
CHANGED
@@ -57,13 +57,14 @@ module RelatonIec
|
|
57
57
|
status, relations = fetch_status_relations hit_data[:url]
|
58
58
|
|
59
59
|
RelatonIsoBib::IsoBibliographicItem.new(
|
60
|
+
fetched: Date.today.to_s,
|
60
61
|
docid: [RelatonBib::DocumentIdentifier.new(id: hit_data[:code], type: "IEC")],
|
61
62
|
structuredidentifier: fetch_structuredidentifier(doc),
|
62
63
|
edition: edition,
|
63
64
|
language: ["en"],
|
64
65
|
script: ["Latn"],
|
65
66
|
title: fetch_titles(hit_data),
|
66
|
-
|
67
|
+
doctype: fetch_type(doc),
|
67
68
|
docstatus: status,
|
68
69
|
ics: fetch_ics(doc),
|
69
70
|
date: fetch_dates(doc),
|
@@ -293,8 +294,8 @@ module RelatonIec
|
|
293
294
|
# @param doc [Nokogiri::HTML::Document]
|
294
295
|
# @return [String]
|
295
296
|
def fetch_type(doc)
|
296
|
-
doc.at('//th[contains(., "Publication type")]/following-sibling::td/span')
|
297
|
-
|
297
|
+
doc.at('//th[contains(., "Publication type")]/following-sibling::td/span').
|
298
|
+
text.downcase.tr " ", "-"
|
298
299
|
# type_match = title.match(%r{^(ISO|IWA|IEC)(?:(/IEC|/IEEE|/PRF|
|
299
300
|
# /NP)*\s|/)(TS|TR|PAS|AWI|CD|FDIS|NP|DIS|WD|R|Guide|(?=\d+))}x)
|
300
301
|
# #return "international-standard" if type_match.nil?
|
data/lib/relaton_iec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-iec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -186,16 +186,17 @@ executables: []
|
|
186
186
|
extensions: []
|
187
187
|
extra_rdoc_files: []
|
188
188
|
files:
|
189
|
+
- ".github/workflows/macos.yml"
|
190
|
+
- ".github/workflows/ubuntu.yml"
|
191
|
+
- ".github/workflows/windows.yml"
|
189
192
|
- ".gitignore"
|
190
193
|
- ".rspec"
|
191
194
|
- ".rubocop.yml"
|
192
|
-
- ".travis.yml"
|
193
195
|
- Gemfile
|
194
196
|
- Gemfile.lock
|
195
197
|
- LICENSE.txt
|
196
198
|
- README.adoc
|
197
199
|
- Rakefile
|
198
|
-
- appveyor.yml
|
199
200
|
- bin/console
|
200
201
|
- bin/setup
|
201
202
|
- lib/relaton_iec.rb
|
@@ -226,8 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
227
|
- !ruby/object:Gem::Version
|
227
228
|
version: '0'
|
228
229
|
requirements: []
|
229
|
-
|
230
|
-
rubygems_version: 2.6.12
|
230
|
+
rubygems_version: 3.0.6
|
231
231
|
signing_key:
|
232
232
|
specification_version: 4
|
233
233
|
summary: 'RelatonIec: retrieve IEC Standards for bibliographic use using the IsoBibliographicItem
|
data/.travis.yml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# Auto-generated !!! Do not edit it manually
|
2
|
-
# use ci-master https://github.com/metanorma/metanorma-build-scripts
|
3
|
-
language: ruby
|
4
|
-
cache: bundler
|
5
|
-
os:
|
6
|
-
- linux
|
7
|
-
- osx
|
8
|
-
rvm:
|
9
|
-
- 2.6
|
10
|
-
- 2.5
|
11
|
-
- 2.4
|
12
|
-
- ruby-head
|
13
|
-
before_install:
|
14
|
-
- gem install bundler -v "~> 2"
|
15
|
-
- bundle update
|
16
|
-
matrix:
|
17
|
-
allow_failures:
|
18
|
-
- rvm: ruby-head
|
data/appveyor.yml
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# Auto-generated !!! Do not edit it manually
|
2
|
-
# use ci-master https://github.com/metanorma/metanorma-build-scripts
|
3
|
-
version: '{build}'
|
4
|
-
|
5
|
-
cache:
|
6
|
-
- vendor/bundle
|
7
|
-
|
8
|
-
environment:
|
9
|
-
matrix:
|
10
|
-
- RUBY_VERSION: 26
|
11
|
-
- RUBY_VERSION: 25
|
12
|
-
- RUBY_VERSION: 24
|
13
|
-
- RUBY_VERSION: _trunk
|
14
|
-
|
15
|
-
matrix:
|
16
|
-
allow_failures:
|
17
|
-
- RUBY_VERSION: _trunk
|
18
|
-
|
19
|
-
install:
|
20
|
-
- ps: . { iwr -useb https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/appveyor.ps1 } | iex
|
21
|
-
- refreshenv
|
22
|
-
|
23
|
-
build_script:
|
24
|
-
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
|
25
|
-
- set GIT_TERMINAL_PROMPT=0
|
26
|
-
- gem install bundler -v "~> 2"
|
27
|
-
- bundle config --local path vendor/bundle
|
28
|
-
- bundle update
|
29
|
-
- bundle install
|
30
|
-
|
31
|
-
before_test:
|
32
|
-
- ruby -v
|
33
|
-
- gem -v
|
34
|
-
- bundle -v
|
35
|
-
|
36
|
-
test_script:
|
37
|
-
- bundle exec rake
|