I recently discovered this myself. There is a fix on the way in Poet 0.12. Let 
me know if that solves it.

Jon

On Aug 2, 2012, at 4:24 AM, Kamil Niechajewicz wrote:

> Hello,
> I seem to have a problem getting my subclass of Poet::Conf to work properly. 
> From what I've read in docs, it should work straight away - after creating 
> Poet installation, it creates MyApp::Conf which should be used instead of 
> original Poet::Conf. 
> 
> Problem is - its not getting loaded. My $conf class is Poet::Conf. I have no 
> idea why, but I checked Poet/Environment.pm and I think there may be a 
> problem of app_class() call being dependent on configuration / layer. This 
> means that $conf is created before environment is really initialized, so when 
> app_class('Conf') is called, it tries to load MyApp::Conf, but there is no 
> lib_path yet in @INC, so it fails loading and falls back to Poet::Conf.
> 
>     $self->{conf} =
>       $self->app_class('Conf')
>       ->new( root_dir => $root_dir, conf_dir => catdir( $root_dir, "conf" ) );
>     print $self->app_class('Conf');
>         my $conf = $self->{conf};
> 
> This all happens before initialize_current_environment is called, and sets 
> @INC. Later in application, when I do $poet->app_class('Conf') I get 
> MyApp::Conf, but its too late, and original $conf is using "system" class 
> Poet::Conf instead of mine.
> 
> Any ideas how to make Poet use MyClass::Conf instead of default one? Is this 
> a known issue?
> 
> Regards,
> KN
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. 
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to