metanorma-ietf 2.0.6 → 2.0.7

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: ea7691960ebd06212c10a16ef04f39a86d44312c496fd190e03ead96dac484c7
4
- data.tar.gz: 44f0aeaa5ad12410d58660afdcd4b4c17d63b3bc8d26bd420a0adc275c05a648
3
+ metadata.gz: bb5f196390262aef0aec189526c2caf497e529e5ffbbbcc22a205ba43a85d85c
4
+ data.tar.gz: 37ec8453f4ef211f479e7553bd9cb6481f5f50f872793bb571f184654b299051
5
5
  SHA512:
6
- metadata.gz: 7e618fbc5f61ddc1419ed6a48c59a9aa03694dcd7e09e77fe79b8f8f08f37bf6c7ffde6656d1b3d6dbcd934aa80c5cf6754df234dd55577ae28ea2eea22c1991
7
- data.tar.gz: 8fa3bb4b08545037774b2080c541d60df663b79f3c7c58b33fd1df91049f5f11af1732846a1185ce856ee0ef6d2a0888720ca50b84041d865f145a039d98debd
6
+ metadata.gz: 39f727292be5e328f32369cdfd9212037beab415e017f95f66b3dbbd3ae5a060f5594fb49341d317dd6463fca4f33df65535358da0ee12fbaf7e297c50ef1eb2
7
+ data.tar.gz: 587c593828181e860d7041d88f43bd6c7a48f09c2f7a70049f464a661480fb4f91c103706b1bb2fe5db882c23db66bf9ae2757ae441e0c449dcada0893e4d874
@@ -1,12 +1,11 @@
1
- # Auto-generated !!! Do not edit it manually
2
- # use ci-master https://github.com/metanorma/metanorma-build-scripts
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
3
  name: macos
4
4
 
5
5
  on:
6
6
  push:
7
7
  branches: [ master ]
8
8
  pull_request:
9
- branches: [ '**' ]
10
9
 
11
10
  jobs:
12
11
  test-macos:
@@ -18,6 +17,13 @@ jobs:
18
17
  ruby: [ '2.6', '2.5', '2.4' ]
19
18
  steps:
20
19
  - uses: actions/checkout@master
20
+ - name: Cache xml2rfc
21
+ id: cache-xml2rfc
22
+ uses: actions/cache@v1
23
+ with:
24
+ path: ~/.cache/xml2rfc
25
+ key: xml2rfc
26
+ restore-key: xml2rfc
21
27
  - name: Use Ruby
22
28
  uses: actions/setup-ruby@v1
23
29
  with:
@@ -38,3 +44,4 @@ jobs:
38
44
  - name: Run specs
39
45
  run: |
40
46
  bundle exec rake
47
+
@@ -1,12 +1,11 @@
1
- # Auto-generated !!! Do not edit it manually
2
- # use ci-master https://github.com/metanorma/metanorma-build-scripts
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
3
  name: ubuntu
4
4
 
5
5
  on:
6
6
  push:
7
7
  branches: [ master ]
8
8
  pull_request:
9
- branches: [ '**' ]
10
9
 
11
10
  jobs:
12
11
  test-linux:
@@ -18,6 +17,13 @@ jobs:
18
17
  ruby: [ '2.6', '2.5', '2.4' ]
19
18
  steps:
20
19
  - uses: actions/checkout@master
20
+ - name: Cache xml2rfc
21
+ id: cache-xml2rfc
22
+ uses: actions/cache@v1
23
+ with:
24
+ path: ~/.cache/xml2rfc
25
+ key: xml2rfc
26
+ restore-key: xml2rfc
21
27
  - name: Use Ruby
22
28
  uses: actions/setup-ruby@v1
23
29
  with:
@@ -25,7 +31,7 @@ jobs:
25
31
  architecture: 'x64'
26
32
  - name: Update gems
27
33
  run: |
