mruby library bindings for Crystal. Currently only unsafe, generated bindings. Very much a work-in-progress.
- Install
llvm
and any dependencies required for mruby on your platform
- On macOS,
brew install llvm
will install the required dependencies (Xcode LLVM may work fine on more recent macOS versions.)
-
Add the dependency to your
shard.yml
:dependencies: mruby: github: maxfierke/mruby.cr
-
Run
shards install
-
Run
cd lib/mruby && make
to generate the lib binding. (May want to do this in yourMakefile
or other build configuration)
require "mruby"
mrb = LibMRuby.mrb_open
code = "5.times { puts 'mruby is awesome!' }"
LibMRuby.mrb_load_string(mrb, code)
LibMRuby.mrb_close(mrb)
See src/lib_mruby.cr
once generated to view exposed methods (currently only those from mruby.h
and mruby/compile.h
)
- Follow Installation step 0 to get the required libraries installed.
- If you're on macOS, ensure
gnu-sed
is installed. (e.g.brew install gnu-sed
)
- If you're on macOS, ensure
- Run
make
to generate the lib bindings - Run
make spec
to run the tests
- Fork it (https://github.com/maxfierke/mruby.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Max Fierke - creator and maintainer