Does luarocks management have "./node_modules" equivalent for projects?
lua, luarocks
Solution
It is possible to install rocks into a directory under the current directory, using the `--tree` flag:
luarocks install --tree ./lua_modules lpeg
And then you have to configure your `package.path` and `package.cpath` variables in Lua (settable via `LUA_PATH` and `LUA_CPATH` environment variables) so it finds the modules installed inside it. There are several ways to do this conveniently: this tutorial explains how to do it, with more examples.
Problem
In NodeJS/NPM, you can create a `package.json` and run `npm install` to install all your dependencies in a folder within your project: `./node_modules`. (A project can be an app or another module/package.) Ruby also has a "bundler" system (using a .bundle file) that keeps track of gems specific to a dir (ie project). Does LuaRocks have similar conventions? Or is it recommeneded to install everything to `/usr` or `$HOME`? So far I've been able to get similiar functionality, but I have to create a custom LuaRocks config file and specify `--tree=my_local_lua_rocks_dir` every time I want to install a rock. Granted, I can always create a bash script. The point is that it seems I'm going against a convention.