News
21/09/2001
The last nast known bug killed, now it works fine.
To test html_ssi_lua.rb you need to get "strscan" http://www.ruby-lang.org/en/raa-list.rhtml?name=strscan


??/??/??
The first version was a lot bug it was doing a mess in the lua stack, now I know a bit
more how the things work.

This version has some improvements.

class Lua
    def initialize([stacksize=1024][,'baselib'[,'strlib'[,'iolib'[,'mathlib'[,'dblib]]]]])
	# lua_interpreter = Lua.new('strlib')
	# initialize a Lua instance with 1024 stack spaces and enable the use of strlib
    end
    
    def eval(lua_str_code)
	#evaluate the lua code and add it to the interpreter context
    end
    
    def get(lua_var_name)
	# get the value of "lua_var_name"
    end
    
    def set(lua_var_name, value)
	# set a global variable "lua_var_name" with the value "value"
    end
    
    def setUserData(lua_var_name, value)
	# set a global variable "lua_var_name" with the ruby obj_id of "value"
    end
    
    def call(lua_function_name, arg1,...)
	#call a lua function named "lua_function_name" with the passed arguments
	#return the value returned by the lua function
    end
    
    def setFunc(as_lua_name,object, 'method or function name')
	#set a ruby function to be called by lua interpreter
    end
end



Old------------------------------

What is it supposed to be ?
A embebed interpreter for ruby where you can set the visibility and functionality we
want to expose to be used by auxiliar scripts, with ruby it's not possible right now
due to the way ruby is implemted.


Well this is a start point, only tested in linux using Lua 4 and ruby 1.64

I'm releasing it to try get some sugestions and help, you can reach me at domingo@dad-it.com.

Sorry and thanks for all.

Install:
Make the adjusts needed by your system in mk_lua (mainly -I -L -l  flags)
execute mk_lua

test it using irb:

Start irb in the same directory:

irb
irb> require 'lua'
irb> a = Lua.new(1024)
irb> a.eval('one_var = 34; string_var = "car"; hash_var = {}; hash_var.a = "hi people!"')
irb> a.get('one_var')
irb> 34
irb> a.get('hash_var')
irb> {a=>"hi people!"}
irb> rhash = {'dad'=>'father', 'set' => {'color'=>'red'}}
irb> a.set('vhash', rhash)
irb> a.get('vhash')
irb> {'dad'=>'father', 'set' => {'color'=>'red'}}
irb> b = Lua.new(1024)
irb> b.eval('a = 79')
irb> b.get('a')
irb> 79
irb> exit


