tdx 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tdx/base.rb +25 -10
- data/lib/tdx/version.rb +1 -1
- data/test/test_tdx.rb +7 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8822d54719e4ebd4345f9157dc287e7332fcadaf
|
4
|
+
data.tar.gz: 8f758413580f26844bf634bef6e9fcfaf4f7542c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4770e249fe8e108daeda336c404cc4be4f8a282d4591a24f3f96b52a3d8f82b8da1de320a1b96aed814651096d14224fbfdcd02da515e268e09dd61efa841054
|
7
|
+
data.tar.gz: 545c2b9c38e7c6203e08bdb70ec50d0f21351a77b5800554a107251e5b3aa53ad9b74429ce8d9d244ad5a539fb2b28f50ba1aa4fdf58c1ac64a368ff5a8ce55d
|
data/lib/tdx/base.rb
CHANGED
@@ -88,23 +88,38 @@ module TDX
|
|
88
88
|
svg = Tempfile.new('tdx')
|
89
89
|
gpi = [
|
90
90
|
"set output \"#{svg.path}\"",
|
91
|
-
'set terminal svg size
|
91
|
+
'set terminal svg size 720, 360',
|
92
|
+
'set lmargin 7',
|
93
|
+
'set rmargin 5',
|
92
94
|
'set termoption font "monospace,10"',
|
93
95
|
'set xdata time',
|
96
|
+
'set border lc rgb "gray"',
|
97
|
+
'set style fill solid',
|
98
|
+
'set boxwidth 0.75 relative',
|
94
99
|
'set timefmt "%Y-%m"',
|
95
|
-
'set ytics format "%.0f" textcolor rgb "black"',
|
96
|
-
'set y2tics format "%.0f" textcolor rgb "orange"',
|
97
100
|
'set grid linecolor rgb "gray"',
|
98
|
-
'set xtics format "%b/%y" font "monospace,8" textcolor rgb "black"',
|
99
101
|
'set autoscale y',
|
102
|
+
'set multiplot layout 2,1',
|
103
|
+
'set ytics format "%.0fK" textcolor rgb "black"',
|
104
|
+
'set y2tics format "%.0f" textcolor rgb "#DA6D1A"',
|
100
105
|
'set autoscale y2',
|
101
|
-
'
|
102
|
-
|
106
|
+
'unset xtics',
|
107
|
+
[
|
108
|
+
"plot \"#{dat.path}\"",
|
109
|
+
' u 1:($2/1000) w l t "Code" lw 2 lc rgb "#2B7947"',
|
110
|
+
', "" u 1:($3/1000) w l t "Tests" lw 2 lc rgb "#C80604"',
|
111
|
+
', "" u 1:4 w l t "Issues" lc rgb "#DA6D1A" axes x1y2'
|
112
|
+
].join(' '),
|
113
|
+
'unset y2tics',
|
114
|
+
'unset title',
|
115
|
+
'set tmargin 0',
|
116
|
+
'set xtics format "%b/%y" font "monospace,8" textcolor rgb "gray"',
|
117
|
+
'set ytics format "%.0f%%" textcolor rgb "#C80604"',
|
103
118
|
[
|
104
|
-
"plot \"#{dat.path}\"
|
105
|
-
'
|
106
|
-
|
107
|
-
|
119
|
+
"plot \"#{dat.path}\"",
|
120
|
+
'u 1:(100*$3/($2+$3)) pt 7 ps 1 lc rgb "#C80604" notitle'
|
121
|
+
].join(' '),
|
122
|
+
'unset multiplot'
|
108
123
|
]
|
109
124
|
Exec.new("gnuplot -e '#{gpi.join('; ')}'").stdout
|
110
125
|
FileUtils.rm_rf(path)
|
data/lib/tdx/version.rb
CHANGED
data/test/test_tdx.rb
CHANGED
@@ -56,12 +56,13 @@ class TestPDD < Minitest::Test
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def test_real_github_repo
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
)
|
59
|
+
f = '/tmp/tdx.svg'
|
60
|
+
svg = TDX::Base.new(
|
61
|
+
'https://github.com/yegor256/empty.git',
|
62
|
+
opts(['--tests', 'src/test/**/*'])
|
63
|
+
).svg
|
64
|
+
File.write(f, svg)
|
65
|
+
assert(svg.include?('<path '))
|
65
66
|
end
|
66
67
|
|
67
68
|
private
|