class Architect::Runner

Draws a diagram from a file

Public Class Methods

new(file, ext) click to toggle source
# File lib/architect/runner.rb, line 8
def initialize(file, ext)
  @drawer = Architect::Diagram.new()
  diagram = Kernel.open(file).read()
  output_file = change_extension(file, ext)
  @drawer.draw(diagram, output_file)
end

Public Instance Methods

change_extension(file, new_ext) click to toggle source
# File lib/architect/runner.rb, line 15
def change_extension(file, new_ext)
  ext = File.extname(file).gsub(".","")
  return file.gsub(ext, new_ext)
end