metanorma-iec 1.2.1 → 1.2.7

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +44 -0
  3. data/lib/asciidoctor/iec/basicdoc.rng +23 -0
  4. data/lib/asciidoctor/iec/converter.rb +1 -0
  5. data/lib/asciidoctor/iec/front.rb +9 -7
  6. data/lib/asciidoctor/iec/iec.rng +7 -0
  7. data/lib/asciidoctor/iec/isodoc.rng +125 -58
  8. data/lib/asciidoctor/iec/isostandard.rng +8 -1
  9. data/lib/isodoc/iec/base_convert.rb +0 -20
  10. data/lib/isodoc/iec/html/htmlstyle.css +5 -1
  11. data/lib/isodoc/iec/html/isodoc.css +16 -4
  12. data/lib/isodoc/iec/html/isodoc.scss +19 -4
  13. data/lib/isodoc/iec/html/wordstyle.css +10 -10
  14. data/lib/isodoc/iec/html/wordstyle.scss +15 -10
  15. data/lib/isodoc/iec/iec.international-standard.xsl +1279 -391
  16. data/lib/metanorma/iec/version.rb +1 -1
  17. data/metanorma-iec.gemspec +1 -1
  18. data/spec/asciidoctor-iec/base_spec.rb +14 -5
  19. data/spec/asciidoctor-iec/cleanup_spec.rb +30 -6
  20. data/spec/asciidoctor-iec/iev_spec.rb +3 -3
  21. data/spec/asciidoctor-iec/inline_spec.rb +7 -1
  22. data/spec/asciidoctor-iec/validate_spec.rb +21 -1
  23. data/spec/assets/xref_error.adoc +7 -0
  24. data/spec/isodoc/blocks_spec.rb +1 -1
  25. data/spec/isodoc/i18n_spec.rb +9 -9
  26. data/spec/isodoc/iev_spec.rb +13 -17
  27. data/spec/isodoc/inline_spec.rb +1 -1
  28. data/spec/isodoc/metadata_spec.rb +36 -23
  29. data/spec/isodoc/ref_spec.rb +15 -15
  30. data/spec/isodoc/section_spec.rb +2 -2
  31. data/spec/isodoc/terms_spec.rb +1 -1
  32. data/spec/spec_helper.rb +5 -1
  33. metadata +6 -7
  34. data/.github/workflows/macos.yml +0 -38
  35. data/.github/workflows/ubuntu.yml +0 -56
  36. data/.github/workflows/windows.yml +0 -40
@@ -126,9 +126,9 @@ RSpec.describe IsoDoc::Iec do
126
126
  INPUT
127
127
 
128
128
  presxml = <<~OUTPUT
129
- <iso-standard xmlns="http://riboseinc.com/isoxml">
129
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
130
130
  <bibdata>
131
- <language>en</language>
131
+ <language current="true">en</language>
132
132
  </bibdata>
133
133
  <preface><foreword>
134
134
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">
@@ -314,12 +314,12 @@ RSpec.describe IsoDoc::Iec do
314
314
  <br/>
315
315
  <div>
316
316
  <h1 class='Section3'>Bibliography</h1>
317
- <p id='ISBN' class='NormRef'>
318
- [1],
317
+ <p id='ISBN' class='Biblio'>
318
+ [1]&#160;
319
319
  <i>Chemicals for analytical laboratory use</i>
320
320
  </p>
321
- <p id='ISSN' class='NormRef'>
322
- [2],
321
+ <p id='ISSN' class='Biblio'>
322
+ [2]&#160;
323
323
  <i>Instruments for analytical laboratory use</i>
324
324
  </p>
325
325
  <div class='Note'>
@@ -334,12 +334,12 @@ RSpec.describe IsoDoc::Iec do
334
334
  &#160; This is another annotation of document ISSN.
335
335
  </p>
336
336
  </div>
337
- <p id='ISO3696' class='NormRef'>
338
- ISO 3696,
337
+ <p id='ISO3696' class='Biblio'>
338
+ [3]&#160; ISO 3696,
339
339
  <i>Water for analytical laboratory use</i>
340
340
  </p>
