Class: Orchestrator
- Inherits:
-
Object
- Object
- Orchestrator
- Defined in:
- lib/rubyplots/orchestrator.rb
Instance Method Summary collapse
- #addLatexFor(dataFile) ⇒ Object
- #generatePlots ⇒ Object
-
#initialize(tempLatexDirectory) ⇒ Orchestrator
constructor
A new instance of Orchestrator.
- #savePlotsAndCleanup(latexDir) ⇒ Object
Constructor Details
#initialize(tempLatexDirectory) ⇒ Orchestrator
Returns a new instance of Orchestrator.
17 18 19 20 21 22 |
# File 'lib/rubyplots/orchestrator.rb', line 17 def initialize(tempLatexDirectory) validateLatexPackages @tempLatexDirectory = tempLatexDirectory @latexFile = File.join(@tempLatexDirectory, 'RubyPlotsLatexFile.tex') writeOpeningTo @latexFile end |
Instance Method Details
#addLatexFor(dataFile) ⇒ Object
24 25 26 |
# File 'lib/rubyplots/orchestrator.rb', line 24 def addLatexFor(dataFile) ScatterPlot.new( dataFile, @latexFile ) end |
#generatePlots ⇒ Object
28 29 30 31 |
# File 'lib/rubyplots/orchestrator.rb', line 28 def generatePlots writeClosingTo @latexFile compile @latexFile end |
#savePlotsAndCleanup(latexDir) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/rubyplots/orchestrator.rb', line 33 def savePlotsAndCleanup(latexDir) parentDir = File.dirname(latexDir) plotsToKeep = Dir.glob(latexDir + File::SEPARATOR + "rubyplots-*.pdf") plotsToKeep.each do |plot| FileUtils.move(plot, parentDir, {:force => true}) end # Todo: Review options for this remove - this is unsecure right now. FileUtils.rm_rf @tempLatexDirectory end |