My loader script:

#!/usr/bin/perl
use strict;
use warnings;

use lib '../lib';

use Rose::DB::Object::Loader;
use Dog::DB;
use Dog::DB::Base;


my $loader = 
    Rose::DB::Object::Loader->new(
        db           => Dog::DB->new,
        class_prefix => 'Dog::DB',
        base_classes => 'Dog::DB::Base'
    );

$loader->make_modules(
    #assumes this file is in project/scripts directory and that
    #there is a project/lib folder
    module_dir   => '../lib'
);

And the base class:

package Dog::DB::Base;
use strict;

use Dog::DB;

use Rose::DB::Object;
our @ISA = qw(Rose::DB::Object);

sub init_db { my $db = Dog::DB->new();
              $db->connect_option(AutoCommit => 0);
              $db->connect_option(RaiseError => 1);
              return $db; }

1;

However, the resulting classes from make_modules all have:

use Dog::DB;

sub init_db { Dog::DB->new({  }) }


Which isn't what I would expect.  In addition, I get the following error
with the empty hash:
No database information found for domain 'development' and type
'HASH(0x1b64d24)' at /Users/sdavis/Documents/workspace/DogDB/scrip
t/../lib/Dog/DB/Dog.pm line 26
Compilation failed in require at
/Users/sdavis/Documents/workspace/DogDB/script/../lib/Dog/DB/Dog/Manager.pm
line 3.
BEGIN failed--compilation aborted at
/Users/sdavis/Documents/workspace/DogDB/script/../lib/Dog/DB/Dog/Manager.pm
line 3.
Compilation failed in require at
/Users/sdavis/Documents/workspace/DogDB/script/../lib/Dog/HTML/DogForm.pm
line 7.
BEGIN failed--compilation aborted at
/Users/sdavis/Documents/workspace/DogDB/script/../lib/Dog/HTML/DogForm.pm
line 7.
Compilation failed in require at
/Users/sdavis/Documents/workspace/DogDB/script/../lib/DogDB.pm line 50.
BEGIN failed--compilation aborted at
/Users/sdavis/Documents/workspace/DogDB/script/../lib/DogDB.pm line 50.
Compilation failed in require at ./dogdb_server.pl line 49.

I'm not sure how one would like to deal with the situation where a
DB::Object base class already has an init_db defined; if the base classes
has an init_db defined, one would like to use that.  Any thoughts?

Sean




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to