Commits

shl...@b2b4ac75-4df0-0310-84b2-a54a85d66599  committed eca4f0b

Added the pod.t and pod-coverage.t.

  • Participants
  • Parent commits 6bf7cc9

Comments (0)

Files changed (5)

File rand-seed-serve/Net-SeedServe/MANIFEST

 t/api.t
 t/connect.t
 TEMP/meaningless.txt
+t/pod-coverage.t
+t/pod.t
 t/protocol.t

File rand-seed-serve/Net-SeedServe/lib/Net/SeedServe.pm

     my $class = shift;
     my $self = +{};
     bless $self, $class;
-    $self->initialize(@_);
+    $self->_init(@_);
     return $self;
 }
 
-sub initialize
+sub _init
 {
     my $self = shift;
 
     return 0;
 }
 
-sub set_status_file
+sub _update_status_file
 {
     my $self = shift;
     my $string = shift;
         );
     if (!defined($serving_socket))
     {
-        $self->set_status_file("Status:Error");
+        $self->_update_status_file("Status:Error");
         die $@;
     }
 
-    $self->set_status_file(
+    $self->_update_status_file(
         "Status:Success\tPort:" . $self->{'port'} . "\tPID:$$"
         );
 
 
 Consult the documentation of L<Net::SeedServe::Server>.
 
+=head1 METHODS
+
+=head2 $server = Net::SeedServe->new(port => $port, status_file => $status_filename)
+
+Constructs a new seed server object on a certain port with a certain status 
+file.
+
+=head2 $server->loop();
+
+Starts a loop.
+
 =head1 AUTHOR
 
 Shlomi Fish, E<lt>shlomif@iglu.org.ilE<gt>

File rand-seed-serve/Net-SeedServe/lib/Net/SeedServe/Server.pm

 use IO::All;
 use Time::HiRes qw(usleep);
 
+=head1 NAME
+
+Net::SeedServe - Perl module for implementing a seed server.
+
+=head1 DESCRIPTION
+
+None yet. Consult the code, and the examples in the tests directory.
+
+=head1 METHODS
+
+=head2 $obj = Net::SeedServe::Server->new(status_file => $status_filename);
+
+Initialises a new object with the status filename.
+
+=cut
+
 sub new
 {
     my $class = shift;
     my $self = {};
     bless $self, $class;
-    $self->initialize(@_);
+    $self->_init(@_);
     return $self;
 }
 
-sub initialize
+sub _init
 {
     my $self = shift;
     my %args = (@_);
     return 0;
 }
 
+=head2 $server->start()
+
+Starts the server on a port starting from port 3,000. Returns a hash ref 
+containing the port.
+
+=cut
+
 sub start
 {
     my $self = shift;
     }
 }
 
+=head2 $server->connect(status_file => $status_filename)
+
+Connects to an existing Server whose status file is $status_filename.
+
+=cut
+
 sub connect
 {
     my $self = shift;
     return { 'port' => $port, };
 }
 
+=head2 $server->stop()
+
+Stops the service by killing the listening process.
+
+=cut
+
 sub stop
 {
     my $self = shift;
     waitpid($pid, 0);
 }
 
-sub ok_transact
+sub _ok_transact
 {
     my $self = shift;
     my $msg = shift;
     }
 }
 
+=head2 $server->clear();
+
+Sends a clear transaction that clears the seeds of the seed server.
+
+=cut
+
 sub clear
 {
     my $self = shift;
-    return $self->ok_transact("CLEAR");
+    return $self->_ok_transact("CLEAR");
 }
 
+=head2 $server->enqueue(\@seeds);
+
+Enqueues several seeds in the server to be served next.
+
+=cut
+
 sub enqueue
 {
     my $self = shift;
     {
         die "Invalid seed.";
     }
-    return $self->ok_transact("ENQUEUE " . join("", map { "$_," } @$seeds));
+    return $self->_ok_transact("ENQUEUE " . join("", map { "$_," } @$seeds));
 }
 
 1;
 
 __END__
 
-=head1 NAME
-
-Net::SeedServe - Perl module for implementing a seed server.
-
-=head1 DESCRIPTION
-
-None yet. Consult the code, and the examples in the tests directory.
-
 =head1 AUTHOR
 
 Shlomi Fish, E<lt>shlomif@iglu.org.ilE<gt>

File rand-seed-serve/Net-SeedServe/t/pod-coverage.t

+#!perl -T
+
+use Test::More;
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@;
+all_pod_coverage_ok();

File rand-seed-serve/Net-SeedServe/t/pod.t

+#!perl -T
+
+use Test::More;
+eval "use Test::Pod 1.14";
+plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
+all_pod_files_ok();