relaton-iec 0.4.6 → 0.4.12

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
- SHA1:
3
- metadata.gz: 382616c833c9a8c8b9bba8e4bc8402ad16964512
4
- data.tar.gz: 5748210bf40ef66e0eeea6e3abd945e3298fcdaa
2
+ SHA256:
3
+ metadata.gz: 7ffda8bff3cfc8eb622b02dc02ab54dcd1a585e1e510b279d1e8b86b84f33e81
4
+ data.tar.gz: fa65f4f24e2215170c3c6e000cd297c3f1080c2bf8472dc9518acea873fc499d
5
5
  SHA512:
6
- metadata.gz: 5536938f0990091ab32a56ae344831210b4c26fe7469c1f5225644ee51c3458189a49f790758f728e170abbab5c18ec9219f3b1cf2ee6ae5335d89a537457ea6
7
- data.tar.gz: c7ca012b59181f4d79912d55c3fa43037f82217a0a5ea447f4b8270f4b6321dc517978e852ae78d94cb6c05a9dcedfa01807e360b19b252c1e7e70328acbd54f
6
+ metadata.gz: f8b5af3a9860cd6bbbfd302f0265f5c900987e48b611822687e314d8a1a2722424bd437d33136bc799773c315510b69c8021af10f7dbc42aa898dd1cc9d391a7
7
+ data.tar.gz: 9e0d30dfdd67ad3e90029c4891ed611552c99ca4828244fa7f68e278eab88e28ae5947d691f6180c219d90c61153f035c7cf0a4764989863f30ec62238410cdf
@@ -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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- relaton-iec (0.4.6)
4
+ relaton-iec (0.4.12)
5
5
  addressable
6
6
  relaton-iso-bib (~> 0.3.0)
7
7
 
@@ -22,7 +22,7 @@ GEM
22
22
  equivalent-xml (0.6.0)
23
23
  nokogiri (>= 1.4.3)
24
24
  hashdiff (1.0.0)
25
- isoics (0.1.7)
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.8)
39
+ relaton-bib (0.3.12)
40
40
  addressable
41
41
  nokogiri
42
- relaton-iso-bib (0.3.7)
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)
@@ -88,4 +88,4 @@ DEPENDENCIES
88
88
  webmock
89
89
 
90
90
  BUNDLED WITH
91
- 2.0.1
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>[^:]+)$/ =~ code
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 += "-1" if opts[:all_parts]
41
+ opts[:all_parts] ||= !(code =~ / \(all parts\)/).nil?
42
+ code = code.sub(/ \(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 == code &&
85
+ i.hit[:code].match(docidrx).to_s.include?(code) &&
85
86
  corrigrx !~ i.hit[:code]
86
87
  end
87
88
  end
@@ -5,7 +5,7 @@ module RelatonIec
5
5
  def initialize
6
6
  @short = :relaton_iec
7
7
  @prefix = "IEC"
8
- @defaultprefix = %r{^(IEC)[ /]|^IEV($| )}
8
+ @defaultprefix = %r{^IEC\s|^IEV($|\s)}
9
9
  @idtype = "IEC"
10
10
  end
11
11
 
@@ -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
- type: fetch_type(doc),
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
- .text.downcase.tr " ", "-"
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?
@@ -1,3 +1,3 @@
1
1
  module RelatonIec
2
- VERSION = "0.4.6".freeze
2
+ VERSION = "0.4.12".freeze
3
3
  end
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.6
4
+ version: 0.4.12
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-09-27 00:00:00.000000000 Z
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
- rubyforge_project:
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
@@ -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
@@ -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