relaton-ieee 1.6.0 → 1.7.4

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: 1937aa373837e30e20dc867652fc5b0174a578401884580c3aa4b848f4cece2a
4
- data.tar.gz: 86b054738cb15afa9d0f2eaa8a01d1fa8977571159763e2ada75a8188f6bd56c
3
+ metadata.gz: af5c6f3d415b4962004c31a94d60810dd062da12331bedb126ee73f6720b795a
4
+ data.tar.gz: e29f3afbd4649ebbef1e58cd1c5326476cb35bcf0d7ea6f815596aa8514d176f
5
5
  SHA512:
6
- metadata.gz: 9af5049b460d91c47a8e882ef6d935725fabb2805a273ea841ea51f801fef311a6b723bedd6d443929bc8b375b47e683972153aba522dab28eea221d2e560b75
7
- data.tar.gz: 03776c7931ac6a0e021c8f35b33680ee41747fc54b64569b24dfba24613424201f5b0e5864d056d92e59c8af37f320961ecec02d3c119867ef6e4b4e6b6ce22a
6
+ metadata.gz: '068a5ab925a35b81a03961416d61e56d5221423d4287bdffd7d4b5e7fe437d717cf624827d6e60ff7efdf24d60cb7f70a7fc2180ecb669ba77f0adcb3432393e'
7
+ data.tar.gz: 521dd6ffbf1ed5c3b4b414c96c34b9db2222d28aaef87c70fedaa0ca2c9dac004645198981aef745d5fb6647eb70d7d7a694936b0b0a6e32d947e11bf60f3bf4
@@ -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
@@ -153,11 +153,7 @@ hash = YAML.load_file 'spec/fixtures/ieee_528_2019.yaml'
153
153
  => {"id"=>"528-2019", "title"=>{
154
154
  ...
155
155
 
156
- bib_hash = RelatonIeee::HashConverter.hash_to_bib hash
157
- => {:id=>"528-2019", :title=>[{
158
- ...
159
-
160
- RelatonIeee::IeeeBibliographicItem.new bib_hash
156
+ RelatonIeee::IeeeBibliographicItem.from_hash hash
161
157
  => #<RelatonIeee::IeeeBibliographicItem:0x007fce940b3eb0
162
158
  ...
163
159
  ----
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">
@@ -15,14 +15,14 @@ module RelatonIeee
15
15
  # @param item_hash [Hash]
16
16
  # @return [RelatonIeee::IeeeBibliographicItem]
17
17
  def bib_item(item_hash)
18
- IeeeBibliographicItem.new item_hash
18
+ IeeeBibliographicItem.new **item_hash
19
19
  end
20
20
 
21
21
  # @param hash [Hash]
22
22
  def committee_hash_to_bib(hash)
23
23
  return unless hash[:committee]
24
24
 
25
- hash[:committee] = hash[:committee].map { |c| Committee.new c }
25
+ hash[:committee] = hash[:committee].map { |c| Committee.new **c }
26
26
  end
27
27
  end
28
28
  end
@@ -15,7 +15,7 @@ module RelatonIeee
15
15
  # @param opts [Hash]
16
16
  def initialize(ref) # rubocop:disable Metrics/MethodLength
17
17
  super
18
- code = ref.sub /^IEEE\s/, ""
18
+ code = ref.sub /^IEEE\s(Std\s)?/, ""
19
19
  search = CGI.escape({ data: { searchTerm: code } }.to_json)
20
20
  url = "#{DOMAIN}/bin/standards/search?data=#{search}"
21
21
  resp = Faraday.get url
@@ -9,6 +9,13 @@ module RelatonIeee
9
9
  super
10
10
  end
11
11
 
12
+ # @param hash [Hash]
13
+ # @return [RelatonIeee::IeeeBibliographicItem]
14
+ def self.from_hash(hash)
15
+ item_hash = ::RelatonIeee::HashConverter.hash_to_bib(hash)
16
+ new **item_hash
17
+ end
18
+
12
19
  # @param opts [Hash]
13
20
  # @option opts [Nokogiri::XML::Builder] :builder XML builder
14
21
  # @option opts [Boolean] :bibdata
@@ -28,8 +28,7 @@ module RelatonIeee
28
28
  # @param hash [Hash]
29
29
  # @return [RelatonIeee::IeeeBibliographicItem]
30
30
  def hash_to_bib(hash)
31
- item_hash = ::RelatonIeee::HashConverter.hash_to_bib(hash)
32
- ::RelatonIeee::IeeeBibliographicItem.new item_hash
31
+ ::RelatonIeee::IeeeBibliographicItem.new hash
33
32
  end
34
33
 
35
34
  # Returns hash of XML grammar
@@ -1,3 +1,3 @@
1
1
  module RelatonIeee
2
- VERSION = "1.6.0".freeze
2
+ VERSION = "1.7.4".freeze
3
3
  end
@@ -22,7 +22,7 @@ module RelatonIeee
22
22
  # @param item_hash [Hash]
23
23
  # @return [RelatonIeee::IeeeBibliographicItem]
24
24
  def bib_item(item_hash)
25
- IeeeBibliographicItem.new item_hash
25
+ IeeeBibliographicItem.new **item_hash
26
26
  end
27
27
  end
28
28
  end
data/relaton_ieee.gemspec CHANGED
@@ -31,17 +31,17 @@ Gem::Specification.new do |spec|
31
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
32
  spec.require_paths = ["lib"]
33
33
 
34
- spec.add_development_dependency "debase"
34
+ # spec.add_development_dependency "debase"
35
35
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
36
36
  spec.add_development_dependency "pry-byebug"
37
37
  spec.add_development_dependency "rake", "~> 10.0"
38
38
  # spec.add_development_dependency "rspec", "~> 3.0"
39
- spec.add_development_dependency "ruby-debug-ide"
39
+ # spec.add_development_dependency "ruby-debug-ide"
40
40
  # spec.add_development_dependency "ruby-jing"
41
41
  spec.add_development_dependency "simplecov"
42
42
  spec.add_development_dependency "vcr"
43
43
  spec.add_development_dependency "webmock"
44
44
 
45
- spec.add_dependency "faraday", "~> 1.0.0"
46
- spec.add_dependency "relaton-bib", "~> 1.6.0"
45
+ spec.add_dependency "faraday", "~> 1.1"
46
+ spec.add_dependency "relaton-bib", "~> 1.7.0"
47
47
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ieee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-13 00:00:00.000000000 Z
11
+ date: 2021-03-20 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
@@ -66,20 +52,6 @@ dependencies:
66
52
  - - "~>"
67
53
  - !ruby/object:Gem::Version
68
54
  version: '10.0'
69
- - !ruby/object:Gem::Dependency
70
- name: ruby-debug-ide
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
55
  - !ruby/object:Gem::Dependency
84
56
  name: simplecov
85
57
  requirement: !ruby/object:Gem::Requirement
@@ -128,28 +100,28 @@ dependencies:
128
100
  requirements:
129
101
  - - "~>"
130
102
  - !ruby/object:Gem::Version
131
- version: 1.0.0
103
+ version: '1.1'
132
104
  type: :runtime
133
105
  prerelease: false
134
106
  version_requirements: !ruby/object:Gem::Requirement
135
107
  requirements:
136
108
  - - "~>"
137
109
  - !ruby/object:Gem::Version
138
- version: 1.0.0
110
+ version: '1.1'
139
111
  - !ruby/object:Gem::Dependency
140
112
  name: relaton-bib
141
113
  requirement: !ruby/object:Gem::Requirement
142
114
  requirements:
143
115
  - - "~>"
144
116
  - !ruby/object:Gem::Version
145
- version: 1.6.0
117
+ version: 1.7.0
146
118
  type: :runtime
147
119
  prerelease: false
148
120
  version_requirements: !ruby/object:Gem::Requirement
149
121
  requirements:
150
122
  - - "~>"
151
123
  - !ruby/object:Gem::Version
152
- version: 1.6.0
124
+ version: 1.7.0
153
125
  description: 'RelatonIeee: retrieve IEEE Standards for bibliographic use using the
154
126
  IeeeBibliographicItem model'
155
127
  email:
@@ -158,9 +130,7 @@ executables: []
158
130
  extensions: []
159
131
  extra_rdoc_files: []
160
132
  files:
161
- - ".github/workflows/macos.yml"
162
- - ".github/workflows/ubuntu.yml"
163
- - ".github/workflows/windows.yml"
133
+ - ".github/workflows/rake.yml"
164
134
  - ".gitignore"
165
135
  - ".rspec"
166
136
  - ".rubocop.yml"
@@ -1,40 +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: Checkout submodules
22
- shell: bash
23
- run: |
24
- auth_header="$(git config --local --get http.https://github.com/.extraheader)"
25
- git submodule sync --recursive
26
- git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
27
- - name: Use Ruby
28
- uses: actions/setup-ruby@v1
29
- with:
30
- ruby-version: ${{ matrix.ruby }}
31
- architecture: 'x64'
32
- - name: Update gems
33
- run: |
34
- sudo gem install bundler --force
35
- ruby -v | grep 2.5 && bundle config set build.debase --with-cflags="-Wno-error=implicit-function-declaration"
36
- ruby -v | grep 2.5 && bundle config set build.ruby-debug-ide --with-cflags="-Wno-error=implicit-function-declaration"
37
- bundle install --jobs 4 --retry 3
38
- - name: Run specs
39
- run: |
40
- bundle exec rake
@@ -1,38 +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: Checkout submodules
22
- shell: bash
23
- run: |
24
- auth_header="$(git config --local --get http.https://github.com/.extraheader)"
25
- git submodule sync --recursive
26
- git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
27
- - name: Use Ruby
28
- uses: actions/setup-ruby@v1
29
- with:
30
- ruby-version: ${{ matrix.ruby }}
31
- architecture: 'x64'
32
- - name: Update gems
33
- run: |
34
- gem install bundler
35
- bundle install --jobs 4 --retry 3
36
- - name: Run specs
37
- run: |
38
- bundle exec rake
@@ -1,41 +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: Checkout submodules
22
- shell: bash
23
- run: |
24
- auth_header="$(git config --local --get http.https://github.com/.extraheader)"
25
- git submodule sync --recursive
26
- git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
27
- - name: Use Ruby
28
- uses: actions/setup-ruby@v1
29
- with:
30
- ruby-version: ${{ matrix.ruby }}
31
- architecture: 'x64'
32
- - name: Update gems
33
- shell: pwsh
34
- run: |
35
- gem install bundler
36
- bundle config --local path vendor/bundle
37
- bundle update
38
- bundle install --jobs 4 --retry 3
39
- - name: Run specs
40
- run: |
41
- bundle exec rake