[Bps-public-commit] r12455 - in Prophet/branches/luid: lib/Prophet
jesse at bestpractical.com
jesse at bestpractical.com
Sat May 17 05:37:26 EDT 2008
Author: jesse
Date: Sat May 17 05:37:26 2008
New Revision: 12455
Removed:
Prophet/branches/luid/lib/Prophet/Config.pm
Modified:
Prophet/branches/luid/ (props changed)
Prophet/branches/luid/lib/Prophet/App.pm
Prophet/branches/luid/lib/Prophet/Record.pm
Log:
r31162 at dhcp113 (orig r12423): sartak | 2008-05-17 16:37:41 +0900
r56127 at onn: sartak | 2008-05-17 03:37:34 -0400
Add t/delete.t which tests the explodey Record->delete_prop
Modified: Prophet/branches/luid/lib/Prophet/App.pm
==============================================================================
--- Prophet/branches/luid/lib/Prophet/App.pm (original)
+++ Prophet/branches/luid/lib/Prophet/App.pm Sat May 17 05:37:26 2008
@@ -4,15 +4,10 @@
package Prophet::App;
use base qw/Class::Accessor/;
use Path::Class;
-__PACKAGE__->mk_accessors(qw/_resdb_handle _config/);
+__PACKAGE__->mk_accessors(qw/_resdb_handle/);
use constant DEFAULT_REPLICA_TYPE => 'prophet';
-=head1 NAME
-
-Prophet::App
-
-=cut
sub _handle {
my $self = shift;
@@ -94,31 +89,5 @@
$@ = '';
}
-=head2 config
-
-If called with no arguments, returns the L<Prophet::Config> instance.
-
-If called with one arguments, returns the value of that config setting.
-
-If called with two arguments, sets the value of that config setting.
-
-=cut
-
-sub config {
- my $self = shift;
-
- unless ($self->_config) {
- require Prophet::Config;
- $self->_config(Prophet::Config->new);
- }
-
- return $self->_config if @_ == 0;
-
- my $key = shift;
- return $self->_config->get($key) if @_ == 0;
-
- my $value = shift;
- return $self->_config->set($key => $value);
-}
1;
Modified: Prophet/branches/luid/lib/Prophet/Record.pm
==============================================================================
--- Prophet/branches/luid/lib/Prophet/Record.pm (original)
+++ Prophet/branches/luid/lib/Prophet/Record.pm Sat May 17 05:37:26 2008
@@ -137,6 +137,7 @@
}
=head2 load { uuid => $UUID } or { luid => $UUID }
+=head2 load { luid => $UUID }
Loads a Prophet record off disk by its uuid or luid.
@@ -343,4 +344,17 @@
return $luid;
}
+=head2 find_or_create_luid
+
+Finds the luid for the records uuid, or creates a new one. Returns the luid.
+
+=cut
+
+sub find_or_create_luid {
+ my $self = shift;
+ my $luid = $self->handle->find_or_create_luid(uuid => $self->uuid);
+ $self->luid($luid);
+ return $luid;
+}
+
1;
More information about the Bps-public-commit
mailing list