aspec_rb 0.0.9 → 0.0.10

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: d5ad7297aa73ebc76ef0ad387bc284b4217a5f5bd40f016893557adcbbd90b27
4
- data.tar.gz: 5a966be236ce43e042aff058e1f950794bbe486c557e66d3730dba7983f58d94
3
+ metadata.gz: 088352333e584fe8f6a3601c5e0d83602c070a3c07b9552277f81b0a8dd40425
4
+ data.tar.gz: cd6f49f6528e6cf1a756736d6e896a33384314e62d18bbe398bef984d6cc3418
5
5
  SHA512:
6
- metadata.gz: ee0d04929e673a3db700d26a9f23f6ffd890261009b7843fce630642ca207a1cceca1d50fb41f4f9a5594b17603f84afbd979f44a2b6a0705c7ba2f3b5367986
7
- data.tar.gz: a84bfcbb1032dbc4fdf1a5bc69963d58a65ba507356810a1d43014952e70f3b470f4c38fd717fe3f7f6e3b9c8aacbb33da8f2ddfb6fe09e54316b301ed63ecab
6
+ metadata.gz: f3230d5ce8706b6971b5603a6e575a76bb149058b2da4d2e21b72e9f39de9ed7e3523771539e07740aa84cb3ceb91cba81143790c52c365eef1065e148c6a126
7
+ data.tar.gz: 19ea0ba20ace56a88dd5f1b35dd43ad6b7b327b02d57ab3e90e9e12ab1782d0c95402269d4881391326f70139183ff3a41e7ce3e99bd3da199bee44c5fe3e305
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aspec_rb (0.0.9)
4
+ aspec_rb (0.0.10)
5
5
  asciidoctor
6
6
 
7
7
  GEM
@@ -7,5 +7,5 @@ module AspecRb
7
7
  # For this deploy config, see https://github.com/tcob/aspec_rb/blob/master/.travis.yml
8
8
  #
9
9
  # Manual release can be performed by running 'bundle install && rake release'
10
- VERSION = '0.0.9'
10
+ VERSION = '0.0.10'
11
11
  end
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'
@@ -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}(,.+?)?\>\>/, "icon:angle-double-up[] <<#{fix}>>")
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
@@ -141,7 +141,6 @@ $reqs.each do |rid, _line, path, _filename, _main, _chapter|
141
141
  end
142
142
  end
143
143
 
144
- # RexRx = /(?<=(?<!\\)&lt;&lt;)(Req-\w+-?.+?)(?=&gt;&gt;)/
145
144
  RexRx = /(?<=&lt;&lt;)(Req-\w+-?.+?)(?=&gt;&gt;)/
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
- msg = target.match(/(?<=,).+/).to_s.strip
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
- o = "<span class=\"label label-info\" #{tooltip}>"
183
- c = '</span>'
184
- (create_anchor parent, %(#{o} #{icon} #{displaytext}#{c}), type: :link, target: uri).convert
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'] = 'Requirement: '
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: #{id}:</emphasis> #{san_title} </a> (ver. #{attrs['version']})
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.9
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-24 00:00:00.000000000 Z
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