mruby.cr
mruby
mruby library bindings for Crystal. Currently only unsafe, generated bindings. Very much a work-in-progress.
Installation
- Install
llvmand any dependencies required for mruby on your platform
- On macOS,
brew install llvmwill 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 && maketo generate the lib binding. (May want to do this in yourMakefileor other build configuration)
Usage
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)
Development
- Follow Installation step 0 to get the required libraries installed.
- If you're on macOS, ensure
gnu-sedis installed. (e.g.brew install gnu-sed)
- If you're on macOS, ensure
- Run
maketo generate the lib bindings - Run
make specto run the tests
Contributing
- 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
Contributors
- Max Fierke - creator and maintainer
Repository
mruby.cr
Owner
Statistic
- 6
- 0
- 0
- 0
- 0
- almost 5 years ago
- October 9, 2019
License
MIT License
Links
Synced at
Fri, 31 Oct 2025 00:23:55 GMT
Languages