wortsammler 2.0.0.dev1 → 2.0.2.pre.dev3
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/.gitignore +1 -0
- data/.gitpod.Dockerfile +32 -0
- data/.gitpod.yml +1 -0
- data/README.md +2 -0
- data/lib/wortsammler/class.Traceable.md.rb +9 -7
- data/lib/wortsammler/class.Traceable.rb +74 -60
- data/lib/wortsammler/class.proolib.rb +19 -25
- data/lib/wortsammler/mdTraceParser.treetop +2 -2
- data/lib/wortsammler/version.rb +1 -1
- data/resources/default.wortsammler.latex +19 -2
- data/spec/tc_exp_003_reference.txt +9 -25
- data/spec/test_beautify.md +13 -0
- data/spec/test_beautify_reference.md +11 -0
- data/spec/wortsammler_spec.rb +131 -125
- data/testresults/wortsammler_testresults.html +37 -203
- data/wortsammler.gemspec +5 -2
- metadata +38 -10
- data/testresults/wortsammler_testresults.log +0 -108
@@ -25,12 +25,12 @@ grammar TraceInMarkdown
|
|
25
25
|
end
|
26
26
|
|
27
27
|
rule traceId
|
28
|
-
"[" payload:label "]"
|
28
|
+
("[" / "\\[") payload:label ("]" / "\\]")
|
29
29
|
end
|
30
30
|
|
31
31
|
|
32
32
|
rule label
|
33
|
-
[a-zA-Z]+ "_" [a-zA-Z]+ "_" [0-9]+
|
33
|
+
[a-zA-Z]+ ("_" / "\\_") [a-zA-Z]+ ("_" / "\\_") [0-9]+
|
34
34
|
end
|
35
35
|
|
36
36
|
rule traceHead
|
data/lib/wortsammler/version.rb
CHANGED
@@ -65,7 +65,8 @@ $if(fancy-enums)$
|
|
65
65
|
}\makeatother
|
66
66
|
\usepackage{enumerate}
|
67
67
|
$endif$
|
68
|
-
\usepackage{longtable}
|
68
|
+
\usepackage{longtable,booktabs}
|
69
|
+
\usepackage{needspace} % provides %needspace
|
69
70
|
\usepackage{float} % provides the H option for float placement
|
70
71
|
\usepackage{graphicx}
|
71
72
|
% We will generate all images so they have a width \maxwidth. This means
|
@@ -260,6 +261,22 @@ $endif$
|
|
260
261
|
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
|
261
262
|
\usepackage{makeidx}
|
262
263
|
\makeindex
|
264
|
+
|
265
|
+
%
|
266
|
+
% suppress float
|
267
|
+
%
|
268
|
+
|
269
|
+
% keep aspect ration for iamges
|
270
|
+
\floatplacement{figure}{H}
|
271
|
+
\makeatletter
|
272
|
+
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
|
273
|
+
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
|
274
|
+
\makeatother
|
275
|
+
% Scale images if necessary, so that they will not overflow the page
|
276
|
+
% margins by default, and it is still possible to overwrite the defaults
|
277
|
+
% using explicit options in \includegraphics[width, height, ...]{}
|
278
|
+
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
|
279
|
+
|
263
280
|
%
|
264
281
|
%
|
265
282
|
%\renewcommand{Befehl der Gliederungsebene z.B. \chapter}{\@startsection{Name z.B. chapter}{Ebene z.B. 0}{Einrückung z.B. 0pt}{Abstand zum vorigen Text z.B. 3.5ex plus 1ex minus 0pt\relax}{Abstand zum nachfolgenden Text z.B. 2.5ex plus 0.5ex minus 0pt\relax}{Schrift z.B. \normalfont\Large\bfseries}}
|
@@ -287,7 +304,7 @@ $endif$
|
|
287
304
|
$if(toc)$
|
288
305
|
{
|
289
306
|
\hypersetup{linkcolor=black}
|
290
|
-
\setcounter{tocdepth}{
|
307
|
+
\setcounter{tocdepth}{2}
|
291
308
|
\tableofcontents
|
292
309
|
\newpage
|
293
310
|
}
|
@@ -1,7 +1,4 @@
|
|
1
1
|
- this is headline
|
2
|
-
- this is TC_EXP_003_1
|
3
|
-
- this is md TC_EXP_003_2
|
4
|
-
- this is md TC_EXP_003_2
|
5
2
|
|
6
3
|
|
7
4
|
|
@@ -9,31 +6,21 @@ THIS IS HEADLINE
|
|
9
6
|
|
10
7
|
|
11
8
|
|
12
|
-
now verbatim by indent inclucde TC_EXP_003_1.md
|
9
|
+
now verbatim by indent inclucde TC_EXP_003_1.md## this is TC_EXP_003_1
|
13
10
|
|
14
|
-
|
15
|
-
|
16
|
-
we now include TC_EXP_003_2 from TC_EXP_003_1
|
17
|
-
|
18
|
-
## this is md TC_EXP_003_2
|
19
|
-
|
20
|
-
- hugo
|
21
|
-
|
22
|
-
- hugo2
|
23
|
-
|
24
|
-
end of TC_EXP_003_2
|
25
|
-
|
26
|
-
end of TC_EXP_003_1
|
11
|
+
we now include TC_EXP_003_2 from TC_EXP_003_1## this is md TC_EXP_003_2
|
27
12
|
|
28
|
-
|
13
|
+
- hugo
|
29
14
|
|
15
|
+
- hugo2
|
30
16
|
|
31
|
-
|
17
|
+
end of TC_EXP_003_2
|
32
18
|
|
33
|
-
|
19
|
+
end of TC_EXP_003_1
|
34
20
|
|
21
|
+
now full format inclucde TC_EXP_003_1.md## this is TC_EXP_003_1
|
35
22
|
|
36
|
-
this is md TC_EXP_003_2
|
23
|
+
we now include TC_EXP_003_2 from TC_EXP_003_1## this is md TC_EXP_003_2
|
37
24
|
|
38
25
|
- hugo
|
39
26
|
|
@@ -43,10 +30,7 @@ end of TC_EXP_003_2
|
|
43
30
|
|
44
31
|
end of TC_EXP_003_1
|
45
32
|
|
46
|
-
now full format inclucde TC_EXP_003_2.md
|
47
|
-
|
48
|
-
|
49
|
-
this is md TC_EXP_003_2
|
33
|
+
now full format inclucde TC_EXP_003_2.md## this is md TC_EXP_003_2
|
50
34
|
|
51
35
|
- hugo
|
52
36
|
|
data/spec/test_beautify.md
CHANGED
@@ -27,3 +27,16 @@ this
|
|
27
27
|
|
28
28
|
codedblock
|
29
29
|
```
|
30
|
+
|
31
|
+
|
32
|
+
**QNAP Store** **iSCSI-Name**
|
33
|
+
---------------- ------------------------ -------------------------------------------------
|
34
|
+
**KTLStore3** ktlstore3target1\_lun0 altes Replica-Volumen für KTLAZ-Host1
|
35
|
+
ktlstore3target2\_lun0 Hauptspeichervolumen (Laufwerk D auf KTLHost3)
|
36
|
+
ktlstore3excvol1 Speicher für Exchange (Laufwerk E auf KTLHost3)
|
37
|
+
ktlstore3excvol2 Speicher für Exchange (Laufwerk F auf KTLHost3)
|
38
|
+
**KTLStore4** ktlstore4target1\_lun0 1,5 TB Volume auf
|
39
|
+
ktlstore4target2\_lun0 Hauptspeichervolumen für KTLHost4 Laufwerk D
|
40
|
+
ktlstore4excvol1 Speicher für Exchange (Laufwerk E auf KTLHost4)
|
41
|
+
ktlstore4excvol2 Speicher für Exchange (Laufwerk F auf KTLHost4)
|
42
|
+
|
@@ -28,3 +28,14 @@ this
|
|
28
28
|
|
29
29
|
codedblock
|
30
30
|
~~~~
|
31
|
+
|
32
|
+
**QNAP Store** **iSCSI-Name**
|
33
|
+
---------------- ------------------------ -------------------------------------------------
|
34
|
+
**KTLStore3** ktlstore3target1\_lun0 altes Replica-Volumen für KTLAZ-Host1
|
35
|
+
ktlstore3target2\_lun0 Hauptspeichervolumen (Laufwerk D auf KTLHost3)
|
36
|
+
ktlstore3excvol1 Speicher für Exchange (Laufwerk E auf KTLHost3)
|
37
|
+
ktlstore3excvol2 Speicher für Exchange (Laufwerk F auf KTLHost3)
|
38
|
+
**KTLStore4** ktlstore4target1\_lun0 1,5 TB Volume auf
|
39
|
+
ktlstore4target2\_lun0 Hauptspeichervolumen für KTLHost4 Laufwerk D
|
40
|
+
ktlstore4excvol1 Speicher für Exchange (Laufwerk E auf KTLHost4)
|
41
|
+
ktlstore4excvol2 Speicher für Exchange (Laufwerk F auf KTLHost4)
|
data/spec/wortsammler_spec.rb
CHANGED
@@ -15,12 +15,12 @@ describe "Wortsammler generic issues" do
|
|
15
15
|
it "provides a help", :exp => false do
|
16
16
|
result = `#{wortsammler} -h`
|
17
17
|
result.should include("Usage: Wortsammler [options]")
|
18
|
-
$?.success?.should==true
|
18
|
+
$?.success?.should == true
|
19
19
|
end
|
20
20
|
|
21
21
|
it "runs silent", :exp => false do
|
22
22
|
result = `#{wortsammler}`
|
23
|
-
result.empty?.should==true
|
23
|
+
result.empty?.should == true
|
24
24
|
end
|
25
25
|
|
26
26
|
it "reports version numbers", :exp => false do
|
@@ -38,16 +38,16 @@ describe "Wortsammler generic issues" do
|
|
38
38
|
it "can create a new project folder", :exp => false do
|
39
39
|
FileUtils.rm_rf(testprojectdir)
|
40
40
|
system "#{wortsammler} -n #{testprojectdir}"
|
41
|
-
$?.success?.should==true
|
41
|
+
$?.success?.should == true
|
42
42
|
|
43
43
|
Dir["#{testprojectdir}/**/*"].should include "#{testprojectdir}/001_Main"
|
44
44
|
Dir["#{testprojectdir}/**/snippets.xlsx"].should include "#{testprojectdir}/900_snippets/snippets.xlsx"
|
45
45
|
end
|
46
46
|
|
47
47
|
it "does not initialize into an existing project folder" do
|
48
|
-
tempdir=Dir.mktmpdir
|
48
|
+
tempdir = Dir.mktmpdir
|
49
49
|
`#{wortsammler} -n #{tempdir}`
|
50
|
-
$?.success?.should==false
|
50
|
+
$?.success?.should == false
|
51
51
|
end
|
52
52
|
|
53
53
|
it "controls the pandoc options by document class" do
|
@@ -58,7 +58,7 @@ end
|
|
58
58
|
describe "Wortsammler options validator" do
|
59
59
|
it "rejects no processing" do
|
60
60
|
system "#{wortsammler} -i."
|
61
|
-
$?.success?.should==false
|
61
|
+
$?.success?.should == false
|
62
62
|
end
|
63
63
|
|
64
64
|
|
@@ -68,45 +68,45 @@ describe "Wortsammler beautifier features" do
|
|
68
68
|
|
69
69
|
|
70
70
|
it "beautifies all markdown files in a folder" do
|
71
|
-
tempdir=Dir.mktmpdir
|
72
|
-
mdtext
|
71
|
+
tempdir = Dir.mktmpdir
|
72
|
+
mdtext = "#this is headline\n\n lorem ipsum\n\nbla fasel"
|
73
73
|
|
74
|
-
cycles=10
|
74
|
+
cycles = 10
|
75
75
|
cycles.times { |i|
|
76
76
|
File.open("#{tempdir}/#{i}.md", "w") { |f| f.puts mdtext }
|
77
77
|
}
|
78
78
|
|
79
79
|
system "#{wortsammler} -bi #{tempdir}"
|
80
|
-
$?.success?.should==true
|
80
|
+
$?.success?.should == true
|
81
81
|
|
82
82
|
cycles.times { |i|
|
83
|
-
beautified_result=File.open("#{tempdir}/#{i}.md").readlines.join
|
83
|
+
beautified_result = File.open("#{tempdir}/#{i}.md").readlines.join
|
84
84
|
beautified_result.should include("# this is headline")
|
85
85
|
}
|
86
86
|
end
|
87
87
|
|
88
88
|
|
89
89
|
it "beautifies a single file", exp: false do
|
90
|
-
tempdir=Dir.mktmpdir
|
91
|
-
mdfile
|
92
|
-
mdtext
|
90
|
+
tempdir = Dir.mktmpdir
|
91
|
+
mdfile = "#{tempdir}/single.md"
|
92
|
+
mdtext = "#this is headline\n\n lorem ipsum\n\nbla fasel"
|
93
93
|
|
94
94
|
File.open(mdfile, "w") { |f| f.puts mdtext }
|
95
95
|
system "#{wortsammler} -bi #{mdfile}"
|
96
|
-
$?.success?.should==true
|
96
|
+
$?.success?.should == true
|
97
97
|
|
98
|
-
beautified_result=File.open(mdfile).readlines.join
|
98
|
+
beautified_result = File.open(mdfile).readlines.join
|
99
99
|
beautified_result.should include("# this is headline")
|
100
100
|
end
|
101
101
|
|
102
102
|
it "recognizes if the specified manifest file is a directory", exp: false do
|
103
103
|
FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") { |d|
|
104
|
-
manifest="../ZSUPP_Manifests"
|
105
|
-
cmd
|
106
|
-
r
|
107
|
-
r.include?("directory").should==true
|
104
|
+
manifest = "../ZSUPP_Manifests"
|
105
|
+
cmd = "#{wortsammler} -bm #{manifest} 2>&1"
|
106
|
+
r = `#{cmd}`
|
107
|
+
r.include?("directory").should == true
|
108
108
|
}
|
109
|
-
$?.success?.should==false
|
109
|
+
$?.success?.should == false
|
110
110
|
end
|
111
111
|
it "beautifies input files in a manifest" do
|
112
112
|
FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") { |d|
|
@@ -114,12 +114,12 @@ describe "Wortsammler beautifier features" do
|
|
114
114
|
cmd = "#{wortsammler} -bm #{manifest}"
|
115
115
|
system cmd
|
116
116
|
}
|
117
|
-
$?.success?.should==true
|
117
|
+
$?.success?.should == true
|
118
118
|
end
|
119
119
|
|
120
120
|
it "claims missing input" do
|
121
121
|
system "#{wortsammler} -b"
|
122
|
-
$?.success?.should==false
|
122
|
+
$?.success?.should == false
|
123
123
|
end
|
124
124
|
|
125
125
|
|
@@ -148,50 +148,50 @@ end
|
|
148
148
|
describe "Wortsammler conversion" do
|
149
149
|
|
150
150
|
it "converts a single file to output format" do
|
151
|
-
tempdir=Dir.mktmpdir
|
152
|
-
mdfile
|
153
|
-
mdtext
|
151
|
+
tempdir = Dir.mktmpdir
|
152
|
+
mdfile = "#{tempdir}/single.md"
|
153
|
+
mdtext = "#this is headline\n\n lorem ipsum\n\nbla fasel"
|
154
154
|
File.open(mdfile, "w") { |f| f.puts mdtext }
|
155
155
|
system "#{wortsammler} -pi #{mdfile} -o #{tempdir} -f latex:pdf:html:docx"
|
156
|
-
$?.success?.should==true
|
156
|
+
$?.success?.should == true
|
157
157
|
|
158
158
|
|
159
|
-
Dir["#{tempdir}/*"].map { |f| File.basename(f) }.should== ["single.docx",
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
159
|
+
Dir["#{tempdir}/*"].map { |f| File.basename(f) }.sort.should == ["single.docx",
|
160
|
+
"single.html",
|
161
|
+
"single.latex",
|
162
|
+
"single.log",
|
163
|
+
"single.md",
|
164
|
+
"single.pdf"
|
165
165
|
]
|
166
166
|
end
|
167
167
|
|
168
168
|
it "converts a single file to default output format" do
|
169
|
-
tempdir=Dir.mktmpdir
|
170
|
-
mdfile
|
171
|
-
mdtext
|
169
|
+
tempdir = Dir.mktmpdir
|
170
|
+
mdfile = "#{tempdir}/single.md"
|
171
|
+
mdtext = "#this is headline\n\n lorem ipsum\n\nbla fasel"
|
172
172
|
File.open(mdfile, "w") { |f| f.puts mdtext }
|
173
173
|
system "#{wortsammler} -pi #{mdfile} -o #{tempdir}"
|
174
|
-
$?.success?.should==true
|
174
|
+
$?.success?.should == true
|
175
175
|
|
176
176
|
|
177
|
-
Dir["#{tempdir}/*"].map { |f| File.basename(f) }.should== ["single.log",
|
178
|
-
|
179
|
-
|
177
|
+
Dir["#{tempdir}/*"].map { |f| File.basename(f) }.sort.should == ["single.log",
|
178
|
+
"single.md",
|
179
|
+
"single.pdf"
|
180
180
|
]
|
181
181
|
end
|
182
182
|
|
183
183
|
|
184
184
|
it "handles chapters up to 6 levels", exp: false do
|
185
|
-
tempdir="#{specdir}/../testoutput"
|
186
|
-
mdfile
|
187
|
-
mdtext
|
185
|
+
tempdir = "#{specdir}/../testoutput"
|
186
|
+
mdfile = "#{tempdir}/chapternesting.md"
|
187
|
+
mdtext = "#this is headline\n\n lorem ipsum\n\nbla fasel"
|
188
188
|
|
189
189
|
def lorem(j)
|
190
190
|
(1.upto 100).map { |i| "text_#{j} lorem ipsum #{i} dolor " }.join(" ")
|
191
191
|
end
|
192
192
|
|
193
193
|
def chapter(i, depth)
|
194
|
-
["\n\n", "##########"[1..depth], " this is example on level #{i} .. #{depth}\n\n",
|
194
|
+
["\n\n", "##########"[1 .. depth], " this is example on level #{i} .. #{depth}\n\n",
|
195
195
|
lorem(i),
|
196
196
|
].join("")
|
197
197
|
end
|
@@ -205,27 +205,27 @@ describe "Wortsammler conversion" do
|
|
205
205
|
}
|
206
206
|
|
207
207
|
system "#{wortsammler} -pbi '#{mdfile}' -o '#{tempdir}' -f pdf:latex"
|
208
|
-
$?.success?.should==true
|
208
|
+
$?.success?.should == true
|
209
209
|
|
210
|
-
Dir["#{tempdir}/chapternesting*"].map { |f| File.basename(f) }.sort.should== ["chapternesting.md",
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
210
|
+
Dir["#{tempdir}/chapternesting*"].map { |f| File.basename(f) }.sort.should == ["chapternesting.md",
|
211
|
+
"chapternesting.pdf",
|
212
|
+
"chapternesting.latex",
|
213
|
+
"chapternesting.log",
|
214
|
+
"chapternesting.md.bak"
|
215
215
|
].sort
|
216
216
|
end
|
217
217
|
|
218
218
|
it "handles lists up to 9 levels", exp: false do
|
219
|
-
tempdir="#{specdir}/../testoutput"
|
220
|
-
mdfile
|
221
|
-
mdtext
|
219
|
+
tempdir = "#{specdir}/../testoutput"
|
220
|
+
mdfile = "#{tempdir}/listnesting.md"
|
221
|
+
mdtext = "#this is headline\n\n lorem ipsum\n\nbla fasel"
|
222
222
|
|
223
223
|
def lorem(j)
|
224
224
|
(1.upto 100).map { |i| "text_#{j} lorem ipsum #{i} dolor " }.join(" ")
|
225
225
|
end
|
226
226
|
|
227
227
|
def chapter(i, depth)
|
228
|
-
["\n\n", "##########"[1..depth], " this is example on level #{i} .. #{depth}\n\n",
|
228
|
+
["\n\n", "##########"[1 .. depth], " this is example on level #{i} .. #{depth}\n\n",
|
229
229
|
lorem(i),
|
230
230
|
].join("")
|
231
231
|
end
|
@@ -237,24 +237,24 @@ describe "Wortsammler conversion" do
|
|
237
237
|
f.puts ""
|
238
238
|
|
239
239
|
0.upto 8 do |i|
|
240
|
-
f.puts [" "*i, "- this is list level #{i}"].join
|
240
|
+
f.puts [" " * i, "- this is list level #{i}"].join
|
241
241
|
end
|
242
242
|
}
|
243
243
|
|
244
244
|
system "#{wortsammler} -pbi '#{mdfile}' -o '#{tempdir}' -f pdf:latex"
|
245
|
-
$?.success?.should==true
|
245
|
+
$?.success?.should == true
|
246
246
|
|
247
|
-
Dir["#{tempdir}/listnesting*"].map { |f| File.basename(f) }.sort.should== ["listnesting.md",
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
247
|
+
Dir["#{tempdir}/listnesting*"].map { |f| File.basename(f) }.sort.should == ["listnesting.md",
|
248
|
+
"listnesting.pdf",
|
249
|
+
"listnesting.latex",
|
250
|
+
"listnesting.log",
|
251
|
+
"listnesting.md.bak"
|
252
252
|
].sort
|
253
253
|
end
|
254
254
|
|
255
255
|
it "converts all files within a folder to output format" do
|
256
|
-
tempdir =Dir.mktmpdir
|
257
|
-
mdtext ="# Header\n\n lorem ipsum\n"
|
256
|
+
tempdir = Dir.mktmpdir
|
257
|
+
mdtext = "# Header\n\n lorem ipsum\n"
|
258
258
|
basefiles = ["f1", "f2", "f3"]
|
259
259
|
outfiles = basefiles.map { |f| ["#{f}.md", "#{f}.latex"] }.flatten.sort
|
260
260
|
basefiles.each { |f|
|
@@ -262,54 +262,60 @@ describe "Wortsammler conversion" do
|
|
262
262
|
}
|
263
263
|
|
264
264
|
system "#{wortsammler} -pi #{tempdir} -o #{tempdir} -f latex"
|
265
|
-
$?.success?.should==true
|
265
|
+
$?.success?.should == true
|
266
266
|
|
267
|
-
Dir["#{tempdir}/*"].map { |f| File.basename(f) }.sort.should== outfiles
|
267
|
+
Dir["#{tempdir}/*"].map { |f| File.basename(f) }.sort.should == outfiles
|
268
268
|
|
269
269
|
end
|
270
270
|
|
271
271
|
it "processes a manifest" do
|
272
272
|
FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") { |d|
|
273
|
-
manifest="../ZSUPP_Manifests/sample_the-sample-document.yaml"
|
274
|
-
cmd
|
273
|
+
manifest = "../ZSUPP_Manifests/sample_the-sample-document.yaml"
|
274
|
+
cmd = "#{wortsammler} -pm #{manifest}"
|
275
275
|
system cmd
|
276
276
|
}
|
277
|
-
$?.success?.should==true
|
277
|
+
$?.success?.should == true
|
278
278
|
end
|
279
279
|
|
280
280
|
it "investigates the existence of a manifest" do
|
281
|
-
manifest="testproject/30_Sources/ZSUPP_Manifests/xxthis-path-does-not-exist.yaml"
|
281
|
+
manifest = "testproject/30_Sources/ZSUPP_Manifests/xxthis-path-does-not-exist.yaml"
|
282
282
|
system "#{wortsammler} -m #{manifest}"
|
283
|
-
$?.success?.should==false
|
283
|
+
$?.success?.should == false
|
284
284
|
end
|
285
285
|
|
286
286
|
it "extracts the traceables according to a manifest", :exp => false do
|
287
|
-
manifest="testproject/30_Sources/ZSUPP_Manifests/sample_the-sample-document.yaml"
|
287
|
+
manifest = "testproject/30_Sources/ZSUPP_Manifests/sample_the-sample-document.yaml"
|
288
|
+
tracefile = "testproject/30_Sources/ZGEN_RequirementsTracing/RS_Main.traces.md"
|
289
|
+
FileUtils.rm(tracefile) if File.exists?(tracefile)
|
290
|
+
|
288
291
|
system "#{wortsammler} -cm #{manifest}"
|
289
|
-
|
292
|
+
result = File.read("testproject/30_Sources/ZGEN_RequirementsTracing/RS_Main.traces.md")
|
293
|
+
|
294
|
+
expect(result).to include("\\[RS\\_Comp\\_001\\] **Flexibler Dokumentumfang** { }()")
|
295
|
+
$?.success?.should == true
|
290
296
|
end
|
291
297
|
|
292
298
|
|
293
299
|
it "extracts plantuml according to a manifest", :exp => false do
|
294
|
-
manifest="testproject/30_Sources/ZSUPP_Manifests/sample_the-sample-document.yaml"
|
300
|
+
manifest = "testproject/30_Sources/ZSUPP_Manifests/sample_the-sample-document.yaml"
|
295
301
|
system "#{wortsammler} -um #{manifest}"
|
296
|
-
$?.success?.should==true
|
302
|
+
$?.success?.should == true
|
297
303
|
end
|
298
304
|
|
299
305
|
it "extracts plantuml from a single file", :exp => false do
|
300
|
-
outfile="#{testoutput}/authentification.png"
|
306
|
+
outfile = "#{testoutput}/authentification.png"
|
301
307
|
FileUtils.rm(outfile) if File.exists?(outfile)
|
302
308
|
system "#{wortsammler} -ui \"#{specdir}/TC_EXP_002.md\""
|
303
|
-
$?.success?.should==true
|
304
|
-
File.exist?(outfile).should==true
|
309
|
+
$?.success?.should == true
|
310
|
+
File.exist?(outfile).should == true
|
305
311
|
end
|
306
312
|
|
307
313
|
it "extracts plantuml from a folder", :exp => false do
|
308
|
-
outfile="#{testoutput}/authentification.png"
|
314
|
+
outfile = "#{testoutput}/authentification.png"
|
309
315
|
FileUtils.rm(outfile) if File.exists?(outfile)
|
310
316
|
system "#{wortsammler} -ui \"#{specdir}\""
|
311
|
-
$?.success?.should==true
|
312
|
-
File.exist?(outfile).should==true
|
317
|
+
$?.success?.should == true
|
318
|
+
File.exist?(outfile).should == true
|
313
319
|
end
|
314
320
|
|
315
321
|
|
@@ -331,17 +337,17 @@ describe "Wortsammler conversion" do
|
|
331
337
|
cmd = "rake sample"
|
332
338
|
system cmd
|
333
339
|
}
|
334
|
-
Dir["testproject/30_Sources/ZGEN_Documents/*.*"].count.should==15
|
335
|
-
$?.success?.should==true
|
340
|
+
Dir["testproject/30_Sources/ZGEN_Documents/*.*"].count.should == 15
|
341
|
+
$?.success?.should == true
|
336
342
|
end
|
337
343
|
|
338
344
|
it "compiles all documents", exp: false do
|
339
345
|
FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") { |d|
|
340
|
-
path
|
341
|
-
ENV['PATH']="#{wortsammlerbin}:#{path}"
|
346
|
+
path = ENV['PATH']
|
347
|
+
ENV['PATH'] = "#{wortsammlerbin}:#{path}"
|
342
348
|
puts ENV['PATH']
|
343
349
|
#system 'wortsammler -h'
|
344
|
-
cmd= "rake all"
|
350
|
+
cmd = "rake all"
|
345
351
|
#system cmd
|
346
352
|
}
|
347
353
|
end
|
@@ -375,27 +381,27 @@ end
|
|
375
381
|
|
376
382
|
describe "Wortsammler syntax extensions", :exp => false do
|
377
383
|
it "[RS_Comp_012] supports embedded images" do
|
378
|
-
tempdir ="#{specdir}/../testoutput"
|
379
|
-
imagefile ="floating-image.pdf"
|
384
|
+
tempdir = "#{specdir}/../testoutput"
|
385
|
+
imagefile = "floating-image.pdf"
|
380
386
|
|
381
387
|
FileUtils.cd(tempdir) { |c|
|
382
388
|
FileUtils.cp("#{specdir}/#{imagefile}", ".")
|
383
389
|
|
384
|
-
mdfile="embedded-image.md"
|
385
|
-
|
386
|
-
mdtext=["#this is headline",
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
390
|
+
mdfile = "embedded-image.md"
|
391
|
+
|
392
|
+
mdtext = ["#this is headline",
|
393
|
+
(5 .. 100).to_a.map { |oi|
|
394
|
+
["\n\n",
|
395
|
+
"this is image\n\n~~EMBED \"#{imagefile}\" o 40mm 60mm~~",
|
396
|
+
(1 .. 20).to_a.map { |ii|
|
397
|
+
"#{oi} und #{ii} lorem ipsum und blafasel"
|
398
|
+
}.join(" "),
|
399
|
+
"\n\n",
|
400
|
+
(5 .. 15 + oi).to_a.map { |ii|
|
401
|
+
"#{oi} und #{ii} lorem ipsum und blafasel"
|
402
|
+
}.join(" "),
|
403
|
+
"\n\n"]
|
404
|
+
}
|
399
405
|
].flatten.join("\n")
|
400
406
|
|
401
407
|
File.open(mdfile, "w") { |f| f.puts mdtext }
|
@@ -403,7 +409,7 @@ describe "Wortsammler syntax extensions", :exp => false do
|
|
403
409
|
system "#{wortsammler} -pi '#{mdfile}' -o '.' -f pdf:latex:html:docx"
|
404
410
|
FileUtils.rm imagefile
|
405
411
|
}
|
406
|
-
$?.success?.should==true
|
412
|
+
$?.success?.should == true
|
407
413
|
end
|
408
414
|
|
409
415
|
it "TC_EXP_001 expands expected results from testcases", exp: false do
|
@@ -413,7 +419,7 @@ describe "Wortsammler syntax extensions", :exp => false do
|
|
413
419
|
File.unlink(outfile) if File.exists?(outfile)
|
414
420
|
proc.prepareFile("#{specdir}/TC_EXP_001.md", outfile)
|
415
421
|
|
416
|
-
a=File.open(outfile, "r").readlines.join
|
422
|
+
a = File.open(outfile, "r").readlines.join
|
417
423
|
a.should include("TC-DES-003-01")
|
418
424
|
end
|
419
425
|
|
@@ -425,32 +431,32 @@ describe "Wortsammler syntax extensions", :exp => false do
|
|
425
431
|
proc.prepareFile("#{specdir}/TC_EXP_002.md", outfile)
|
426
432
|
|
427
433
|
a = File.open(outfile, "r").readlines.join
|
428
|
-
a.include?(".plantuml").should==false
|
434
|
+
a.include?(".plantuml").should == false
|
429
435
|
end
|
430
436
|
|
431
|
-
it "
|
432
|
-
tempdir ="#{specdir}/../testoutput"
|
433
|
-
mdinlayfile ="TC_EXP_003_1.md"
|
434
|
-
mdinlayfile_1 ="TC_EXP_003_2.md"
|
435
|
-
mdfile ="tc_exp_003"
|
437
|
+
it "TC_EXP_003x handles Markdown inlays", exp: true do
|
438
|
+
tempdir = "#{specdir}/../testoutput"
|
439
|
+
mdinlayfile = "TC_EXP_003_1.md"
|
440
|
+
mdinlayfile_1 = "TC_EXP_003_2.md"
|
441
|
+
mdfile = "tc_exp_003"
|
436
442
|
|
437
443
|
FileUtils.cd(tempdir) { |c|
|
438
444
|
FileUtils.cp("#{specdir}/#{mdinlayfile}", ".")
|
439
445
|
FileUtils.cp("#{specdir}/#{mdinlayfile_1}", ".")
|
440
446
|
|
441
447
|
|
442
|
-
mdtext=["#this is headline",
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
448
|
+
mdtext = ["#this is headline",
|
449
|
+
"",
|
450
|
+
"~~~~",
|
451
|
+
"", "now verbatim by indent inclucde #{mdinlayfile}", "",
|
452
|
+
" ~~MD \"#{mdinlayfile.gsub('_', '\_')}\"~~",
|
453
|
+
"~~~~",
|
454
|
+
"",
|
455
|
+
"", "now full format inclucde #{mdinlayfile}", "",
|
456
|
+
"~~MD \"#{mdinlayfile}\"~~",
|
457
|
+
"",
|
458
|
+
"", "now full format inclucde #{mdinlayfile_1}", "",
|
459
|
+
"~~MD \"#{mdinlayfile_1}\"~~",
|
454
460
|
].flatten.join("\n")
|
455
461
|
|
456
462
|
File.open("#{mdfile}.md", "w") { |f| f.puts mdtext }
|
@@ -471,8 +477,8 @@ describe "Wortsammler syntax extensions", :exp => false do
|
|
471
477
|
system "pdftotext \"#{testoutput}/test_mkindex.pdf\""
|
472
478
|
the_time = Time.now.strftime("%B %-d, %Y")
|
473
479
|
ref = File.open("#{specdir}/test_mkindex_reference.txt", encoding: "ISO-8859-1").read
|
474
|
-
result = File.open("#{testoutput}/test_mkindex.txt",
|
475
|
-
result = result.gsub(the_time, "January 5, 2019")
|
480
|
+
result = File.open("#{testoutput}/test_mkindex.txt", encoding: "ISO-8859-1").read
|
481
|
+
result = result.gsub(the_time, "January 5, 2019") # adapt this if you update the reference
|
476
482
|
expect(result).to eq ref
|
477
483
|
end
|
478
484
|
|
@@ -480,7 +486,7 @@ describe "Wortsammler syntax extensions", :exp => false do
|
|
480
486
|
system %Q{wortsammler -pi '#{specdir}/test_mkindex.md' -f pdf:latex -o '#{testoutput}' >> '#{testoutput}/test_mkindex.lst'}
|
481
487
|
system "pdftotext \"#{testoutput}/test_mkindex.pdf\""
|
482
488
|
result = File.open("#{testoutput }/test_mkindex.lst").read
|
483
|
-
result.include?("[WARN]").should==true
|
489
|
+
result.include?("[WARN]").should == true
|
484
490
|
end
|
485
491
|
|
486
492
|
|