341
- <p id='ref10' class='NormRef'>
342
- [10],
341
+ <p id='ref10' class='Biblio'>
342
+ [10]&#160;
343
343
  <span style='font-variant:small-caps;'>Standard No I.C.C 167</span>
344
344
  .
345
345
  <i>
@@ -351,12 +351,12 @@ RSpec.describe IsoDoc::Iec do
351
351
  <a href='http://www.icc.or.at'>http://www.icc.or.at</a>
352
352
  )
353
353
  </p>
354
- <p id='ref11' class='NormRef'>
355
- IETF RFC 10,
354
+ <p id='ref11' class='Biblio'>
355
+ [5]&#160; IETF RFC 10,
356
356
  <i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i>
357
357
  </p>
358
- <p id='ref12' class='NormRef'>
359
- Citn, IETF RFC 20, CitationWorks. 2019.
358
+ <p id='ref12' class='Biblio'>
359
+ Citn&#160; IETF RFC 20, CitationWorks. 2019.
360
360
  <i>How to cite a reference</i>
361
361
  .
362
362
  </p>
@@ -369,7 +369,7 @@ RSpec.describe IsoDoc::Iec do
369
369
  </html>
370
370
 
371
371
  OUTPUT
372
- expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
372
+ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
373
373
  expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
374
374
  end
375
375
 
@@ -69,7 +69,7 @@ RSpec.describe IsoDoc do
69
69
  INPUT
70
70
 
71
71
  presxml = <<~OUTPUT
72
- <iso-standard xmlns="http://riboseinc.com/isoxml">
72
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
73
73
  <preface>
74
74
  <foreword obligation="informative">
75
75
  <title>Foreword</title>
@@ -327,7 +327,7 @@ OUTPUT
327
327
  </sections>
328
328
  </iso-standard>
329
329
  INPUT
330
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
330
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
331
331
  <sections>
332
332
  <clause id='D' obligation='normative'>
333
333
  <title depth='1'>
@@ -54,7 +54,7 @@ RSpec.describe IsoDoc do
54
54
  </iso-standard>
55
55
  INPUT
56
56
  presxml = <<~INPUT
57
- <iso-standard xmlns="http://riboseinc.com/isoxml">
57
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
58
58
  <sections>
59
59
  <terms id="_terms_and_definitions" obligation="normative"><title depth="1">1<tab/>Terms and definitions</title>
60
60
 
@@ -25,6 +25,10 @@ RSpec.configure do |config|
25
25
  end
26
26
  end
27
27
 
28
+ def metadata(x)
29
+ Hash[x.sort].delete_if{ |k, v| v.nil? || v.respond_to?(:empty?) && v.empty? }
30
+ end
31
+
28
32
  def strip_guid(x)
29
33
  x.gsub(%r{ id="_[^"]+"}, ' id="_"').gsub(%r{ target="_[^"]+"}, ' target="_"')
30
34
  end
