Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattn/mruby-require
https://github.com/mattn/mruby-require
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mattn/mruby-require
- Owner: mattn
- Created: 2013-01-07T02:21:06.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2023-05-17T13:53:19.000Z (over 1 year ago)
- Last Synced: 2024-11-02T03:11:55.486Z (12 days ago)
- Language: C
- Size: 106 KB
- Stars: 38
- Watchers: 10
- Forks: 22
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mruby-require
[![Build Status](https://travis-ci.org/mattn/mruby-require.svg)](https://travis-ci.org/mattn/mruby-require)
mruby-require adds require support to mruby.
This is based on iij's fork of mruby: https://github.com/iij/mruby## install by mrbgems
```ruby
MRuby::Build.new do |conf|
if ENV['OS'] != 'Windows_NT' then
conf.cc.flags << %w|-fPIC| # needed for using bundled gems
end
# ... (snip) ...
conf.gem :github => 'mattn/mruby-require'
end
```To work properly, mruby-require must be the last mrbgem specified in the build configuration. Any mrbgem specified *after* mruby-require is compiled as a shared object (`.so`) and put in `build/host/lib` (full path available in `$:`). For loading them at runtime, see the next section.
## Requiring additional mrbgems
When mruby-require is being used, additional mrbgems that appear *after* mruby-require in build_config.rb must be required to be used.For example, if using mruby-onig-regexp, you should add the following to your code:
````ruby
require 'mruby-onig-regexp'
````## Requiring mrbgems in defaults
Set MRUBY_REQUIRE environment variable as comma separated values like following```
MRUBY_REQUIRE=mruby-onig-regexp,mruby-xquote
```## License
MIT