Skip to content

heapsource/dart-compiler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Dart Compiler (as a Ruby Gem)

The dart-compiler gem is a svelte wrapper around the Dart Compiler (Dart to JavaScript compiler)

The Dart Compiler’s 2011-10-12 JAR-files are included with the gem.

This wrapper is largelly based in Closure Compiler by DocumentCloud

Installation

sudo gem install dart-compiler

Usage

The Dart::Compiler has a single method, compile, which can be passed a string or an open IO object, and returns the compiled JavaScript. The result is returned as a string.

require 'rubygems'
require 'dart-compiler'
Dart::Compiler.new.compile(File.open('hello.dart', 'r'))

=> "function native_ArrayFactory__new(typeToken, length) {......

When creating a Dart::Compiler, you can pass any options that the command-line compiler accepts to the initializer and they’ll be forwarded.

A Dart::Error exception will be raised, explaining the Dart syntax error, if compilation fails for any reason.

About

A Ruby Wrapper for the Dart Compiler

Resources

License

Unknown, Apache-2.0 licenses found

Licenses found

Unknown
LICENSE
Apache-2.0
COPYING

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%