relaton-iho 1.5.0 → 1.7.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5287c92a9460b9824298f86fe7a8a921c6e95ec905af81c3972ccd89b39c435e
4
- data.tar.gz: 89f4d59af4346061c1a7c964471f1c3989a850767e96a3b2f1b2949e88557a1a
3
+ metadata.gz: 61320ca932f5b001e0ee77ba3f8372f47955a9c066f80a63fa87b9b1d3cc4377
4
+ data.tar.gz: ed1e7270d08a2c8bbc18ca6452310a44a4ae09c24b813f16482f7998b1936f32
5
5
  SHA512:
6
- metadata.gz: a7f9474e438600fc90653129f6bc7cd3fdf49f07fac96ca63771b8d1eeeda06635771e2dafeb0f1d4462efa09caaa197548cca3079f112334a58e87d29783468
7
- data.tar.gz: 2999394cad48607762ffdc67456c0c14731315d9138b3b26e4d1f260bd464918d7b836f81d228c7881c100bb582fd5a2a3d2fde716f64d296b9fb7ec8e66bce4
6
+ metadata.gz: cd79eaa7e5d7dbcceca170fbff4d6859ccabd8059f43f4ff974e3ac5d9bde0f23269af77b7402783194a4f46a08237f711006b87cbc46ab570f778cc58c45850
7
+ data.tar.gz: 206d9a1d25fa364fdbfa578b75b9b2dc020bdb5f1bcb1fa6c53cddb7064f78f35b6ffbfc36198cd55b0a08cd63c97bdf1fadd0fca4a3f4499701566cf7e27cb7
@@ -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/README.adoc CHANGED
@@ -119,11 +119,7 @@ hash = YAML.load_file 'spec/fixtures/iho.yaml'
119
119
  => {"id"=>"B-11",
120
120
  ...
121
121
 
122
- bib_hash = RelatonIho::HashConverter.hash_to_bib hash
123
- => {:id=>"B-11",
124
- ...
125
-
126
- RelatonIho::IhoBibliographicItem.new bib_hash
122
+ RelatonIho::IhoBibliographicItem.from_hash hash
127
123
  => #<RelatonIho::IhoBibliographicItem:0x007fc322ef8548
128
124
  ...
129
125
  ----
data/grammars/isodoc.rng CHANGED
@@ -24,6 +24,14 @@
24
24
  <start>
25
25
  <ref name="standard-document"/>
26
26
  </start>
27
+ <define name="doctype">
28
+ <element name="doctype">
29
+ <optional>
30
+ <attribute name="abbreviation"/>
31
+ </optional>
32
+ <ref name="DocumentType"/>
33
+ </element>
34
+ </define>
27
35
  <define name="hyperlink">
28
36
  <element name="link">
29
37
  <attribute name="target">
@@ -141,6 +149,11 @@
141
149
  <data type="boolean"/>
142
150
  </attribute>
143
151
  </optional>
152
+ <optional>
153
+ <attribute name="key">
154
+ <data type="boolean"/>
155
+ </attribute>
156
+ </optional>
144
157
  <oneOrMore>
145
158
  <ref name="dt"/>
146
159
  <ref name="dd"/>
@@ -1164,49 +1177,7 @@
1164
1177
  </define>
1165
1178
  <define name="annex">
1166
1179
  <element name="annex">
1167
- <optional>
1168
- <attribute name="id">
1169
- <data type="ID"/>
1170
- </attribute>
1171
- </optional>
1172
- <optional>
1173
- <attribute name="language"/>
1174
- </optional>
1175
- <optional>
1176
- <attribute name="script"/>
1177
- </optional>
1178
- <optional>
1179
- <attribute name="inline-header">
1180
- <data type="boolean"/>
1181
- </attribute>
1182
- </optional>
1183
- <attribute name="obligation">
1184
- <choice>
1185
- <value>normative</value>
1186
- <value>informative</value>
1187
- </choice>
1188
- </attribute>
1189
- <optional>
1190
- <ref name="section-title"/>
1191
- </optional>
1192
- <group>
1193
- <group>
1194
- <zeroOrMore>
1195
- <ref name="BasicBlock"/>
1196
- </zeroOrMore>
1197
- <zeroOrMore>
1198
- <ref name="note"/>
1199
- </zeroOrMore>
1200
- </group>
1201
- <zeroOrMore>
1202
- <choice>
1203
- <ref name="annex-subsection"/>
1204
- <ref name="terms"/>
1205
- <ref name="definitions"/>
1206
- <ref name="references"/>
1207
- </choice>
1208
- </zeroOrMore>
1209
- </group>
1180
+ <ref name="Annex-Section"/>
1210
1181
  </element>
1211
1182
  </define>
1212
1183
  <define name="terms">
@@ -23,7 +23,7 @@ module RelatonIho
23
23
 
24
24
  # @param ret [Hash]
25
25
  def commentperiod_hash_to_bib(ret)
26
- ret[:commentperiod] &&= CommentPeriond.new(ret[:commentperiod])
26
+ ret[:commentperiod] &&= CommentPeriond.new(**ret[:commentperiod])
27
27
  end
28
28
 
29
29
  # @param ret [Hash]
@@ -13,6 +13,13 @@ module RelatonIho
13
13
  super
14
14
  end
15
15
 
16
+ # @param hash [Hash]
17
+ # @return [RelatonIho::IhoBibliographicItem]
18
+ def self.from_hash(hash)
19
+ item_hash = ::RelatonIho::HashConverter.hash_to_bib(hash)
20
+ new **item_hash
21
+ end
22
+
16
23
  # @param opts [Hash]
17
24
  # @option opts [Nokogiri::XML::Builder] :builder XML builder
18
25
  # @option opts [Boolean] :bibdata
@@ -16,7 +16,7 @@ module RelatonIho
16
16
  return unless resp.code == "200"
17
17
 
18
18
  hash = HashConverter.hash_to_bib YAML.safe_load(resp.body, [Date])
19
- item = IhoBibliographicItem.new hash
19
+ item = IhoBibliographicItem.new **hash
20
20
  warn "[relaton-iho] (\"#{text}\") found #{item.docidentifier.first.id}"
21
21
  item
22
22
  rescue SocketError, Errno::EINVAL, Errno::ECONNRESET, EOFError,
@@ -28,8 +28,7 @@ module RelatonIho
28
28
  # @param hash [Hash]
29
29
  # @return [RelatonIho::IhoBibliographicItem]
30
30
  def hash_to_bib(hash)
31
- item_hash = ::RelatonIho::HashConverter.hash_to_bib(hash)
32
- ::RelatonIho::IhoBibliographicItem.new item_hash
31
+ ::RelatonIho::IhoBibliographicItem.new hash
33
32
  end
34
33
 
35
34
  # Returns hash of XML grammar
@@ -1,3 +1,3 @@
1
1
  module RelatonIho
2
- VERSION = "1.5.0".freeze
2
+ VERSION = "1.7.2".freeze
3
3
  end
@@ -18,10 +18,10 @@ module RelatonIho
18
18
  # @param item_hash [Hash]
19
19
  # @return [RelatonIho::IhoBibliographicItem]
20
20
  def bib_item(item_hash)
21
- IhoBibliographicItem.new item_hash
21
+ IhoBibliographicItem.new **item_hash
22
22
  end
23
23
 
24
- # @param ext [Nokogiri::XML::Element]
24
+ # @param ext [Nokogiri::XML::Element, nil]
25
25
  # @return [RelatonIho::EditorialGroupCollection, nil]
26
26
  def fetch_editorialgroup(ext)
27
27
  return unless ext
@@ -35,7 +35,7 @@ module RelatonIho
35
35
  EditorialGroupCollection.new egs if egs.any?
36
36
  end
37
37
 
38
- # @param ext [Nokogiri::XML::Element. nil]
38
+ # @param ihgrp [Nokogiri::XML::Element, nil]
39
39
  # @return [RelatonIho::Committee, RelatonIho::Commission,
40
40
  # RelatonIho::Workgroup, nil]
41
41
  def iho_group(ihgrp)
data/relaton_iho.gemspec CHANGED
@@ -22,15 +22,15 @@ Gem::Specification.new do |s|
22
22
  s.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
23
23
 
24
24
  s.add_development_dependency "byebug"
25
- s.add_development_dependency "debase"
25
+ # s.add_development_dependency "debase"
26
26
  s.add_development_dependency "equivalent-xml", "~> 0.6"
27
27
  s.add_development_dependency "rake", "~> 10.0"
28
28
  s.add_development_dependency "rspec", "~> 3.0"
29
- s.add_development_dependency "ruby-debug-ide"
29
+ # s.add_development_dependency "ruby-debug-ide"
30
30
  s.add_development_dependency "ruby-jing"
31
31
  s.add_development_dependency "simplecov"
32
32
  s.add_development_dependency "vcr"
33
33
  s.add_development_dependency "webmock"
34
34
 
35
- s.add_dependency "relaton-bib", "~> 1.5.0"
35
+ s.add_dependency "relaton-bib", "~> 1.7.0"
36
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-09 00:00:00.000000000 Z
11
+ date: 2021-03-19 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
@@ -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
@@ -156,14 +128,14 @@ dependencies:
156
128
  requirements:
157
129
  - - "~>"
158
130
  - !ruby/object:Gem::Version
159
- version: 1.5.0
131
+ version: 1.7.0
160
132
  type: :runtime
161
133
  prerelease: false
162
134
  version_requirements: !ruby/object:Gem::Requirement
163
135
  requirements:
164
136
  - - "~>"
165
137
  - !ruby/object:Gem::Version
166
- version: 1.5.0
138
+ version: 1.7.0
167
139
  description: 'RelatonIho: retrieve IHO Standards for bibliographic using the BibliographicItem
168
140
  model'
169
141
  email:
@@ -172,9 +144,7 @@ executables: []
172
144
  extensions: []
173
145
  extra_rdoc_files: []
174
146
  files:
175
- - ".github/workflows/macos.yml"
176
- - ".github/workflows/ubuntu.yml"
177
- - ".github/workflows/windows.yml"
147
+ - ".github/workflows/rake.yml"
178
148
  - ".gitignore"
179
149
  - ".rspec"
180
150
  - ".rubocop.yml"
@@ -1,32 +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
- bundle install --jobs 4 --retry 3
30
- - name: Run specs
31
- run: |
32
- 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