Skip to content

mfeckie/ember-cli-opal-rb

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Codeship Status for mfeckie/ember-cli-opal-rb

Ember-cli-opal-rb

Opal.rb is a Ruby to JavaScript compiler.

This addon simply includes Opal as a Service in your Ember application.

Installation

ember install ember-cli-opal-rb

Usage

There are only really two methods exposed compileRuby and run

Here's an example of there usage.

import Ember from 'ember';

export default Ember.Component.extend({
  opal: Ember.inject.service(),
  someFunc: function () {
    var compiler = this.get('opal')
    var textToCompile = this.get('text');

    //This will give you the Ruby code as JS
    var compiled = compiler.compileRuby(textToCompile);
    //This will compile and execute the Ruby code
    compiler.run(textToCompile);
  }
});

Dummy app

If you clone the repo and run the server there is an example of a live Ruby to JS converter.

Running

Running Tests

  • ember try:testall

About

Include Opal.rb in your Ember projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published