metanorma-ietf 2.2.3 → 2.2.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: a672cb965e33f37303d7053c81f86be083a5b1c43ec5144ccc430920e7d29512
4
- data.tar.gz: c127be595fc086aa3f00620dfe0583bbcf1416bad56987a25e0a409b32305848
3
+ metadata.gz: f06324c3b9c916155d7de089ca675e524498efdcd6c07ff824f94b57ab6964c6
4
+ data.tar.gz: 51bfdd81d038f103e94bc9d5be4f6954d6bc6fbc691972f4b7f3001cd7ca9a2d
5
5
  SHA512:
6
- metadata.gz: 1b403ed5675f6bda04b6908c8c9907bfe9e495f3bea974eebd0a65105ffc9384ba735ea8ceff883f4e261056e2772c232ccf2b94b734d3051ec3dc9f407a257f
7
- data.tar.gz: eb7ee9cd557bda127f8127bd10014d7d1e1f58aff032acea3105764950d014a2db0137d0a77de8172635803fc33d751e4c5b50f1d9c481d138af95861582a6d9
6
+ metadata.gz: 45fc197eeaeb201677a069bd7ce3037a8d0bb28aacb49678a723bf7628cde25792aca668ddcff291f5932194f906e4bcbe12af342891da9ec5e36963c0cde2e6
7
+ data.tar.gz: a1752e87e7185ef20c56f58b1d1f568617bfecab5c7295a48e67b22d27afd5eb9b9de470edb0b712423991803887a714a834111af0ba03f1fabc62a6219e8c7c
@@ -0,0 +1,92 @@
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 ]
8
+ pull_request:
9
+
10
+ jobs:
11
+ rake:
12
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
13
+ runs-on: ${{ matrix.os }}
14
+ continue-on-error: ${{ matrix.experimental }}
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ ruby: [ '2.6', '2.5', '2.4' ]
19
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
20
+ experimental: [ false ]
21
+ include:
22
+ - ruby: '2.7'
23
+ os: 'ubuntu-latest'
24
+ experimental: true
25
+ - ruby: '2.7'
26
+ os: 'windows-latest'
27
+ experimental: true
28
+ - ruby: '2.7'
29
+ os: 'macos-latest'
30
+ experimental: true
31
+
32
+ steps:
33
+ - uses: actions/checkout@master
34
+ - name: Cache xml2rfc
35
+ id: cache-xml2rfc
36
+ uses: actions/cache@v1
37
+ with:
38
+ path: ~/.cache/xml2rfc
39
+ key: xml2rfc
40
+ restore-key: xml2rfc
41
+
42
+ - name: Use Ruby
43
+ uses: ruby/setup-ruby@v1
44
+ with:
45
+ ruby-version: ${{ matrix.ruby }}
46
+ bundler-cache: true
47
+
48
+ - name: Update gems
49
+ run: |
50
+ bundle install --jobs 4 --retry 3
51
+
52
+ - name: Use Python
53
+ uses: actions/setup-python@v1
54
+ with:
55
+ python-version: '3.6'
56
+ architecture: 'x64'
57
+
58
+ - name: set PIP_DOWNLOAD_CACHE
59
+ shell: python
60
+ run: |
61
+ import platform
62
+ from os.path import expanduser
63
+
64
+ home = expanduser("~")
65
+ cache_path = {
66
+ "Linux": f"{home}/.cache/pip",
67
+ "Darwin": f"{home}Library/Caches/pip",
68
+ "Windows": f"{home}/AppData/Local/pip/Cache"
69
+ }
70
+
71
+ print(f"::set-env name=PIP_DOWNLOAD_CACHE::{cache_path[platform.system()]}")
72
+
73
+ - uses: actions/cache@v2
74
+ with:
75
+ path: ${{ env.PIP_DOWNLOAD_CACHE }}
76
+ key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
77
+ restore-keys: ${{ runner.os }}-pip-
78
+
79
+ - name: Install xml2rfc's deps macOS
80
+ if: matrix.os == 'macos-latest'
81
+ run: brew install libmagic
82
+
83
+ - name: Install xml2rfc's deps Windows
84
+ if: matrix.os == 'windows-latest'
85
+ run: pip install python-magic-bin
86
+
87
+ - name: Install xml2rfc
88
+ run: pip install xml2rfc
89
+
90
+ - name: Run specs
91
+ run: |
92
+ bundle exec rake
@@ -114,9 +114,9 @@ module Asciidoctor
114
114
 
115
115
  def cleanup(xmldoc)
116
116
  bcp14_cleanup(xmldoc)
117
- rfc_anchor_cleanup(xmldoc)
118
117
  abstract_cleanup(xmldoc)
119
118
  super
119
+ rfc_anchor_cleanup(xmldoc)
120
120
  end
