Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Use extend Lua using Ruby with MRuby
C Ruby Lua
tree: 824a2134ad

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
.gitmodules
Makefile
README.md
Rakefile
mruby-0.1-0.rockspec

README.md

lua-mruby

Use mruby from within lua.

Install

$ rake

Usage

Simple

require "mruby"

mruby.run(" puts 'Hello, world!' ")

Advanced

NOTE: This has not been implemented yet.

All MRuby C functions have been ported directly to Lua.

mrb = mrbOpen()
mrbCode = " puts 'Hello, World!' "
mrbParserState = mrbParseString(mrb, mrbCode, nil)
mrbGeneratedCode = mrbGenerateCode(mrb, mrbParserState.tree)
mrbResult = mrbRun( mrb, mrbProcNew(mrb, mrb.irep[mrbGeneratedCode]), mrbNilValue() )
mrbClose(mrb)

Or use the mruby helper table:

mrb = mruby.new()
mrb.assign("$myname", "RyanScottLewis")
mrb.run("puts $myname")

calculationResult = mrb.eval("10 + 10")
print(calculationResult) -- 20

Acknowlegements

matsumoto-r for mruby-on-Lua. This wouldn't exist, if not for him.

Copyright

Copyright © 2012 Ryan Scott Lewis ryan@rynet.us.

The MIT License (MIT) - See LICENSE for further details.

Something went wrong with that request. Please try again.