Page 2 of 2

Re: Require error after zipping folder into .love file

Posted: Thu Jan 27, 2011 5:52 pm
by Robin
That might also explain why having a directory and a file with the same name + ".lua" fails. On the other hand, it might not.
kikito wrote:I mean, middleclass-extras has been already used in other .love files, hasn't it?
IIRC, I do it like this:

Code: Select all

/
    main.lua
    /middleclass-extras
        /middleclass

Re: Require error after zipping folder into .love file

Posted: Fri Jan 28, 2011 11:06 am
by kikito
Mmm.

So what are the options?

Should I rename middleclass & middleclass-extras to something shorter ? I really like 'middleclass' It's got some punch.

The folder layout I'd prefer would be having middleclass-extras is inside middleclass; maybe calling its folder 'extras':

Code: Select all

middleclass/
  |
  +- middleclass.lua
  +- LICENSE.txt
  +- init.lua
  `- extras/ -> middleclass-extras here
So the require would be

Code: Select all

require 'middleclass'
require 'middleclass.extras'
Or is there a flag that can be activated on physfs that prevents this from happening?

Re: Require error after zipping folder into .love file

Posted: Fri Jan 28, 2011 12:19 pm
by Robin
Oh, by the way, I think you can make require "middleclass" work by renaming init.lua to __init.lua. IIRC it is one of the locations checked.

Re: Require error after zipping folder into .love file

Posted: Fri Jan 28, 2011 5:08 pm
by thelinx
Robin wrote:Oh, by the way, I think you can make require "middleclass" work by renaming init.lua to __init.lua. IIRC it is one of the locations checked.
No, it's "init.lua".

Re: Require error after zipping folder into .love file

Posted: Fri Jan 28, 2011 5:45 pm
by Robin
thelinx wrote:
Robin wrote:Oh, by the way, I think you can make require "middleclass" work by renaming init.lua to __init.lua. IIRC it is one of the locations checked.
No, it's "init.lua".
:ehem: Never mind then.

Re: Require error after zipping folder into .love file

Posted: Fri Jan 28, 2011 7:00 pm
by TechnoCat
No more talking in tongues __Init__.py