On Wed, Jul 20, 2011 at 12:55 PM, steve donovan <[email protected]> wrote: > On Wed, Jul 20, 2011 at 4:17 PM, Hisham <[email protected]> wrote: >> A curiosity: should you be able to do this in Lua 5.2 using the new >> package.searchpath function? I would suppose so, by finding the actual >> path of a module and then locating stylesheets and templates relative >> to it. > > Finding a module is easy enough (Penlight for instance implements > package.searchpath for Lua 5.1) but one can't assume that a project's > data is sitting in the same directory.
Yes, but one could assume it's setting somewhere down the same prefix. IOW, if package.searchpath returns /usr/share/lua/5.2/foo.lua, you'd know your package was compiled with que equivalent of --prefix=/usr, etc., and then you could extract that. > That would be most foreign to the Unix way of things, of course ;) Maybe the problem is that it is *too* Unix! Come to think of it, I'm afraid the problem would be to extract the prefix from a module path reliably on Windows! > As I understand, LR deploys > modules to their proper places, and leaves metadata in the rock dir. > So either I look relative to the rock dir, or ensure that the metadata > is installed in some known and appropriate position. Yes, this works, but I don't know if everyone would be happy with a LuaRocks "dependency". Anyway, you can't always please everyone... -- -- Hisham http://hisham.hm/ - http://colorbleed.com.br/ ------------------------------------------------------------------------------ 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks & Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ _______________________________________________ Luarocks-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/luarocks-developers
