relaton-iso-bib 1.5.pre → 1.7.1

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: 58423e5ad7c5cff215fc3012e90a83f4ac4aeefed297c5f37a3dd3f8afcc808c
4
- data.tar.gz: 4e274610d1a54438a2c7338d11c8b8810db5ad04f0cb65402cbd135e7d79d041
3
+ metadata.gz: 8c9c23ffe34d6c88e2c4ad97f693507a6f5a19df868c2d3dffc7f4170ed1f245
4
+ data.tar.gz: b1e42d7f8c70e44aa7c8e9ea6a9e4dab84343a6a4b98d92bb12450ab0d97b2ea
5
5
  SHA512:
6
- metadata.gz: '09df3e18a2a23625bcd273dccd2cbc4433e558615b0b377188c748083289a088a4b82a5d00ec5b3d77dd94ed136e849fa8bd3e430fb1e309db6556a8705fd3cb'
7
- data.tar.gz: b819fc016915852535ac8cf85b064dae33c267154f811b51e982547ff2db587ffcadd6955662a2371b1eb2660edb65eef34e04ffdea09594e6f5797ca4ae987b
6
+ metadata.gz: 0b66cc94883fcc30a72eb92649d48fb1145ec7536bfbcf31c5c4339cf61617e49f64102a79e64350bf656b592db6874ac655ca9042bb6227ef88126ecc215ec4
7
+ data.tar.gz: 344ceb897089bc97ba601c9ab9aa009c419a9c218ff9331a7cebd5034cebdf1d9170280fcb6afab8f1dbb15d78ea7a307ffdc303cda6750a2c99a89ce6dbf285
@@ -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
@@ -454,7 +454,7 @@ bib_hash = RelatonIsoBib::HashConverter.hash_to_bib hash
454
454
  => {:id=>"ISO/TC211",
455
455
  ...
456
456
 
457
- RelatonIsoBib::IsoBibliographicItem.new bib_hash
457
+ RelatonIsoBib::IsoBibliographicItem.new **bib_hash
458
458
  => #<RelatonIsoBib::IsoBibliographicItem:0x007fdb95ba98e8
459
459
  ...
460
460
  ----
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">
@@ -42,7 +50,6 @@
42
50
  </define>
43
51
  <define name="xref">
44
52
  <element name="xref">
45
- <!-- attribute target { xsd:IDREF }, -->
46
53
  <attribute name="target">
47
54
  <data type="string">
48
55
  <param name="pattern">\i\c*|\c+#\c+</param>
@@ -142,6 +149,11 @@
142
149
  <data type="boolean"/>
143
150
  </attribute>
144
151
  </optional>
152
+ <optional>
153
+ <attribute name="key">
154
+ <data type="boolean"/>
155
+ </attribute>
156
+ </optional>
145
157
  <oneOrMore>
146
158
  <ref name="dt"/>
147
159
  <ref name="dd"/>
@@ -864,6 +876,13 @@
864
876
  </define>
865
877
  <define name="standard-document">
866
878
  <element name="standard-document">
879
+ <attribute name="version"/>
880
+ <attribute name="type">
881
+ <choice>
882
+ <value>semantic</value>
883
+ <value>presentation</value>
884
+ </choice>
885
+ </attribute>
867
886
  <ref name="bibdata"/>
868
887
  <optional>
869
888
  <ref name="boilerplate"/>
@@ -1158,49 +1177,7 @@
1158
1177
  </define>
1159
1178
  <define name="annex">
1160
1179
  <element name="annex">
1161
- <optional>
1162
- <attribute name="id">
1163
- <data type="ID"/>
1164
- </attribute>
1165
- </optional>
1166
- <optional>
1167
- <attribute name="language"/>
1168
- </optional>
1169
- <optional>
1170
- <attribute name="script"/>
1171
- </optional>
1172
- <optional>
1173
- <attribute name="inline-header">
1174
- <data type="boolean"/>
1175
- </attribute>
1176
- </optional>
1177
- <attribute name="obligation">
1178
- <choice>
1179
- <value>normative</value>
1180
- <value>informative</value>
1181
- </choice>
1182
- </attribute>
1183
- <optional>
1184
- <ref name="section-title"/>
1185
- </optional>
1186
- <group>
1187
- <group>
1188
- <zeroOrMore>
1189
- <ref name="BasicBlock"/>
1190
- </zeroOrMore>
1191
- <zeroOrMore>
1192
- <ref name="note"/>
1193
- </zeroOrMore>
1194
- </group>
1195
- <zeroOrMore>
1196
- <choice>
1197
- <ref name="annex-subsection"/>
1198
- <ref name="terms"/>
1199
- <ref name="definitions"/>
1200
- <ref name="references"/>
1201
- </choice>
1202
- </zeroOrMore>
1203
- </group>
1180
+ <ref name="Annex-Section"/>
1204
1181
  </element>
1205
1182
  </define>
1206
1183
  <define name="terms">
@@ -405,6 +405,13 @@
405
405
  -->
406
406
  <define name="iso-standard">
407
407
  <element name="iso-standard">
408
+ <attribute name="version"/>
409
+ <attribute name="type">
410
+ <choice>
411
+ <value>semantic</value>
412
+ <value>presentation</value>
413
+ </choice>
414
+ </attribute>
408
415
  <ref name="bibdata"/>
409
416
  <zeroOrMore>
410
417
  <ref name="termdocsource"/>
@@ -10,7 +10,7 @@ module RelatonIsoBib
10
10
  def self.grammar_hash
11
11
  gem_path = File.expand_path "..", __dir__
12
12
  grammars_path = File.join gem_path, "grammars", "*"
13
- grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
13
+ grammars = Dir[grammars_path].sort.map { |gp| File.read gp, encoding: "UTF-8" }.join
14
14
  Digest::MD5.hexdigest grammars
15
15
  end
16
16
  end
@@ -35,13 +35,13 @@ module RelatonIsoBib
35
35
  # @param secretariat [String, NilClass]
36
36
  def initialize(technical_committee:, **args) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/AbcSize
37
37
  @technical_committee = technical_committee.map do |tc|
38
- tc.is_a?(Hash) ? IsoSubgroup.new(tc) : tc
38
+ tc.is_a?(Hash) ? IsoSubgroup.new(**tc) : tc
39
39
  end
40
40
  @subcommittee = args.fetch(:subcommittee, []).map do |sc|
41
- sc.is_a?(Hash) ? IsoSubgroup.new(sc) : sc
41
+ sc.is_a?(Hash) ? IsoSubgroup.new(**sc) : sc
42
42
  end
43
43
  @workgroup = args.fetch(:workgroup, []).map do |wg|
44
- wg.is_a?(Hash) ? IsoSubgroup.new(wg) : wg
44
+ wg.is_a?(Hash) ? IsoSubgroup.new(**wg) : wg
45
45
  end
46
46
  @secretariat = args[:secretariat]
47
47
  end
@@ -9,7 +9,7 @@ module RelatonIsoBib
9
9
  # @param item [Hash]
10
10
  # @retirn [RelatonIsoBib::IsoBibliographicItem]
11
11
  def bib_item(item)
12
- IsoBibliographicItem.new(item)
12
+ IsoBibliographicItem.new(**item)
13
13
  end
14
14
 
15
15
  #
@@ -18,7 +18,7 @@ module RelatonIsoBib
18
18
  # @param title [Hash]
19
19
  # @return [RelatonBib::TypedTitleString]
20
20
  def typed_title_strig(title)
21
- RelatonBib::TypedTitleString.new title
21
+ RelatonBib::TypedTitleString.new **title
22
22
  end
23
23
 
24
24
  # @param ret [Hash]
@@ -45,9 +45,7 @@ module RelatonIsoBib
45
45
  def structuredidentifier_hash_to_bib(ret)
46
46
  return unless ret[:structuredidentifier]
47
47
 
48
- ret[:structuredidentifier] = RelatonIsoBib::StructuredIdentifier.new(
49
- ret[:structuredidentifier],
50
- )
48
+ ret[:structuredidentifier] = RelatonIsoBib::StructuredIdentifier.new(**ret[:structuredidentifier])
51
49
  end
52
50
  end
53
51
  end
@@ -131,20 +131,20 @@ module RelatonIsoBib
131
131
  copyright link fetched docid formattedref extent accesslocation
132
132
  classification validity doctype keyword].include? k
