lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I want my test scripts to use the version of luajson that is in the source
> tree (configured using package.path), however the luarocks.require uses the
> package in the luarocks repository instead.

In case you are on UNIX:

What we do with Sputnik [1] is symlink the corresponding parts of the
source tree into the rocks directory.  If you have your code in
my_source/luajson/lua, then you should symlink and your rocks are in,
say, ~/luarocks/rocks/, then you would want to symlink
my_source/luajson to ~/luarocks/rocks/luajson/cvs-1.  After that, run
"luarocks-admin make-manifest".  You will need to make sure that
my_source/luajson/ has a file called "rockspec", though at the moment
it appears that LuaRocks does not care what this file contains.  (Just
touching it would be enough.)

Once you have your code symlinked into luajson/cvs-1, LR will default
to this rock.  ("cvs-1" is considered the latest version and takes
priority over all other ones.  And, btw, you do not have to be using
CVS for this to work.)  If you later want to go back to the rock you
installed the proper way, just rm the "cvs-1" directory.

We have a script [2] that we use to make all of this easier, so to
connect a source tree directory to rocks, I run

sh scripts/link_rock.sh -r <rocks_dir> -i <lua_installation_dir> <rock_name>

e.g.:

sh scripts/link_rock.sh -r /tmp/sputnik/rocks/ -i /tmp/sputnik/ xssfilter

Another thing: LuaRocks has its own mailing list [3] that may be a
better place for this question.

- yuri

[1]: sputnik.freewisdom.org/
[2]: http://gitorious.org/projects/sputnik/repos/mainline/blobs/master/scripts%2Flink_rock.sh
[3]: http://lists.luaforge.net/pipermail/luarocks-developers/