28
- gem install bundler
34
+ gem install bundler
29
35
  bundle install --jobs 4 --retry 3
30
36
  - name: Use Python
31
37
  uses: actions/setup-python@v1
@@ -1,12 +1,11 @@
1
- # Auto-generated !!! Do not edit it manually
2
- # use ci-master https://github.com/metanorma/metanorma-build-scripts
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
3
  name: windows
4
4
 
5
5
  on:
6
6
  push:
7
7
  branches: [ master ]
8
8
  pull_request:
9
- branches: [ '**' ]
10
9
 
11
10
  jobs:
12
11
  test-windows:
@@ -18,6 +17,13 @@ jobs:
18
17
  ruby: [ '2.6', '2.5', '2.4' ]
19
18
  steps:
20
19
  - uses: actions/checkout@master
20
+ - name: Cache xml2rfc
21
+ id: cache-xml2rfc
22
+ uses: actions/cache@v1
23
+ with:
24
+ path: ~/.cache/xml2rfc
25
+ key: xml2rfc
26
+ restore-key: xml2rfc
21
27
  - name: Use Ruby
22
28
  uses: actions/setup-ruby@v1
23
29
  with:
@@ -26,18 +32,16 @@ jobs:
26
32
  - name: Update gems
27
33
  shell: pwsh
28
34
  run: |
29
- gem install bundler
30
- bundle config --local path vendor/bundle
31
- bundle update
35
+ gem install bundler
32
36
  bundle install --jobs 4 --retry 3
33
37
  - name: Use Python
34
38
  uses: actions/setup-python@v1
35
39
  with:
36
- python-version: '2.7'
40
+ ruby-version: '2.7'
37
41
  architecture: 'x64'
38
42
  - name: Install xml2rfc
39
43
  run: |
40
44
  pip install xml2rfc
41
45
  - name: Run specs
42
46
  run: |
43
- bundle exec rake
47
+ bundle exec rake
data/README.adoc CHANGED
@@ -6,8 +6,9 @@
6
6
  "`http://asciidoctor.org/[asciidoctor]-way`".
7
7
 
8
8
  image:https://img.shields.io/gem/v/metanorma-ietf.svg["Gem Version", link="https://rubygems.org/gems/metanorma-ietf"]
9
- image:https://travis-ci.com/metanorma/metanorma-ietf.svg["Build Status", link="https://travis-ci.com/metanorma/metanorma-ietf"]
10
- image:https://ci.appveyor.com/api/projects/status/or6b0wx4b0q3qm0m?svg=true["Appveyor Build Status", link="https://ci.appveyor.com/project/metanorma/metanorma-ietf"]
9
+ image:https://github.com/metanorma/metanorma-ietf/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/metanorma/metanorma-ietf/actions?workflow=macos"]
10
+ image:https://github.com/metanorma/metanorma-ietf/workflows/ubuntu/badge.svg["Build Status (ubuntu)", link="https://github.com/metanorma/metanorma-ietf/actions?workflow=ubuntu"]
11
+ image:https://github.com/metanorma/metanorma-ietf/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/metanorma/metanorma-ietf/actions?workflow=windows"]
11
12
  image:https://codeclimate.com/github/metanorma/metanorma-ietf/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-ietf"]
12
13
  image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-ietf.svg["Pull Requests", link="https://github.com/metanorma/metanorma-ietf/pulls"]
13
14
  image:https://img.shields.io/github/commits-since/metanorma/metanorma-ietf/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-ietf/releases"]
@@ -703,21 +703,11 @@
703
703
  </define>
704
704
  <define name="TypedTitleString">
705
705
  <optional>
706
- <attribute name="type">
707
- <ref name="TitleType"/>
708
- </attribute>
706
+ <attribute name="type"/>
709
707
  </optional>
710
708
  <ref name="FormattedString"/>
711
709
  </define>
