Project

webruby

0.12
No commit activity in last 3 years
No release in over 3 years
compile your favourite Ruby source code for the browser!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Introduction

This project brings mruby to the browser. It uses [emscripten] (https://github.com/kripken/emscripten) to compile the mruby source code into JavaScript and runs in the browser.

Build Status

Since emscripten SDK does not provide pre-built binaries for Linux, we cannot use Travis CI right now. We want to be nice and don't try to rebuild whole LLVM each time we are pushing new code :)

How to Install

Webruby now depends on emsdk to provide emscripten and LLVM infrustructure. To install webruby, following the following steps:

  1. Install emsdk following instructions at here
  2. Install latest incoming version of emscripten sdk(right now webruby still depends on code from incoming branch of emscripten, once this goes into a release version, we will lock the version for better stability)
  3. Activate latest incoming version
  4. Webruby should be able to pick up the correct version of emscripten from emsdk. If not, feel free to create an issue :)

Notes

Thanks to @scalone and @sadasant, webruby is already used in production: http://rubykaigi.org/2014/presentation/S-ThiagoScalone-DanielRodriguez

However, you might still want to give it a full test before using it in production :)

Demos

  • webruby irb - A nice-looking full-fledged webruby irb. Thanks to @joshnuss for his work!
  • Webruby tutorial - minimal example of webruby project, a full description is at here
  • mruby - This is only a minimal demo of web irb, if you want to try out mruby in a browser, I strongly suggest the demo above.
  • geometries - a WebGL example using webruby, mruby-js and three.js. NOTE: from a practical point of view, I agree that this can be easily implemented using JS. However, this demo shows how easy it is to interact with the JavaScript environment using Ruby.

License

This project is distributed under the MIT License. See LICENSE for further details.