Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.
/ rubyluabridge Public archive

RubyLuaBridge allows one to embed a Lua virtual machine in a Ruby program and seamlessly interact with it. This is the RubyGem repository.

License

Notifications You must be signed in to change notification settings

kpeng/rubyluabridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RubyLuaBridge

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:

Installation

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.

Design Philosophy

  • 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 to Lua Type Mapping

RubyLua
nilnil
Nonenil
Truetrue
Falsefalse
Fixnumnumber
Bignumnumber
Floatnumber
Stringstring
Symbolstring
Hashnew Lua::Table clone
Arraynew Lua::Table clone
Otherlightuserdata

Lua to Ruby Type Mapping

LuaRuby
nonenil
nilnil
trueTrue
falseFalse
numberFloat
stringString
tableLua::Table
lightuserdataLua::RefObject
functionLua::RefObject
userdataLua::RefObject
threadLua::RefObject

To Do

  • Stack trace in error callback
  • How to get some external lua_State there?
  • How to deal with .clone() and .dup()?
  • Accessing Ruby from Lua

Credits

The following persons have contributed to RubyLuaBridge:

  • Evan Wies (evan a neomantra d net)

RubyLuaBridge is inspired by, but not derived from:

Support

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.

About

RubyLuaBridge allows one to embed a Lua virtual machine in a Ruby program and seamlessly interact with it. This is the RubyGem repository.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages