Sha256: 5b66890b42d5505caf1870cd09913dbb01a9577cc2f92f354008505e8c3517c8

Contents?: true

Size: 577 Bytes

Versions: 8

Compression:

Stored size: 577 Bytes

Contents

require "take/unit/predict_match"
require "take/unit/ast"
require "take/unit/compiler"
require "take/unit/scanner"
require "take/unit/generator"

module Take

  # A unit test.  This is used to generate c files for tests.
  class Unit

    def self.create(file)
      file = File.open(file, "r")
      scanner = Scanner.new(file.read)
      compiler = Compiler.new(file.path, scanner.scan)
      generator = Generator.new(compiler.compile,
        directory: File.dirname(file.path)).tap(&:generate)
      generator.write_file(file.path.gsub(/\..*\z/, ".c"))
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
take-0.0.15 lib/take/unit.rb
take-0.0.14 lib/take/unit.rb
take-0.0.13 lib/take/unit.rb
take-0.0.12 lib/take/unit.rb
take-0.0.11 lib/take/unit.rb
take-0.0.10 lib/take/unit.rb
take-0.0.9 lib/take/unit.rb
take-0.0.8 lib/take/unit.rb