@@ -141,7 +145,7 @@ UNPUBLISHED_BOILERPLATE = BOILERPLATE.sub(/<\/boilerplate>/, "#{BOILERPLATE_LICE
141
145
 
142
146
  BLANK_HDR = <<~"HDR"
143
147
  <?xml version="1.0" encoding="UTF-8"?>
144
- <iec-standard xmlns="https://www.metanorma.org/ns/iec">
148
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
145
149
  <bibdata type="standard">
146
150
  <contributor>
147
151
  <role type="author"/>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.7
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-07-29 00:00:00.000000000 Z
11
+ date: 2020-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-jing
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.5.0
47
+ version: 1.5.10
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.5.0
54
+ version: 1.5.10
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: byebug
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -216,9 +216,7 @@ executables: []
216
216
  extensions: []
217
217
  extra_rdoc_files: []
218
218
  files:
219
- - ".github/workflows/macos.yml"
220
- - ".github/workflows/ubuntu.yml"
221
- - ".github/workflows/windows.yml"
219
+ - ".github/workflows/rake.yml"
222
220
  - ".gitignore"
223
221
  - ".hound.yml"
224
222
  - ".rubocop.yml"
@@ -282,6 +280,7 @@ files:
282
280
  - spec/assets/rice_image1.png
283
281
  - spec/assets/word.css
284
282
  - spec/assets/wordintro.html
283
+ - spec/assets/xref_error.adoc
285
284
  - spec/examples/rice.adoc
286
285
  - spec/examples/rice.doc
287
286
  - spec/examples/rice.html
@@ -1,38 +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
- paths-ignore:
10
- - .github/workflows/ubuntu.yml
11
- - .github/workflows/windows.yml
12
-
13
- jobs:
14
- test-macos:
15
- name: Test on Ruby ${{ matrix.ruby }} macOS
16
- runs-on: macos-latest
17
- continue-on-error: ${{ matrix.experimental }}
18
- strategy:
19
- fail-fast: false
20
- matrix:
21
- ruby: [ '2.6', '2.5', '2.4' ]
22
- experimental: [false]
23
- include:
24
- - ruby: '2.7'
25
- experimental: true
26
- steps:
27
- - uses: actions/checkout@master
28
- - name: Use Ruby
29
- uses: actions/setup-ruby@v1
30
- with:
31
- ruby-version: ${{ matrix.ruby }}
32
- - name: Update gems
33
- run: |
34
- sudo gem install bundler --force
35
- bundle install --jobs 4 --retry 3
36
- - name: Run specs
37
- run: |
38
- bundle exec rake
@@ -1,56 +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
- tags:
9
- - '*'
10
- pull_request:
11
- paths-ignore:
12
- - .github/workflows/macos.yml
13
- - .github/workflows/windows.yml
14
-
15
- jobs:
16
- test-linux:
17
- name: Test on Ruby ${{ matrix.ruby }} Ubuntu
18
- runs-on: ubuntu-latest
19
- continue-on-error: ${{ matrix.experimental }}
20
- strategy:
21
- fail-fast: false
22
- matrix:
23
- ruby: [ '2.6', '2.5', '2.4' ]
24
- experimental: [false]
25
- include:
26
- - ruby: '2.7'
27
- experimental: true
28
- steps:
29
- - uses: actions/checkout@master
30
- - name: Use Ruby
31
- uses: actions/setup-ruby@v1
32
- with:
33
- ruby-version: ${{ matrix.ruby }}
34
- - name: Update gems
35
- run: |
36
- gem install bundler
37
- bundle install --jobs 4 --retry 3
38
- - name: Run specs
39
- run: |
40
- bundle exec rake
41
- - name: Trigger repositories
42
- if: matrix.ruby == '2.6'
43
- env:
44
- GH_USERNAME: metanorma-ci
45
- GH_ACCESS_TOKEN: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
46
- run: |
47
- curl -LO --retry 3 https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/trigger-gh-actions.sh
48
- [[ -f ".github/workflows/dependent_repos.env" ]] && source .github/workflows/dependent_repos.env
49
- CLIENT_PAYLOAD=$(cat <<EOF
50
- "{ "ref": "${GITHUB_REF}", "repo": "${GITHUB_REPOSITORY}" }"
51
- EOF
52
- )
53
- for repo in $REPOS
54
- do
55
- sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY "$CLIENT_PAYLOAD"
56
- done
@@ -1,40 +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
- paths-ignore:
10
- - .github/workflows/macos.yml
11
- - .github/workflows/ubuntu.yml
12
-
13
- jobs:
14
- test-windows:
15
- name: Test on Ruby ${{ matrix.ruby }} Windows
16
- runs-on: windows-latest
17
- continue-on-error: ${{ matrix.experimental }}
18
- strategy:
19
- fail-fast: false
20
- matrix:
21
- ruby: [ '2.6', '2.5', '2.4' ]
22
- experimental: [false]
23
- include:
24
- - ruby: '2.7'
25
- experimental: true
26
- steps:
27
- - uses: actions/checkout@master
28
- - name: Use Ruby
29
- uses: actions/setup-ruby@v1
30
- with:
31
- ruby-version: ${{ matrix.ruby }}
32
- - name: Update gems
33
- shell: pwsh
34
- run: |
35
- gem install bundler
36
- bundle config --local path vendor/bundle
37
- bundle install --jobs 4 --retry 3
38
- - name: Run specs
39
- run: |
40
- bundle exec rake