133
133
  end
134
- super super_args
134
+ super **super_args
135
135
 
136
136
  @type = args[:type] || "standard"
137
137
 
138
138
  if args[:editorialgroup]
139
139
  @editorialgroup = if args[:editorialgroup].is_a?(Hash)
140
- EditorialGroup.new(args[:editorialgroup])
140
+ EditorialGroup.new(**args[:editorialgroup])
141
141
  else args[:editorialgroup]
142
142
  end
143
143
  end
144
144
 
145
145
  @structuredidentifier = args[:structuredidentifier]
146
146
  # @doctype = args[:doctype] || "international-standard"
147
- @ics = args.fetch(:ics, []).map { |i| i.is_a?(Hash) ? Ics.new(i) : i }
147
+ @ics = args.fetch(:ics, []).map { |i| i.is_a?(Hash) ? Ics.new(**i) : i }
148
148
  @stagename = args[:stagename]
149
149
  @id_attribute = true
150
150
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonIsoBib
2
- VERSION = "1.5.pre".freeze
2
+ VERSION = "1.7.1".freeze
3
3
  end
@@ -24,7 +24,7 @@ module RelatonIsoBib
24
24
  # @param item_hash [Hash]
25
25
  # @return [RelatonIsoBib::IsoBibliographicItem]
