Class: GnuplotRenderer::PlotHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/gitstats/renderer/gnuplot.rb

Defined Under Namespace

Classes: Plotter

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#filenameObject (readonly)

Returns the value of attribute filename.



101
102
103
# File 'lib/gitstats/renderer/gnuplot.rb', line 101

def filename
  @filename
end

#outdirObject (readonly)

Returns the value of attribute outdir.



102
103
104
# File 'lib/gitstats/renderer/gnuplot.rb', line 102

def outdir
  @outdir
end

#statsObject (readonly)

Returns the value of attribute stats.



103
104
105
# File 'lib/gitstats/renderer/gnuplot.rb', line 103

def stats
  @stats
end

#verboseObject (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