Method: Wireframe::Application.run!

Defined in:
lib/wireframe/application.rb

.run!(*arguments) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/wireframe/application.rb', line 4

def run!(*arguments)
  if arguments.size != 3
    puts "usage: wireframe image <size> <output file>"
    exit 1
  end

  class_name, coordinates, output = arguments
  sketcher = Wireframe.const_get class_name.capitalize
  image = sketcher.new coordinates  
  File.open(output, 'w') {|f| f.write(image.draw)}
end