[Jifty-commit] r2048 - jifty/trunk/lib/Jifty
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sun Oct 22 16:05:29 EDT 2006
Author: audreyt
Date: Sun Oct 22 16:05:29 2006
New Revision: 2048
Modified:
jifty/trunk/lib/Jifty/Action.pm
Log:
* Jifty::Action: Generate stable auto-monikers for actions
based on the caller stack.
Modified: jifty/trunk/lib/Jifty/Action.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action.pm (original)
+++ jifty/trunk/lib/Jifty/Action.pm Sun Oct 22 16:05:29 2006
@@ -125,8 +125,15 @@
if ($args{'moniker'}) {
$self->moniker($args{'moniker'});
} else {
- $self->moniker('auto-'.Jifty->web->serial);
- $self->log->debug("Generating moniker auto-".Jifty->web->serial);
+ use Digest::MD5 qw(md5_hex);
+ my $frame = 1;
+ my @stack = ref($self);
+ while (my ($pkg, $filename, $line) = caller($frame++)) {
+ push @stack, $pkg, $filename, $line;
+ }
+
+ $self->moniker('auto-'.md5_hex("@stack"));
+ $self->log->debug("Generating auto-moniker from stack for $self");
}
$self->order($args{'order'});
More information about the Jifty-commit
mailing list