require 'formula' class Luarocks :optional def install # Install to the Cellar, but direct modules to HOMEBREW_PREFIX system "./configure", "--prefix=#{prefix}", "--rocks-tree=#{HOMEBREW_PREFIX}/lib/luarocks", "--sysconfdir=#{etc}/luarocks" system "make" system "make install" end def test opoo "Luarocks test script installs 'lpeg'" system "luarocks install lpeg" system "lua", "-lluarocks.loader", "-llpeg", "-e", 'print ("Hello World!")' end end