Sha256: df750ce5c74d835b84c44fd38398a2d2c0f18f0457d084ddcf5e88fc55d40272

Contents?: true

Size: 664 Bytes

Versions: 1

Compression:

Stored size: 664 Bytes

Contents

class Rasem::Application
  def self.run!(*argv)
    if argv.empty?
      source_files = Dir.glob(File.expand_path("*.rasem"))
    else
      source_files = argv
    end

    if source_files.empty?
      puts "No input files"
      return 1
    end

    for source_file in source_files
      puts "Source file #{source_file}"
      if source_file =~ /\.rasem$/
        svg_file = source_file.sub(/\.rasem$/, '.svg')
      else
        svg_file = source_file + ".svg"
      end
      File.open(svg_file, "w") do |f|
        Rasem::SVGImage.new(f, 100, 100) do
          eval(File.read(source_file), binding)
        end
      end
    end
    
    return 0
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rasem-0.5.1 lib/rasem/application.rb