Class: GnuplotRenderer::PlotHelper
- Inherits:
-
Object
- Object
- GnuplotRenderer::PlotHelper
- Defined in:
- lib/gitstats/renderer/gnuplot.rb
Defined Under Namespace
Classes: Plotter
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#outdir ⇒ Object
readonly
Returns the value of attribute outdir.
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Instance Method Summary collapse
- #defplot(&block) ⇒ Object
-
#initialize(templatedir, filename, outdir, stats, verbose) ⇒ PlotHelper
constructor
A new instance of PlotHelper.
- #run(lines) ⇒ Object
Constructor Details
#initialize(templatedir, filename, outdir, stats, verbose) ⇒ PlotHelper
Returns a new instance of PlotHelper.
106 107 108 109 110 111 112 113 114 115 |
# File 'lib/gitstats/renderer/gnuplot.rb', line 106 def initialize(templatedir, filename, outdir, stats, verbose) @filename = filename @outdir = outdir @stats = stats @verbose = verbose Dir.glob(File.join(templatedir, 'helpers', '*.rb')).sort.each do |file| eval(IO::readlines(file).join('')) end end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
101 102 103 |
# File 'lib/gitstats/renderer/gnuplot.rb', line 101 def filename @filename end |
#outdir ⇒ Object (readonly)
Returns the value of attribute outdir.
102 103 104 |
# File 'lib/gitstats/renderer/gnuplot.rb', line 102 def outdir @outdir end |
#stats ⇒ Object (readonly)
Returns the value of attribute stats.
103 104 105 |
# File 'lib/gitstats/renderer/gnuplot.rb', line 103 def stats @stats end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
104 105 106 |
# File 'lib/gitstats/renderer/gnuplot.rb', line 104 def verbose @verbose end |
Instance Method Details
#defplot(&block) ⇒ Object
121 122 123 124 |
# File 'lib/gitstats/renderer/gnuplot.rb', line 121 def defplot(&block) plotter = Plotter.new(self) plotter.run(&block) end |
#run(lines) ⇒ Object
117 118 119 |
# File 'lib/gitstats/renderer/gnuplot.rb', line 117 def run(lines) eval(lines) end |