RubyLuaBridge lets you access Lua from Ruby. Eventually, support for accessing Ruby from Lua will be added. This documentation assumes basic knowledge of Ruby and Lua.
This is a fork of the original BitBucket repository that packages the files into a RubyGem.
Relevant web pages:
This fork of RubyLuaBridge has packaged the files as a RubyGem. To build the gem and install:
% gem build rubyluabridge.gemspec
% gem install rubyluabridge-0.7.0 -- --with-lua-include=/usr/include/lua5.1 --with-lualib=lua5.1
You should replace the Lua configuration options with your appropriate platform's locations.
- Simplest marshalling possible
- Simplest API possible
- Do more complicated things in Lua itself, rather than exposing them! For
example, the coroutine library is not explicitly exposed because it can be
handled all through
eval
and indexing:l.coroutine.create(f)
Ruby | Lua |
nil | nil |
None | nil |
True | true |
False | false |
Fixnum | number |
Bignum | number |
Float | number |
String | string |
Symbol | string |
Hash | new Lua::Table clone |
Array | new Lua::Table clone |
Other | lightuserdata |
Lua | Ruby |
none | nil |
nil | nil |
true | True |
false | False |
number | Float |
string | String |
table | Lua::Table |
lightuserdata | Lua::RefObject |
function | Lua::RefObject |
userdata | Lua::RefObject |
thread | Lua::RefObject |
- Stack trace in error callback
- How to get some external
lua_State
there? - How to deal with
.clone()
and.dup()
? - Accessing Ruby from Lua
The following persons have contributed to RubyLuaBridge:
- Evan Wies (evan a neomantra d net)
RubyLuaBridge is inspired by, but not derived from:
Download the latest sources from there. Please use the mailing list and issue tracking features as well.
I am particularly interested in problems you may have on various systems. I have tested it in Ubuntu Linux and OS X.