On Monday, 1 April 2013 at 19:21, Hisham wrote:

> On 30 March 2013 08:56, Gaspard Bucher <gasp...@teti.ch 
> (mailto:gasp...@teti.ch)> wrote:
> > Just a short question on assets.
> 
> 
> That's a good question. One issue with assets in general is how to
> find them, because LuaRocks expects that modules are built to be
> relocatable (ie, that they can be packed into a binary rock with
> `luarocks pack foo` and later be installed under a different prefix).
> If your installer hardcodes the installation path in order to find
> assets, we have a problem. We still haven't found a one-size-fits-all
> solution for this. (Ideas are welcome!)
> 
Hi Hisham,

We could just do it like others do it: store assets besides script code. I have 
created many ruby gems and there is no such restriction with the their 
deployment strategy: it is common place to store assets inside the gem (for 
example, the "Ruby on Rails" gem contains "view.html.erb" files right inside 
"lib").

Since the assets end in ".js" or ".css", there is no risk of trying to load 
these as Lua files by doing require "lub.doc.css.bootstrap" or some other silly 
thing. The extension is already a good and properly working filter: no need to 
add some other filtering scheme based on file paths.

Finding them is then trivial, for the code itself and for users: just browse 
around the code. For example lub.path (http://doc.lubyk.org/lub.html#path) uses 
the debug library to find running script path so this is robust and relocatable.

Gaspard
------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
Luarocks-developers mailing list
Luarocks-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to