0.0
No commit activity in last 3 years
No release in over 3 years
Provides Lua binary on Windows
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
 Project Readme

Rufus::Lua::Win

Build status Gem Version

Provides Lua binary on Windows.

Embedding Lua into Ruby on Windows has two issues:

  1. There is no standard binary distributive for Lua
  2. Lua way of searching for libraries (rocks) fails

So, this gem embeds binary Lua (from LuaDist) and patches package.path and package.cpath.

Installation

You don't need to download, install or compile any Lua distribution. Just add this line to your application's Gemfile:

gem 'rufus-lua-win'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rufus-lua-win

Usage

Add two lines to Gemfile (in that order):

gem 'rufus-lua-win' if Gem.win_platform?
gem 'rufus-lua'

Rufus::Lua::Win will setup environment variables, so Rufus::Lua could load.

If not using bundler, just:

require 'rufus/lua/win' if Gem.win_platform?
require 'rufus/lua'

s=Rufus::Lua::State.new
s.eval "require 'lpeg'"
...

Lua Path

Rufus::Lua::Win overrides standard Lua search paths to point to its own Lua libraries.

Paths like ./?.lua or ./?.dll are excluded, since they are not very useful in embedded environment.

If you like to require your own files inside Rufus::Lua - put them in separate folder and add it to package.path (or package.cpath).

Credits

See also