Coder Social home page Coder Social logo

guilleiguaran / dart-compiler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from heapsource/dart-compiler

0.0 2.0 0.0 33.74 MB

A Ruby Wrapper for the Dart Compiler. Active fork: http://github.com/firebaseco/dart-compiler

Home Page: https://github.com/firebaseco/dart-compiler

License: Other

dart-compiler's Introduction

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.

dart-compiler's People

Contributors

jashkenas avatar kares avatar josh avatar ghazel avatar guilleiguaran avatar xiazek avatar lapluviosilla avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.