Sha256: 83f3a2adf8fe77240faf2221c8bffba767ec36870ae98567cb7baed37d807915

Contents?: true

Size: 415 Bytes

Versions: 1

Compression:

Stored size: 415 Bytes

Contents

#!/usr/bin/env ruby
require 'thor'
require 'yagg'
class YaggRunner < Thor
  desc 'generate IN [OUT]', 'generate a ruby file from given .y file'
  def generate(infile, outfile = "-")
    u = Yagg::Parser.new File.read infile
    u.parse
    v = Yagg::Generator.new u.result
    if outfile == "-"
      puts v.generate
    else
      open(outfile, "w") do |f| f.write v.generate end
    end
  end

  start ARGV
end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yagg-0.1.1 exe/yagg