121
121
 
122
122
  BCP_KEYWORDS = ["MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
@@ -42,7 +42,6 @@
42
42
  </define>
43
43
  <define name="xref">
44
44
  <element name="xref">
45
- <!-- attribute target { xsd:IDREF }, -->
46
45
  <attribute name="target">
47
46
  <data type="string">
48
47
  <param name="pattern">\i\c*|\c+#\c+</param>
@@ -1165,49 +1164,7 @@
1165
1164
  </define>
1166
1165
  <define name="annex">
1167
1166
  <element name="annex">
1168
- <optional>
1169
- <attribute name="id">
1170
- <data type="ID"/>
1171
- </attribute>
1172
- </optional>
1173
- <optional>
1174
- <attribute name="language"/>
1175
- </optional>
1176
- <optional>
1177
- <attribute name="script"/>
1178
- </optional>
1179
- <optional>
1180
- <attribute name="inline-header">
1181
- <data type="boolean"/>
1182
- </attribute>
1183
- </optional>
1184
- <attribute name="obligation">
1185
- <choice>
1186
- <value>normative</value>
1187
- <value>informative</value>
1188
- </choice>
1189
- </attribute>
1190
- <optional>
1191
- <ref name="section-title"/>
1192
- </optional>
1193
- <group>
1194
- <group>
1195
- <zeroOrMore>
1196
- <ref name="BasicBlock"/>
1197
- </zeroOrMore>
1198
- <zeroOrMore>
1199
- <ref name="note"/>
1200
- </zeroOrMore>
1201
- </group>
1202
- <zeroOrMore>
1203
- <choice>
1204
- <ref name="annex-subsection"/>
1205
- <ref name="terms"/>
1206
- <ref name="definitions"/>
1207
- <ref name="references"/>
1208
- </choice>
1209
- </zeroOrMore>
1210
- </group>
1167
+ <ref name="Annex-Section"/>
1211
1168
  </element>
1212
1169
  </define>
1213
1170
  <define name="terms">
@@ -90,6 +90,8 @@ module IsoDoc::Ietf
90
90
  xml.at(".//*[@pn = '#{x['target']}']") or
91
91
  ret << "#{x.name} target #{x['target']} does not exist in the document"
92
92
  next unless t
93
+ x.delete("relative") if x["relative"]&.empty?
94
+ x.delete("section") if x["section"]&.empty?
93
95
  if x["format"] == "title" && t.name == "reference"
94
96
  t.at("./front/title") or
95
97
  ret << "reference #{t['anchor']} has been referenced by #{x.name} "\
@@ -133,7 +135,7 @@ module IsoDoc::Ietf
133
135
  "since it does not point to a RFC or Internet-Draft reference"
134
136
  end
135
137
  end
136
- if x["relative"]
138
+ if x["relative"]
137
139
  unless t.at(".//seriesInfo[@name = 'RFC' or @name = "\
138
140
  "'Internet-Draft']") || t["target"]
139
141
  ret << "need an explicit target= URL attribute in the reference "\
@@ -58,42 +58,31 @@ module Metanorma
58
58
  IsoDoc::Ietf::RfcConvert.new(options).convert(inname, isodoc_node, nil, outname)
59
59
  @done_rfc = true
60
60
 
61
- when :txt
61
+ when :txt, :pdf, :html
62
62
  unless xml2rfc_present?
63
63
  warn "[metanorma-ietf] Error: unable to generate #{format}, the command `xml2rfc` is not found in path."
64
64
  return
65
65
  end
66
66
 
67
67
  rfcname = inname.sub(/\.xml$/, ".rfc.xml")
68
- output(isodoc_node, inname, rfcname, :rfc, options) unless @done_rfc
69
-
70
- outname ||= inname.sub(/\.xml$/, ".txt")
71
- system("xml2rfc --text #{rfcname} -o #{outname}")
72
-
73
- when :pdf
74
- unless xml2rfc_present?
75
- warn "[metanorma-ietf] Error: unable to generate #{format}, the command `xml2rfc` is not found in path."
76
- return
68
+ unless @done_rfc && File.exist?(rfcname)
69
+ output(isodoc_node, inname, rfcname, :rfc, options)
77
70
  end
78
71
 
79
- rfcname = inname.sub(/\.xml$/, ".rfc.xml")
80
- output(isodoc_node, inname, rfcname, :rfc, options) unless @done_rfc
81
-
82
- outname ||= inname.sub(/\.xml$/, ".pdf")
83
- system("xml2rfc --pdf #{rfcname} -o #{outname}")
84
-
85
- when :html
86
- unless xml2rfc_present?
87
- warn "[metanorma-ietf] Error: unable to generate #{format}, the command `xml2rfc` is not found in path."
88
- return
72
+ outext = case format
73
+ when :txt then ".txt"
74
+ when :pdf then ".pdf"
75
+ when :html then ".html"
89
76
  end
90
77
 
91
- rfcname = inname.sub(/\.xml$/, ".rfc.xml")
92
- output(isodoc_node, inname, rfcname, :rfc, options) unless @done_rfc
93
-
94
- outname ||= inname.sub(/\.xml$/, ".html")
95
- system("xml2rfc --html #{rfcname} -o #{outname}")
78
+ outflag = case format
79
+ when :txt then "--text"
80
+ when :pdf then "--pdf"
81
+ when :html then "--html"
82
+ end
96
83
 
84
+ outname ||= inname.sub(/\.xml$/, outext)
85
+ system("xml2rfc #{outflag} #{rfcname} -o #{outname}")
97
86
  else
98
87
  super
99
88
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "2.2.3".freeze
3
+ VERSION = "2.2.4".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.2.3
4
+ version: 2.2.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-09-26 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: metanorma-standoc
@@ -223,9 +223,7 @@ executables: []
223
223
  extensions: []
224
224
  extra_rdoc_files: []
225
225
  files:
226
- - ".github/workflows/macos.yml"
227
- - ".github/workflows/ubuntu.yml"
228
- - ".github/workflows/windows.yml"
226
+ - ".github/workflows/rake.yml"
229
227
  - ".gitignore"
230
228
  - ".hound.yml"
231
229
  - ".oss-guides.rubocop.yml"
@@ -1,54 +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: Cache xml2rfc
29
- id: cache-xml2rfc
30
- uses: actions/cache@v1
31
- with:
32
- path: ~/.cache/xml2rfc
33
- key: xml2rfc
34
- restore-key: xml2rfc
35
- - name: Use Ruby
36
- uses: actions/setup-ruby@v1
37
- with:
38
- ruby-version: ${{ matrix.ruby }}
39
- - name: Update gems
40
- run: |
41
- sudo gem install bundler --force
42
- bundle install --jobs 4 --retry 3
43
- - name: Use Python
44
- uses: actions/setup-python@v1
45
- with:
46
- python-version: '3.6'
47
- architecture: 'x64'
48
- - name: Install xml2rfc
49
- run: |
50
- pip install xml2rfc
51
- - name: Run specs
52
- run: |
53
- bundle exec rake
54
-
@@ -1,52 +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
- paths-ignore:
10
- - .github/workflows/macos.yml
11
- - .github/workflows/windows.yml
12
- jobs:
13
- test-linux:
14
- name: Test on Ruby ${{ matrix.ruby }} Ubuntu
15
- runs-on: ubuntu-latest
16
- continue-on-error: ${{ matrix.experimental }}
17
- strategy:
18
- fail-fast: false
19
- matrix:
20
- ruby: [ '2.6', '2.5', '2.4' ]
21
- experimental: [false]
22
- include:
23
- - ruby: '2.7'
24
- experimental: true
25
- steps:
26
- - uses: actions/checkout@master
27
- - name: Cache xml2rfc
28
- id: cache-xml2rfc
29
- uses: actions/cache@v1
30
- with:
31
- path: ~/.cache/xml2rfc
32
- key: xml2rfc
33
- restore-key: xml2rfc
34
- - name: Use Ruby
35
- uses: actions/setup-ruby@v1
36
- with:
37
- ruby-version: ${{ matrix.ruby }}
38
- - name: Update gems
39
- run: |
40
- gem install bundler
41
- bundle install --jobs 4 --retry 3
42
- - name: Use Python
43
- uses: actions/setup-python@v1
44
- with:
45
- python-version: '3.6'
46
- architecture: 'x64'
47
- - name: Install xml2rfc
48
- run: |
49
- pip install xml2rfc
50
- - name: Run specs
51
- run: |
52
- bundle exec rake
@@ -1,54 +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: Cache xml2rfc
29
- id: cache-xml2rfc
30
- uses: actions/cache@v1
31
- with:
32
- path: ~/.cache/xml2rfc
33
- key: xml2rfc
34
- restore-key: xml2rfc
35
- - name: Use Ruby
36
- uses: actions/setup-ruby@v1
37
- with:
38
- ruby-version: ${{ matrix.ruby }}
39
- - name: Update gems
40
- shell: pwsh
41
- run: |
42
- gem install bundler
43
- bundle install --jobs 4 --retry 3
44
- - name: Use Python
45
- uses: actions/setup-python@v1
46
- with:
47
- ruby-version: '3.6'
48
- architecture: 'x64'
49
- - name: Install xml2rfc
50
- run: |
51
- pip install xml2rfc
52
- - name: Run specs
53
- run: |
54
- bundle exec rake