26
26
  def bib_item(item_hash)
27
- IsoBibliographicItem.new item_hash
27
+ IsoBibliographicItem.new **item_hash
28
28
  end
29
29
 
30
30
  # @param ext [Nokogiri::XML::Element]
@@ -26,15 +26,15 @@ Gem::Specification.new do |spec|
26
26
  spec.require_paths = ["lib"]
27
27
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
28
28
 
29
- spec.add_development_dependency "debase"
29
+ # spec.add_development_dependency "debase"
30
30
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
31
31
  spec.add_development_dependency "pry-byebug"
32
32
  spec.add_development_dependency "rake", "~> 10.0"
33
33
  spec.add_development_dependency "rspec", "~> 3.0"
34
- spec.add_development_dependency "ruby-debug-ide"
34
+ # spec.add_development_dependency "ruby-debug-ide"
35
35
  spec.add_development_dependency "ruby-jing"
36
36
  spec.add_development_dependency "simplecov"
37
37
 
38
38
  spec.add_dependency "isoics", "~> 0.1.6"
39
- spec.add_dependency "relaton-bib", "~> 1.5.pre"
39
+ spec.add_dependency "relaton-bib", "~> 1.7.0"
40
40
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iso-bib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.pre
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: 2020-10-06 00:00:00.000000000 Z
11
+ date: 2021-03-17 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
@@ -142,14 +114,14 @@ dependencies:
142
114
  requirements:
143
115
  - - "~>"
144
116
  - !ruby/object:Gem::Version
145
- version: 1.5.pre
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.5.pre
124
+ version: 1.7.0
153
125
  description: 'RelatonIsoBib: Ruby ISOXMLDOC impementation.'
154
126
  email:
155
127
  - open.source@ribose.com
@@ -157,9 +129,7 @@ executables: []
157
129
  extensions: []
158
130
  extra_rdoc_files: []
159
131
  files:
160
- - ".github/workflows/macos.yml"
161
- - ".github/workflows/ubuntu.yml"
162
- - ".github/workflows/windows.yml"
132
+ - ".github/workflows/rake.yml"
163
133
  - ".gitignore"
164
134
  - ".rspec"
165
135
  - ".rubocop.yml"
@@ -199,11 +169,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
199
169
  version: 2.4.0
200
170
  required_rubygems_version: !ruby/object:Gem::Requirement
201
171
  requirements:
202
- - - ">"
172
+ - - ">="
203
173
  - !ruby/object:Gem::Version
204
- version: 1.3.1
174
+ version: '0'
205
175
  requirements: []
206
- rubygems_version: 3.0.6
176
+ rubygems_version: 3.2.3
207
177
  signing_key:
208
178
  specification_version: 4
209
179
  summary: 'RelatonIsoBib: Ruby ISOXMLDOC impementation.'
@@ -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,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