Changeset 37 in mp3-find for trunk/lib


Ignore:
Timestamp:
07/11/06 19:12:19 (18 years ago)
Author:
peter
Message:
  • added a "destory" utility method
  • marked "destroy_db" as deprecated
  • fixed some typos in the docs
  • added Matt Dietrich's email address to docs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/MP3/Find/DB.pm

    r34 r37  
    137137fluctuations for now. 
    138138 
    139 B<Deprecated Methods:> C<create_db>, C<update_db>, and C<sync_db> 
    140 have been deprectaed in this release, and will be removed in a future 
    141 release. PLease switch to the new methods C<create>, C<update>, and 
    142 C<sync>. 
     139B<Deprecated Methods:> C<create_db>, C<update_db>, C<sync_db>, and 
     140C<destroy_db> have been deprecated in this release, and will be  
     141removed in a future release. Please switch to the new methods C<create>, 
     142C<update>, C<sync>, and C<destory>. 
    143143 
    144144=head2 Special Options 
     
    509509} 
    510510 
    511 =head2 destroy_db 
     511=head2 destroy 
     512 
     513    $finder->destroy({ db_file => $filename }); 
     514 
     515Permanantly removes the database. Unlike the other utility methods, 
     516this one can only act on SQLite C<db_file> filenames, and not DSNs 
     517or database handles. 
     518 
     519=cut 
     520 
     521sub destroy { 
     522    my $self = shift; 
     523    my $args = shift; 
     524 
     525    # XXX: this method only knows how to deal with SQLite files; 
     526    # is there a way to DROP a database given a $dbh? 
     527 
     528    my $db_file = $args->{db_file} or croak "Need a db_file argument"; 
     529 
     530    # actually delete the thing 
     531    unlink $db_file; 
     532} 
     533 
     534=head2 destroy_db (DEPRECATED) 
    512535 
    513536    $finder->destroy_db($db_filename); 
     
    517540=cut 
    518541 
    519 # TODO: use DSNs instead of SQLite db names (this might get funky) 
    520542sub destroy_db { 
    521543    my $self = shift; 
     
    580602=head1 THANKS 
    581603 
    582 Thanks to Matt Dietrich for suggesting having an option to just  
    583 update specific files instead of doing a (longer) full search. 
     604Thanks to Matt Dietrich <perl@rainboxx.de> for suggesting having an  
     605option to just update specific files instead of doing a (longer) full 
     606search. 
    584607 
    585608=head1 COPYRIGHT AND LICENSE 
Note: See TracChangeset for help on using the changeset viewer.