lua-users home
lua-l archive

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


On 14 March 2013 08:53, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Thu, Mar 14, 2013 at 10:08 AM, John Labenski <jlabenski@gmail.com> wrote:
>> I don't believe I've seen this, is there anything wrong with doing
>> this and why isn't it done now?
>
> LuaRocks has always had support for strict versioning, if you allow it
> to patch your require:
>
> http://luarocks.luaforge.net/luadoc/modules/luarocks.require.html

Nowadays, that should read "if you allow it to load its own package
loader", which is a more elegant thing to do.

https://github.com/keplerproject/luarocks/blob/master/src/luarocks/loader.lua

> But most users found it fussy and just wanted things to work, poor things.

Yes, by default it will assume you just want to load the latest
version of each module, but if a user has the concerns John has about
versioning and don't mind paying the price of an extra check during
require(), one can load luarocks.loader (`lua -lluarocks.loader
script.lua`, for example) and let LuaRocks sort it out. The loader
will use the dependency information specified in the rockspec (cached
in the manifest file).

-- Hisham
http://hisham.hm/