On 02/15, David Lutterkort wrote:
> On Fri, 2013-02-15 at 11:36 +0100, mfoj...@redhat.com wrote:
> > From: Michal Fojtik <mfoj...@redhat.com>
> > 
> > Before this patch, we used to initialize stuff like database
> > or mock directories in random places in source code.
> > 
> > This patch should make all initialization happen in one place.
> 
> ACK.  Bringing some order into the initialization process is long
> overdue ...
> 
> > diff --git a/server/config.ru b/server/config.ru
> > index 406c769..305ab4b 100644
> > --- a/server/config.ru
> > +++ b/server/config.ru
> ...
> 
> > +load File.join(File.dirname(__FILE__), 'lib', 'initialize.rb')
> 
> Why load ? Do we ever want to run initialization more than once ? If
> not, require_relative would be enough.

With require_relative I get this result:

/home/mfojtik/code/core/server/config.ru:19:in `require_relative': cannot
infer basepath (LoadError)
  from /home/mfojtik/code/core/server/config.ru:19:in `block in <main>'

The 'require' works using the 'relative' path under 1.9 but not in 1.8...

That was the reason to use 'load'. We are not loading the 'config.ru' so
the 'load' method should not make any damage here...

  -- Michal

-- 
Michal Fojtik <mfoj...@redhat.com>
Deltacloud API, CloudForms

Reply via email to