xhtml_report_generator 2.2.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +84 -41
- data/lib/xhtml_report_generator/custom.rb +13 -9
- data/lib/xhtml_report_generator/jquery.min.js +5 -0
- data/lib/xhtml_report_generator/print_template.css +33 -15
- data/lib/xhtml_report_generator/split.min.js +22 -0
- data/lib/xhtml_report_generator/style_template.css +98 -98
- data/lib/xhtml_report_generator/toc.min.js +6 -0
- data/lib/xhtml_report_generator/version.rb +1 -1
- data/lib/xhtml_report_generator.rb +44 -30
- metadata +13 -17
- data/lib/xhtml_report_generator/jquery.js +0 -4
- data/lib/xhtml_report_generator/toc.js +0 -5
@@ -0,0 +1,22 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2015 Nathan Cahill
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in
|
12
|
+
all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
THE SOFTWARE.
|
21
|
+
*/
|
22
|
+
"use strict";(function(){var e=this,t="addEventListener",i="removeEventListener",s="getBoundingClientRect",r=e.attachEvent&&!e[t],n=e.document,a=function(){var e,t=["","-webkit-","-moz-","-o-"];for(var i=0;i<t.length;i++){e=n.createElement("div");e.style.cssText="width:"+t[i]+"calc(9px)";if(e.style.length){return t[i]+"calc"}}}(),o=function(e){if(typeof e==="string"||e instanceof String){return n.querySelector(e)}else{return e}},l=function(l,u){var c,f,g,p,h,z,d,S,y=[];u=typeof u!=="undefined"?u:{};if(!u.gutterSize)u.gutterSize=10;if(!u.minSize)u.minSize=100;if(!u.snapOffset)u.snapOffset=30;if(!u.direction)u.direction="horizontal";if(u.direction=="horizontal"){c="width";g="clientWidth";p="clientX";h="left";z="gutter gutter-horizontal";d="paddingLeft";S="paddingRight";if(!u.cursor)u.cursor="ew-resize"}else if(u.direction=="vertical"){c="height";g="clientHeight";p="clientY";h="top";z="gutter gutter-vertical";d="paddingTop";S="paddingBottom";if(!u.cursor)u.cursor="ns-resize"}var v=function(i){var s=this,r=s.a,n=s.b;if(!s.dragging&&u.onDragStart){u.onDragStart()}i.preventDefault();s.dragging=true;s.move=b.bind(s);s.stop=m.bind(s);e[t]("mouseup",s.stop);e[t]("touchend",s.stop);e[t]("touchcancel",s.stop);s.parent[t]("mousemove",s.move);s.parent[t]("touchmove",s.move);r[t]("selectstart",U);r[t]("dragstart",U);n[t]("selectstart",U);n[t]("dragstart",U);r.style.userSelect="none";r.style.webkitUserSelect="none";r.style.MozUserSelect="none";r.style.pointerEvents="none";n.style.userSelect="none";n.style.webkitUserSelect="none";n.style.MozUserSelect="none";n.style.pointerEvents="none";s.gutter.style.cursor=u.cursor;s.parent.style.cursor=u.cursor;M.call(s)},m=function(){var t=this,s=t.a,r=t.b;if(t.dragging&&u.onDragEnd){u.onDragEnd()}t.dragging=false;e[i]("mouseup",t.stop);e[i]("touchend",t.stop);e[i]("touchcancel",t.stop);t.parent[i]("mousemove",t.move);t.parent[i]("touchmove",t.move);delete t.stop;delete t.move;s[i]("selectstart",U);s[i]("dragstart",U);r[i]("selectstart",U);r[i]("dragstart",U);s.style.userSelect="";s.style.webkitUserSelect="";s.style.MozUserSelect="";s.style.pointerEvents="";r.style.userSelect="";r.style.webkitUserSelect="";r.style.MozUserSelect="";r.style.pointerEvents="";t.gutter.style.cursor="";t.parent.style.cursor=""},b=function(e){var t;if(!this.dragging)return;if("touches"in e){t=e.touches[0][p]-this.start}else{t=e[p]-this.start}if(t<=this.aMin+u.snapOffset){t=this.aMin}else if(t>=this.size-this.bMin-u.snapOffset){t=this.size-this.bMin}x.call(this,t);if(u.onDrag){u.onDrag()}},M=function(){var t=e.getComputedStyle(this.parent),i=this.parent[g]-parseFloat(t[d])-parseFloat(t[S]);this.size=this.a[s]()[c]+this.b[s]()[c]+this.aGutterSize+this.bGutterSize;this.percentage=Math.min(this.size/i*100,100);this.start=this.a[s]()[h]},x=function(e){this.a.style[c]=a+"("+e/this.size*this.percentage+"% - "+this.aGutterSize+"px)";this.b.style[c]=a+"("+(this.percentage-e/this.size*this.percentage)+"% - "+this.bGutterSize+"px)"},G=function(){var e=this,t=e.a,i=e.b;if(t[s]()[c]<e.aMin){t.style[c]=e.aMin-e.aGutterSize+"px";i.style[c]=e.size-e.aMin-e.aGutterSize+"px"}else if(i[s]()[c]<e.bMin){t.style[c]=e.size-e.bMin-e.bGutterSize+"px";i.style[c]=e.bMin-e.bGutterSize+"px"}},w=function(){var e=this,t=e.a,i=e.b;if(i[s]()[c]<e.bMin){t.style[c]=e.size-e.bMin-e.bGutterSize+"px";i.style[c]=e.bMin-e.bGutterSize+"px"}else if(t[s]()[c]<e.aMin){t.style[c]=e.aMin-e.aGutterSize+"px";i.style[c]=e.size-e.aMin-e.aGutterSize+"px"}},E=function(e){for(var t=0;t<e.length;t++){M.call(e[t]);G.call(e[t])}for(t=e.length-1;t>=0;t--){M.call(e[t]);w.call(e[t])}},U=function(){return false},D=o(l[0]).parentNode;if(!u.sizes){var k=100/l.length;u.sizes=[];for(f=0;f<l.length;f++){u.sizes.push(k)}}if(!Array.isArray(u.minSize)){var L=[];for(f=0;f<l.length;f++){L.push(u.minSize)}u.minSize=L}for(f=0;f<l.length;f++){var O=o(l[f]),B=f==1,F=f==l.length-1,A,C=u.gutterSize,N;if(f>0){N={a:o(l[f-1]),b:O,aMin:u.minSize[f-1],bMin:u.minSize[f],dragging:false,parent:D,isFirst:B,isLast:F,direction:u.direction};N.aGutterSize=u.gutterSize;N.bGutterSize=u.gutterSize;if(B){N.aGutterSize=u.gutterSize/2}if(F){N.bGutterSize=u.gutterSize/2}}if(!r){if(f>0){var R=n.createElement("div");R.className=z;R.style[c]=u.gutterSize+"px";R[t]("mousedown",v.bind(N));R[t]("touchstart",v.bind(N));D.insertBefore(R,O);N.gutter=R}if(f===0||f==l.length-1){C=u.gutterSize/2}if(typeof u.sizes[f]==="string"||u.sizes[f]instanceof String){A=u.sizes[f]}else{A=a+"("+u.sizes[f]+"% - "+C+"px)"}}else{if(typeof u.sizes[f]==="string"||u.sizes[f]instanceof String){A=u.sizes[f]}else{A=u.sizes[f]+"%"}}O.style[c]=A;if(f>0){y.push(N)}}E(y)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports){exports=module.exports=l}exports.Split=l}else{e.Split=l}}).call(window);
|
@@ -1,164 +1,164 @@
|
|
1
1
|
/* general styles */
|
2
|
+
html {
|
3
|
+
height: 100%; /* needed for split.js */
|
4
|
+
}
|
5
|
+
|
2
6
|
body {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
7
|
+
background: #FFFFFF;
|
8
|
+
font: 100% Arial, Helvetica, sans-serif;
|
9
|
+
color: #404040;
|
10
|
+
line-height: 110%;
|
11
|
+
margin: 0;
|
12
|
+
height: 100%; /* needed for split.js */
|
13
|
+
box-sizing: border-box; /* needed for split.js */
|
8
14
|
}
|
9
15
|
|
10
16
|
p {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
17
|
+
background: #FFFFFF;
|
18
|
+
font: 100% Arial, Helvetica, sans-serif;
|
19
|
+
color: #202020;
|
20
|
+
line-height: 110%;
|
21
|
+
text-align: left;
|
22
|
+
}
|
23
|
+
|
24
|
+
#layout {
|
25
|
+
/* this element is just used as a hint how to seed split.js
|
26
|
+
it's class value indicates 0-3 which means if only middle
|
27
|
+
ltoc, rtoc or all are shown.
|
28
|
+
*/
|
29
|
+
display: none;
|
30
|
+
}
|
31
|
+
|
32
|
+
/***********************
|
33
|
+
split.js specifics
|
34
|
+
thanks to
|
35
|
+
https://github.com/nathancahill/Split.js
|
36
|
+
************************/
|
37
|
+
|
38
|
+
.gutter {
|
39
|
+
background-color: #eee;
|
40
|
+
background-repeat: no-repeat;
|
41
|
+
background-position: 50%;
|
42
|
+
}
|
43
|
+
|
44
|
+
.gutter.gutter-horizontal {
|
45
|
+
/* base 64 encoded version of ../../resource/horizontal.png */
|
46
|
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
|
47
|
+
cursor: ew-resize;
|
48
|
+
}
|
49
|
+
|
50
|
+
.gutter.gutter-vertical {
|
51
|
+
/* base 64 encoded version of ../../resource/vertical.png */
|
52
|
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFCAYAAABSIVz6AAAKQWlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUU9kWh8+9N73QEiIgJfQaegkg0jtIFQRRiUmAUAKGhCZ2RAVGFBEpVmRUwAFHhyJjRRQLg4Ji1wnyEFDGwVFEReXdjGsJ7601896a/cdZ39nnt9fZZ+9917oAUPyCBMJ0WAGANKFYFO7rwVwSE8vE9wIYEAEOWAHA4WZmBEf4RALU/L09mZmoSMaz9u4ugGS72yy/UCZz1v9/kSI3Q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88ngmbWbm3/eE8/syOll+AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAJklEQVQoFWM8c+bMfwYgMDExYQTR9OIzgSwbUYCRXkGLHpUDFtQAj1I+zTCPS2YAAAAASUVORK5CYII=');
|
53
|
+
cursor: ns-resize;
|
54
|
+
}
|
55
|
+
|
56
|
+
.split {
|
57
|
+
-webkit-box-sizing: border-box;
|
58
|
+
-moz-box-sizing: border-box;
|
59
|
+
box-sizing: border-box;
|
60
|
+
overflow: auto;
|
61
|
+
}
|
62
|
+
|
63
|
+
.split.split-horizontal, .gutter.gutter-horizontal {
|
64
|
+
height: 94%;
|
65
|
+
float: left;
|
16
66
|
}
|
17
67
|
|
18
68
|
/***********************
|
19
69
|
div classes
|
20
70
|
************************/
|
21
71
|
div.head {
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
height: 90px;
|
28
|
-
background: #FFFFFF;
|
29
|
-
z-index: 99;
|
72
|
+
font: 200% Arial, Helvetica, sans-serif, bold;
|
73
|
+
font-size: 16px; font-size: 4vh;
|
74
|
+
text-align: center;
|
75
|
+
width: 100%;
|
76
|
+
height: 5%;
|
30
77
|
}
|
31
78
|
|
32
79
|
div.lefttoc {
|
33
|
-
|
34
|
-
width: 20%;
|
35
|
-
/*height:90%;*/
|
36
|
-
top: 100px;
|
37
|
-
left: 5px;
|
38
|
-
bottom: 20px;
|
39
|
-
border: solid 1px #000000;
|
40
|
-
overflow: auto;
|
41
|
-
white-space: nowrap;
|
42
|
-
/*display:none;*/ /*uncomment on the left for printing*/
|
80
|
+
white-space: nowrap;
|
43
81
|
}
|
44
82
|
|
45
83
|
div.middle {
|
46
|
-
position: relative;
|
47
|
-
margin: 100px 160px 0 23%; /*top right bottom left */
|
48
|
-
/* margin: x y = Xpx each - botten and top, ypx each - left and right */
|
49
84
|
}
|
50
85
|
|
51
86
|
div.righttoc {
|
52
|
-
|
53
|
-
width: 150px;
|
54
|
-
top: 100px;
|
55
|
-
right: 5px;
|
56
|
-
border: solid 1px #000000;
|
57
|
-
/*display:none;*/ /*uncomment on the left for printing*/
|
87
|
+
white-space: nowrap;
|
58
88
|
}
|
59
89
|
|
60
|
-
|
61
|
-
|
90
|
+
#pre_toggle_linewrap {
|
91
|
+
float: right;
|
92
|
+
font-size: 10px; font-size: 2vh;
|
93
|
+
border-radius: 10px;
|
94
|
+
text-align: center;
|
95
|
+
text-decoration: none;
|
96
|
+
display: inline-block;
|
97
|
+
background-color: #008CBA;
|
62
98
|
}
|
63
99
|
|
64
100
|
/*code light-blue*/
|
65
101
|
pre {
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
102
|
+
font-family: courier;
|
103
|
+
background: #E5F1F4;
|
104
|
+
font-size: 80%;
|
105
|
+
border: 1px dotted;
|
106
|
+
line-height: 110%;
|
107
|
+
color: #000000;
|
108
|
+
white-space: pre-wrap; /* default: pre */
|
109
|
+
word-wrap: break-word; /* default: initial */
|
74
110
|
}
|
75
111
|
.code0 {
|
76
|
-
|
112
|
+
background: #E5F1F4;
|
77
113
|
}
|
78
114
|
/*code red-brown*/
|
79
115
|
.code1 {
|
80
|
-
|
116
|
+
background: #A66C75;
|
81
117
|
}
|
82
118
|
/*code light-green*/
|
83
119
|
.code2 {
|
84
|
-
|
120
|
+
background: #DAF1DD;
|
85
121
|
}
|
86
122
|
/*code light-yellow*/
|
87
123
|
.code3 {
|
88
|
-
|
124
|
+
background: #F5F2B7;
|
89
125
|
}
|
90
126
|
|
91
127
|
|
92
128
|
/*default highlight yellow*/
|
93
129
|
span {
|
94
|
-
|
130
|
+
background: #FFFF00;
|
95
131
|
}
|
96
132
|
|
97
133
|
/*red*/
|
98
134
|
span.r {
|
99
|
-
|
135
|
+
background: #FF0000;
|
100
136
|
}
|
101
137
|
|
102
138
|
/*green*/
|
103
139
|
span.g {
|
104
|
-
|
140
|
+
background: #00FF00;
|
105
141
|
}
|
106
142
|
/*blue*/
|
107
143
|
span.b {
|
108
|
-
|
144
|
+
background: #00FFFF;
|
109
145
|
}
|
110
146
|
|
111
147
|
a {
|
112
|
-
|
113
|
-
|
148
|
+
text-decoration: none;
|
149
|
+
color: #057fac;
|
114
150
|
}
|
115
151
|
|
116
152
|
a:hover {
|
117
|
-
|
118
|
-
|
153
|
+
text-decoration: none;
|
154
|
+
color: #999999;
|
119
155
|
}
|
120
156
|
|
121
157
|
h1 {
|
122
|
-
|
123
|
-
|
158
|
+
font-size: 140%;
|
159
|
+
margin: 20px 0px;
|
124
160
|
}
|
125
161
|
|
126
162
|
h2 {
|
127
|
-
|
128
|
-
}
|
129
|
-
|
130
|
-
/* work-around for margin/padding issues with hash-tag links */
|
131
|
-
/* http://css-tricks.com/hash-tag-links-padding/ */
|
132
|
-
h1:before {
|
133
|
-
font-size: 140%;
|
134
|
-
display: block;
|
135
|
-
content: " ";
|
136
|
-
margin-top: -100px;
|
137
|
-
height: 100px;
|
138
|
-
visibility: hidden;
|
163
|
+
font-size: 120%;
|
139
164
|
}
|
140
|
-
|
141
|
-
h2:before {
|
142
|
-
font-size: 120%;
|
143
|
-
display: block;
|
144
|
-
content: " ";
|
145
|
-
margin-top: -100px;
|
146
|
-
height: 100px;
|
147
|
-
visibility: hidden;
|
148
|
-
}
|
149
|
-
|
150
|
-
h3:before {
|
151
|
-
display: block;
|
152
|
-
content: " ";
|
153
|
-
margin-top: -100px;
|
154
|
-
height: 100px;
|
155
|
-
visibility: hidden;
|
156
|
-
}
|
157
|
-
|
158
|
-
/*End of work-around*/
|
159
|
-
|
160
|
-
form {
|
161
|
-
margin: 1em 0;
|
162
|
-
padding: .2em 20px;
|
163
|
-
background: #eeeeee;
|
164
|
-
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
$(document).ready(function(){switch($("#layout").attr("class")){case "1":Split(["#ltoc","#middle"],{minSize:[5,100],sizes:[20,80],snapOffset:50,gutterSize:10});break;case "2":Split(["#middle","#rtoc"],{minSize:[100,5],sizes:[85,15],snapOffset:50,gutterSize:10});break;case "3":Split(["#ltoc","#middle","#rtoc"],{minSize:[5,100,5],sizes:[20,70,10],snapOffset:50,gutterSize:10});break;default:$("#middle").attr("style","width:100%;")}$("td").each(function(b){b=$(this);null!==b.html().match(/^passed$/i)?
|
2
|
+
b.attr("style","background-color:#19D119;"):null!==b.html().match(/^failed$/i)?b.attr("style","background-color:#FF4719;"):null!==b.html().match(/^check$/i)&&b.attr("style","background-color:#FFFF00;")});$("[class=rtoconly],[class=bothtoc]").each(function(b){var a=$(this),c=a.attr("class");a.attr("id",c+b);$("#rtoc").append("<a href='#"+c+b+"'>"+a.html()+"</a> <br />\n")});h3index=h2index=h1index=0;$("h1, h2, h3, a.h2, a.h1").each(function(b){var a=$(this);void 0==a.attr("id")&&a.attr("id","title"+
|
3
|
+
b);if("H1"==a.prop("tagName").toUpperCase())h1index+=1,h3index=h2index=0,a.prepend(h1index+" "),$("#ltoc").append("<br />\n"),lasth1="#"+a.attr("id"),lasth1cont=a.html();else if("H2"==a.prop("tagName").toUpperCase())h2index+=1,h3index=0,a.prepend(h1index+"."+h2index+" "),lasth2="#"+a.attr("id"),lasth2cont=a.html();else if("H3"==a.prop("tagName").toUpperCase())h3index+=1,a.prepend(h1index+"."+h2index+"."+h3index+" ");else{if("H1"==a.attr("class").toUpperCase())return a.attr("href",lasth1),a.html(lasth1cont),
|
4
|
+
0;if("H2"==a.attr("class").toUpperCase())return a.attr("href",lasth2),a.html(lasth2cont),0}if("undefined"!=typeof a.attr("class")&&"RTOCONLY"==a.attr("class").toUpperCase())return 0;$("#ltoc").append("<div id='div_fold_"+h1index+"_"+h2index+"_"+h3index+"'><a id='a_fold_"+h1index+"_"+h2index+"_"+h3index+"' style='cursor:pointer'> - </a> <a id='link"+b+"' href='#"+a.attr("id")+"' >"+a.html()+"</a> <br /> </div>\n");return 0});pre_style=!1;$("#pre_toggle_linewrap").click(function(){pre_style?
|
5
|
+
($("pre").css({"white-space":"pre-wrap","word-wrap":"break-word"}),pre_style=!1):($("pre").css({"white-space":"pre","word-wrap":"initial"}),pre_style=!0)});$('a[id^="a_fold"]').click(function(){var b=$(this),a=b.attr("id").match(/(\d+)_(\d+)_(\d+)/);if(b.html().match(/-/))var c=" + ",e=!1;else c=" - ",e=!0;b.html(c);if("0"==a[2]){var d=new RegExp("div_fold_"+a[1]+"_[1-9]\\d*_0");$("div").filter(function(){return this.id.match(d)}).each(function(){$(this).children('a[id^="a_fold"]').html(c);
|
6
|
+
$(this).toggle(e)});d=new RegExp("div_fold_"+a[1]+"_\\d+_[1-9]\\d*");$("div").filter(function(){return this.id.match(d)}).each(function(){$(this).children('a[id^="a_fold"]').html(c);$(this).toggle(e)})}else"0"==a[3]&&(d=new RegExp("div_fold_"+a[1]+"_"+a[2]+"_[1-9]\\d*"),$("div").filter(function(){return this.id.match(d)}).each(function(){$(this).children('a[id^="a_fold"]').html(c);$(this).toggle(e)}))})});
|
@@ -10,49 +10,62 @@ module XhtmlReportGenerator
|
|
10
10
|
attr_accessor :document, :file
|
11
11
|
# @param opts [Hash] See the example for an explanation of the valid symbols
|
12
12
|
# @example Valid symbols for the opts Hash
|
13
|
-
# :
|
14
|
-
# :
|
15
|
-
# :
|
16
|
-
# :
|
17
|
-
#
|
13
|
+
# :js if specified, array of javascript files which are inlined into the html header section
|
14
|
+
# :css if specified, array of css files which are inlined into the html header section
|
15
|
+
# :css_print if specified, array of css files which are inlined into the html header section with media=print
|
16
|
+
# :custom_rb if specified, path to a custom Module containing all the logic to create content for the report
|
17
|
+
# see (custom.rb) on how to write it. As a last statement you should extend your module name
|
18
|
+
# outside of the module definition.
|
18
19
|
def initialize(opts = {})
|
19
20
|
# define the default values
|
20
21
|
path = File.expand_path("../xhtml_report_generator", __FILE__)
|
21
|
-
|
22
|
-
:
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
defaults = {
|
23
|
+
:js => [
|
24
|
+
File.expand_path("jquery.min.js",path),
|
25
|
+
File.expand_path("split.min.js",path),
|
26
|
+
File.expand_path("toc.min.js",path)
|
27
|
+
],
|
28
|
+
:css => [
|
29
|
+
File.expand_path("style_template.css",path)
|
30
|
+
],
|
31
|
+
:css_print => [
|
32
|
+
File.expand_path("print_template.css",path)
|
33
|
+
],
|
26
34
|
:custom_rb => File.expand_path("custom.rb",path)
|
27
35
|
}
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
end
|
36
|
+
|
37
|
+
opts[:js] = defaults[:js] if !opts.has_key?(:js)
|
38
|
+
opts[:css] = defaults[:css] if !opts.has_key?(:css)
|
39
|
+
opts[:css_print] = defaults[:css_print] if !opts.has_key?(:css_print)
|
40
|
+
opts[:custom_rb] = defaults[:custom_rb] if !opts.has_key?(:custom_rb)
|
41
|
+
|
35
42
|
# load the custom module and extend it, use instance_eval otherwise the module will affect
|
36
43
|
# all existing Generator classes
|
37
|
-
instance_eval(
|
44
|
+
instance_eval(File.read(opts[:custom_rb]), opts[:custom_rb])
|
38
45
|
|
39
46
|
@document = Generator.create_xhtml_document("Title")
|
40
47
|
head = @document.elements["//head"]
|
41
48
|
|
42
49
|
head.add_element("meta", {"charset" => "utf-8"})
|
43
50
|
|
44
|
-
# insert
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
# insert css
|
52
|
+
opts[:css].each do |css_path|
|
53
|
+
style = head.add_element("style", {"type" => "text/css"})
|
54
|
+
cdata(File.read(css_path), style)
|
55
|
+
end
|
56
|
+
|
57
|
+
# insert css for printing
|
58
|
+
opts[:css_print].each do |css_path|
|
59
|
+
style = head.add_element("style", {"type" => "text/css", "media"=>"print"})
|
60
|
+
cdata(File.read(css_path), style)
|
61
|
+
end
|
62
|
+
|
63
|
+
# inster js files
|
64
|
+
opts[:js].each do |js_path|
|
65
|
+
script = head.add_element("script", {"type" => "text/javascript"})
|
66
|
+
cdata(File.read(js_path), script)
|
67
|
+
end
|
68
|
+
|
56
69
|
end
|
57
70
|
|
58
71
|
# Surrounds CData tag with c-style comments to remain compatible with normal html.
|
@@ -93,6 +106,7 @@ module XhtmlReportGenerator
|
|
93
106
|
# don't use version 1.1 - firefox has not yet a parser vor xml 1.1
|
94
107
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=233154
|
95
108
|
header = '<?xml version="1.0" encoding="UTF-8"?>'
|
109
|
+
# change of doctype to <!DOCTYPE html> for html5 compatibility
|
96
110
|
header << '<!DOCTYPE html>'
|
97
111
|
|
98
112
|
doc = REXML::Document.new(header)
|
metadata
CHANGED
@@ -1,27 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xhtml_report_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Widmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "The generator can be used to create html or xhtml files. It comes with
|
14
|
-
many utility functions.\n
|
15
|
-
|
16
|
-
|
17
|
-
\
|
18
|
-
|
19
|
-
function: Hallo welt <br /> html test <span class=\"r\" >red span test<span></p>\")\n
|
20
|
-
\ gen1.highlight(/Ha.*lt/)\n \nThe javascript to render the table of contents,
|
21
|
-
the custom generator functions and style sheet all can be\nsupplied by your own,
|
22
|
-
if necessary. By default there are methods to insert tables, links, paragraphs,
|
23
|
-
preformatted text\nand arbitrary xhtml code. Due to the xml nature it is also easy
|
24
|
-
to insert SVG graphs / pictures.\n\n"
|
14
|
+
many utility functions.\n \nThe javascript to render the table of contents, the
|
15
|
+
custom generator functions and style sheet all can be\nsupplied by your own, if
|
16
|
+
necessary. By default there are methods to insert tables, links, paragraphs, preformatted
|
17
|
+
text\nand arbitrary xhtml code. Due to the xml nature it is also easy to insert
|
18
|
+
SVG graphs / pictures.\n\nCheckout the github project to see some examples.\n"
|
25
19
|
email: m-widmer@gmx.ch
|
26
20
|
executables: []
|
27
21
|
extensions: []
|
@@ -31,10 +25,11 @@ files:
|
|
31
25
|
- README.md
|
32
26
|
- lib/xhtml_report_generator.rb
|
33
27
|
- lib/xhtml_report_generator/custom.rb
|
34
|
-
- lib/xhtml_report_generator/jquery.js
|
28
|
+
- lib/xhtml_report_generator/jquery.min.js
|
35
29
|
- lib/xhtml_report_generator/print_template.css
|
30
|
+
- lib/xhtml_report_generator/split.min.js
|
36
31
|
- lib/xhtml_report_generator/style_template.css
|
37
|
-
- lib/xhtml_report_generator/toc.js
|
32
|
+
- lib/xhtml_report_generator/toc.min.js
|
38
33
|
- lib/xhtml_report_generator/version.rb
|
39
34
|
homepage: https://rubygems.org/gems/xhtml_report_generator
|
40
35
|
licenses:
|
@@ -48,7 +43,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
48
43
|
requirements:
|
49
44
|
- - ">="
|
50
45
|
- !ruby/object:Gem::Version
|
51
|
-
version:
|
46
|
+
version: 2.0.0
|
52
47
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
48
|
requirements:
|
54
49
|
- - ">="
|
@@ -59,5 +54,6 @@ rubyforge_project:
|
|
59
54
|
rubygems_version: 2.4.5.1
|
60
55
|
signing_key:
|
61
56
|
specification_version: 4
|
62
|
-
summary: A simple html or xhtml generator to create human readable
|
57
|
+
summary: A simple html or xhtml generator or logger to create human readable reports
|
58
|
+
and logs
|
63
59
|
test_files: []
|