Class: GnuplotRenderer

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

Defined Under Namespace

Classes: PlotHelper

Instance Method Summary collapse

Constructor Details

#initialize(templatedir, outdir, verbose) ⇒ GnuplotRenderer

Returns a new instance of GnuplotRenderer.



127
128
129
130
131
# File 'lib/gitstats/renderer/gnuplot.rb', line 127

def initialize(templatedir, outdir, verbose)
  @templatedir = templatedir
  @outdir = outdir
  @verbose = verbose
end

Instance Method Details

#handle?(file) ⇒ Boolean

Returns:

  • (Boolean)


137
138
139
# File 'lib/gitstats/renderer/gnuplot.rb', line 137

def handle?(file)
  file =~ /\.plot$/
end

#nameObject



133
134
135
# File 'lib/gitstats/renderer/gnuplot.rb', line 133

def name
  'gnuplot'
end

#render(file, stats) ⇒ Object



141
142
143
144
145
146
147
# File 'lib/gitstats/renderer/gnuplot.rb', line 141

def render(file, stats)
  ifile = File.join(@templatedir, file)

  lines = IO::readlines(ifile).join('')

  PlotHelper.new(@templatedir, file, @outdir, stats, @verbose).run(lines)
end