[Lxr-general] [PATCH] Add an Author object to hold complex author information
Brought to you by:
ajlittoz
|
From: Jan-Benedict G. <jb...@lu...> - 2006-03-26 12:03:49
|
Hi!
This patch introduces a LXR::Author object. It currently holds the
author's full name, a username (if used; this may be the SCM's
username or possibly the local part of an email address or something
like that) and author's email address.
This LXR::Author can be used by GIT to supply authorship information.
It's not yet used in common code (eg. `source' could make good use of
it, but we failed to understand how `source' makes use of author
information). Maybe somebody else more familiar with the code can hack
`source' to make use of it? (The other backends like BK, CVS and Plain
will need a small fix to store their info in LXR::Authors, too.)
MfG, JBG
2006-02-26 Maximilian Wilhelm <ma...@rf...>
* lib/LXR/Author.pm: New file. This implements an Author object
containing the Author's full name, a username (if available) and
his/her email address. This could be helpful to eg. directly link
an author's email address in a "cvs blame" like matter.
--- /dev/null 2006-03-14 17:36:51.000000000 +0100
+++ b/lib/LXR/Author.pm 2006-03-26 13:57:14.000000000 +0200
@@ -0,0 +1,22 @@
+#!/usr/bin/env perl -w
+
+package LXR::Author;
+
+use strict;
+
+sub new () {
+ my ($self, $authorname, $email_localpart, $email_full) =3D @_;
+
+ bless {
+ authorname =3D> $authorname,
+ email_localpart =3D> $email_localpart,
+ email_full =3D> $email_full }, $self;
+}
+
+sub getAuthorString() {
+ my $self =3D shift;
+
+ return "<a href=3D\"mailto:$self->{email_full}\" alt=3D\"$self->{authorna=
me}>$self->{email_localpart}</a>";
+}
+
+1;
--=20
Jan-Benedict Glaw jb...@lu... . +49-172-7608481 =
_ O _
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg =
_ _ O
f=C3=BCr einen Freien Staat voll Freier B=C3=BCrger" | im Internet! | i=
m Irak! O O O
ret =3D do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA)=
);
|