[open-ils-commits] [GIT] Evergreen ILS branch master updated. 08b13c6648eb9316baaeb84c5b2bfcaa39e2f72a
Evergreen Git
git at git.evergreen-ils.org
Tue Jun 28 10:59:37 EDT 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 08b13c6648eb9316baaeb84c5b2bfcaa39e2f72a (commit)
via a73fa0689b4187b6429f2c6186e70d8f7f3c7880 (commit)
from b365101bca38622624248f84aec075353778fe71 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 08b13c6648eb9316baaeb84c5b2bfcaa39e2f72a
Merge: a73fa06 b365101
Author: Mike Rylander <mrylander at gmail.com>
Date: Tue Jun 28 10:57:42 2011 -0400
Merge branch 'master' of git.evergreen-ils.org:Evergreen
commit a73fa0689b4187b6429f2c6186e70d8f7f3c7880
Author: Mike Rylander <mrylander at gmail.com>
Date: Tue Jun 28 10:57:35 2011 -0400
Add a method to generate a URI from extracted or supplied parts (both class and object method)
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/TagURI.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/TagURI.pm
index dd7382e..e9c6546 100755
--- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/TagURI.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/TagURI.pm
@@ -101,4 +101,33 @@ sub parse {
return $self;
}
+sub toURI {
+ my $class = shift;
+ my $parts = shift || {};
+
+ my $self = ref($class) ? $class : $class->new;
+
+ $self->$_($$parts{$_}) for keys %$parts;
+ return undef unless (defined($self->classname) && defined($self->id));
+
+ my $tag = 'tag:';
+
+ if ($self->host) {
+ $tag .= $self->host;
+ $tag .= ',' . $self->validity if ($self->validity);
+ }
+
+ $tag .= ':';
+
+ $tag .= 'U2@' if ($self->version == 2);
+ $tag .= $self->classname . '/' . $self->id;
+ $tag .= '['. join(',', @{ $self->paging }) . ']' if defined($self->paging);
+ $tag .= '{'. join(',', @{ $self->includes }) . '}' if defined($self->includes);
+ $tag .= '/' . $self->location if defined($self->location);
+ $tag .= '/' . $self->depth if defined($self->depth);
+ $tag .= '/' . $self->pathinfo if defined($self->pathinfo);
+
+ return $tag;
+}
+1;
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/perlmods/lib/OpenILS/Utils/TagURI.pm | 29 +++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list