[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Thu Nov 20 19:39:42 UTC 2008


kawas
Thu Nov 20 14:39:42 EST 2008
Update of /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF
In directory dev.open-bio.org:/tmp/cvs-serv13408/Perl/MOBY-Server/lib/MOBY/RDF

Modified Files:
	Utils.pm 
Log Message:
added a trim function
moby-live/Perl/MOBY-Server/lib/MOBY/RDF Utils.pm,1.6,1.7
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Utils.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Utils.pm	2008/09/02 13:13:20	1.6
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Utils.pm	2008/11/20 19:39:42	1.7
@@ -130,7 +130,7 @@
 sub getHttpRequestByURL {
 	my ( $self, $url ) = @_;
 	my $ua = LWP::UserAgent->new;
-	$ua->agent( "pMOBY/Central/1.0");
+	$ua->agent( "pMOBY/Central/$VERSION");
 
 	my $req =
 	  HTTP::Request->new( GET =>
@@ -171,5 +171,22 @@
 END_OF_RDF
 }
 
+=head2 trim
+
+trims whitespace from the begining and end of a string
+
+=cut
+
+sub trim {
+	my ($self, $text) = @_;
+	$text = $self 
+		unless (ref($self) == 'Moby::RDF::Utils') and defined($text);
+	$text =~ s/^\s+//;
+	$text =~ s/\s+$//;
+	return $text;
+}
+
+
+
 1;
 __END__




More information about the MOBY-guts mailing list