712
- <define name="TitleType">
713
- <choice>
714
- <value>alternative</value>
715
- <value>original</value>
716
- <value>unofficial</value>
717
- <value>subtitle</value>
718
- <value>main</value>
719
- </choice>
720
- </define>
710
+ <!-- TitleType = ( "alternative" | "original" | "unofficial" | "subtitle" | "main" ) -->
721
711
  <define name="TypedUri">
722
712
  <optional>
723
713
  <attribute name="type"/>
@@ -35,7 +35,7 @@ module Asciidoctor
35
35
  File.open(filename, "w") { |f| f.write(ret) }
36
36
  rfc_converter(node).convert filename unless node.attr("nodoc")
37
37
  end
38
- @log.write(@filename + ".err") unless @novalid
38
+ @log.write(@localdir + @filename + ".err") unless @novalid
39
39
  @files_to_delete.each { |f| FileUtils.rm f }
40
40
  ret
41
41
  end
@@ -101,9 +101,7 @@
101
101
  <ref name="structuredidentifier"/>
102
102
  </zeroOrMore>
103
103
  </define>
104
- <define name="TitleType">
105
- <text/>
106
- </define>
104
+ <!-- TitleType = text -->
107
105
  <define name="sections">
108
106
  <element name="sections">
109
107
  <oneOrMore>
@@ -56,5 +56,10 @@ module IsoDoc::Ietf
56
56
  File.open("#{filename}.rfc.xml", "w:UTF-8") { |f| f.write(result) }
57
57
  @files_to_delete.each { |f| FileUtils.rm_rf f }
58
58
  end
59
+
60
+ def init_file(filename, debug)
61
+ filename = filename.sub(/\.rfc\.xml$/, ".rfc")
62
+ super
63
+ end
59
64
  end
60
65
  end
@@ -47,22 +47,38 @@ module Metanorma
47
47
  nil
48
48
  end
49
49
 
50
+ def xml2rfc_present?
51
+ !which("xml2rfc").nil?
52
+ end
53
+
50
54
  def output(isodoc_node, outname, format, options={})
51
55
  case format
52
56
  when :rfc
53
- IsoDoc::Ietf::RfcConvert.new(options).convert(outname.sub(/\.xml/, ""), isodoc_node)
57
+ IsoDoc::Ietf::RfcConvert.new(options).convert(outname, isodoc_node)
54
58
  @done_rfc = true
55
59
 
56
- when :txt, :html
57
- rfcname = outname.sub(/\.(html|txt)$/, ".rfc.xml")
60
+ when :txt
61
+ unless xml2rfc_present?
62
+ warn "[metanorma-ietf] Error: unable to generate #{format}, the command `xml2rfc` is not found in path."
63
+ return
64
+ end
65
+
66
+ rfcname = outname.sub(/\.txt$/, ".rfc.xml")
58
67
  output(isodoc_node, outname, :rfc, options) unless @done_rfc
59
- unless which("xml2rfc")
68
+
69
+ system("xml2rfc --text #{rfcname} -o #{outname}")
70
+
71
+ when :html
72
+ unless xml2rfc_present?
60
73
  warn "[metanorma-ietf] Error: unable to generate #{format}, the command `xml2rfc` is not found in path."
61
74
  return
62
75
  end
63
- # In xml2rfc, --text and --html are used
64
- format = :text if format == :txt
65
- system("xml2rfc --#{format} #{rfcname} -o #{outname}")
76
+
77
+ rfcname = outname.sub(/\.html$/, ".rfc.xml")
78
+ output(isodoc_node, outname, :rfc, options) unless @done_rfc
79
+
80
+ system("xml2rfc --html #{rfcname} -o #{outname}")
81
+
66
82
  else
67
83
  super
68
84
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "2.0.6".freeze
3
+ VERSION = "2.0.7".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ietf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.0.7
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-03-20 00:00:00.000000000 Z
11
+ date: 2020-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc