aspec_rb 0.0.9 → 0.0.10
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/aspec_rb/version.rb +1 -1
- data/lib/aspec_rb.rb +1 -0
- data/lib/extensions/autoxrefs.rb +2 -2
- data/lib/extensions/req_refs.rb +11 -15
- data/lib/extensions/requirement_block.rb +3 -2
- data/lib/extensions/source_block.rb +17 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 088352333e584fe8f6a3601c5e0d83602c070a3c07b9552277f81b0a8dd40425
|
4
|
+
data.tar.gz: cd6f49f6528e6cf1a756736d6e896a33384314e62d18bbe398bef984d6cc3418
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3230d5ce8706b6971b5603a6e575a76bb149058b2da4d2e21b72e9f39de9ed7e3523771539e07740aa84cb3ceb91cba81143790c52c365eef1065e148c6a126
|
7
|
+
data.tar.gz: 19ea0ba20ace56a88dd5f1b35dd43ad6b7b327b02d57ab3e90e9e12ab1782d0c95402269d4881391326f70139183ff3a41e7ce3e99bd3da199bee44c5fe3e305
|
data/Gemfile.lock
CHANGED
data/lib/aspec_rb/version.rb
CHANGED
data/lib/aspec_rb.rb
CHANGED
@@ -9,6 +9,7 @@ require_relative 'extensions/inline_repo_macro'
|
|
9
9
|
require_relative 'extensions/inline_task_macro'
|
10
10
|
require_relative 'extensions/req_refs'
|
11
11
|
require_relative 'extensions/requirement_block'
|
12
|
+
require_relative 'extensions/source_block'
|
12
13
|
require_relative 'extensions/todo_block'
|
13
14
|
require_relative 'html_chunker'
|
14
15
|
require 'asciidoctor-latex'
|
data/lib/extensions/autoxrefs.rb
CHANGED
@@ -167,12 +167,12 @@ Extensions.register do
|
|
167
167
|
if line[/\<\<(?!Req)(.+?)\>\>/]
|
168
168
|
anchorfixes.each do |original, fix|
|
169
169
|
next unless line[/\<\<#{original}(,.+?)?\>\>/]
|
170
|
-
line = line.sub(/\<\<#{original}(,.+?)?\>\>/, "
|
170
|
+
line = line.sub(/\<\<#{original}(,.+?)?\>\>/, "\<\<#{fix}\>\>")
|
171
171
|
end
|
172
172
|
elsif line[/^(\=+\s+?\S+.+)/]
|
173
173
|
line.delete!('`')
|
174
174
|
elsif line[/^(\.\S\w+)/]
|
175
|
-
line.delete!('\*_')
|
175
|
+
line.delete!('\*_`')
|
176
176
|
elsif line[/`.+`\s?::/]
|
177
177
|
2.times { line.sub!(/`/, '') }
|
178
178
|
end
|
data/lib/extensions/req_refs.rb
CHANGED
@@ -141,7 +141,6 @@ $reqs.each do |rid, _line, path, _filename, _main, _chapter|
|
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
|
-
# RexRx = /(?<=(?<!\\)<<)(Req-\w+-?.+?)(?=>>)/
|
145
144
|
RexRx = /(?<=<<)(Req-\w+-?.+?)(?=>>)/
|
146
145
|
|
147
146
|
# TODO: consider a more performant way of matching the requirements here
|
@@ -152,36 +151,33 @@ Extensions.register do
|
|
152
151
|
match RexRx
|
153
152
|
process do |parent, target|
|
154
153
|
id = target.sub(/^Req-/, '')
|
155
|
-
msg = ''
|
156
154
|
fix = ''
|
155
|
+
linktext = ''
|
157
156
|
|
157
|
+
# if the target contains displaytext
|
158
158
|
if target[/,/]
|
159
|
-
|
159
|
+
linktext = target.match(/(?<=,).+/).to_s.strip
|
160
160
|
id = target.sub(/^Req-/, '').sub(/,.+/, '')
|
161
|
-
icon = '<i class="fa fa-info-circle" aria-hidden="true"></i>'
|
162
161
|
end
|
163
162
|
|
164
|
-
displaytext = id
|
165
|
-
|
166
163
|
$reqfixes.each do |fixid, file|
|
167
164
|
next unless fixid == id
|
168
165
|
fix = file
|
169
166
|
break
|
170
167
|
end
|
171
168
|
|
172
|
-
tooltip = if msg != ''
|
173
|
-
"data-toggle=\"tooltip\" data-placement=\"top\" title=\"#{msg}\""
|
174
|
-
else
|
175
|
-
''
|
176
|
-
end
|
177
|
-
|
178
169
|
fix = fix.sub(/^_/, '') if fix[/^_/]
|
179
170
|
link = id.sub(/^Req-/, '')
|
180
171
|
uri = "#{fix}.html##{link}"
|
181
172
|
uri = "##{link}" if fix == ''
|
182
|
-
|
183
|
-
|
184
|
-
|
173
|
+
|
174
|
+
final_link = if linktext != ''
|
175
|
+
linktext
|
176
|
+
else
|
177
|
+
"<span class=\"label label-info\">#{id}</span>"
|
178
|
+
end
|
179
|
+
|
180
|
+
(create_anchor parent, final_link, type: :link, target: uri).convert
|
185
181
|
end
|
186
182
|
end
|
187
183
|
end
|
@@ -14,7 +14,8 @@ Extensions.register do
|
|
14
14
|
# Add pass characters here to prevent html character replacements for < > tags
|
15
15
|
pass = '++++'
|
16
16
|
attrs['name'] = 'requirement'
|
17
|
-
attrs['caption'] = '
|
17
|
+
attrs['caption'] = ''
|
18
|
+
attrs['title'] = ''
|
18
19
|
id = attrs['id']
|
19
20
|
nl = ''
|
20
21
|
|
@@ -35,7 +36,7 @@ Extensions.register do
|
|
35
36
|
<div class=\"panel-heading\">
|
36
37
|
<h3 class=\"panel-title\" data-toc-skip>
|
37
38
|
<a class=\"anchor\" href=\"##{id}\"></a>
|
38
|
-
<a class=\"link\" href=\"##{id}\"><emphasis role=\"strong\">Requirement
|
39
|
+
<a class=\"link\" href=\"##{id}\"><emphasis role=\"strong\">Requirement #{id}:</emphasis> #{san_title} </a> (ver. #{attrs['version']})
|
39
40
|
</h3>
|
40
41
|
</div>
|
41
42
|
<div class=\"panel-body\">)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
|
4
|
+
|
5
|
+
Extensions.register do
|
6
|
+
treeprocessor do
|
7
|
+
process do |document|
|
8
|
+
document.find_by context: :listing, style: 'source' do |src|
|
9
|
+
src.lines.each do |li|
|
10
|
+
li.gsub!(/\<\</, '«
')
|
11
|
+
li.gsub!(/\>\>/, '»
')
|
12
|
+
end
|
13
|
+
src
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aspec_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tcob
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -102,6 +102,7 @@ files:
|
|
102
102
|
- lib/extensions/req_refs.rb
|
103
103
|
- lib/extensions/requirement_appendix.rb
|
104
104
|
- lib/extensions/requirement_block.rb
|
105
|
+
- lib/extensions/source_block.rb
|
105
106
|
- lib/extensions/todo_block.rb
|
106
107
|
- lib/extensions/utils/block.rb
|
107
108
|
- lib/extensions/utils/index.rb
|