Continuus

 view release on metacpan or  search on metacpan

Continuus.pm  view on Meta::CPAN

=cut

################################################################################

=item new:

  The new method creates a new Continuus object.

=cut

sub new() {
  my $self  = {};

  $self->{DEBUG} = 0;

  bless($self);      

  return $self;  
};

################################################################################

Continuus.pm  view on Meta::CPAN

   
   host: Hostname to start the engine on.

   iniFile: Ini file to read.

  Example:
   $ccm->start(database => "/proj/Continuus0/rig/", host => "stoccm01");

=cut

sub start() {
  my $self = shift;
  my %args = @_;
  my ($command);

  $command = "ccm start -m -q -nogui $args{'database'} $args{'host'} $args{'iniFile'} 2>&1";

  $self->printDebug("$command");

  my $CCM_ADDR = `$command`;

Continuus.pm  view on Meta::CPAN

  not implemented in the Continuus module.

  Parameters:
   command: The command to be executed by Continuus

  Example:
  $ccm->command('status');

=cut

sub command() {
  my $self = shift;
  my $command = shift;
  my $result;
  
  printDebug($command);
  $result = `ccm $command`;

  print "$result\n";
};

Continuus.pm  view on Meta::CPAN


=item stop:

  The stop command quits the current Continuus session.

  Parameters:
   None.

=cut

sub stop() {
  my $StopMessage = `ccm stop 2>&1`;
  if ($? ne 0) {
    # Continuus stop failed
    warn "Continuus stop failed.\n$StopMessage\n";
    return 0;
  }
  
  return 1;
};
	    

Continuus.pm  view on Meta::CPAN

  Parameters:
   query: The query string
   flags: Flags to pass to Continuus.
   Format: Formatting options.

  Example:
   $ccm->query(query => "status='released'", flags => "-u", format => "%objectname");

=cut

sub query() {
  my $self = shift;
  my %args = @_;
  
  my ($output,$command,@list);
 
  $command = "ccm query \"$args{'query'}\" $args{'flags'} -f \"$args{'format'}\" 2>&1";
  $self->printDebug($command);

  $output = `$command`;
  $self->printDebug($output);

Continuus.pm  view on Meta::CPAN


  Parameters:
   file: The file to check out.
   version: The version to set on the new file.

  Example:
   $ccm->checkOut(file => "main.c", version => "1.1");

=cut

sub checkOut() {
  my $self = shift;
  my %args = @_;
  my ($result, $command);

  if (defined $args{'version'}) {
    $args{'version'} = "-to $args{'version'}";
  }

  $command = "ccm co $args{'version'} $args{'file'}";
  $result = `$command`;

Continuus.pm  view on Meta::CPAN


  Parameters:
   file: The file to check out.
   comment: The comment to set on the new file.

  Example:
   $ccm->checkIn(file => "main.c", comment => "Created");

=cut

sub checkIn() {
  my $self = shift;
  my %args = @_;
  my ($result, $command);

  if (defined $args{'comment'}) {
    $args{'comment'} = "-c $args{'comment'}";
  }
  else {
    $args{'comment'} = "-nc";
  }

Continuus.pm  view on Meta::CPAN


  Parameters:
   project: The project to reconfigure.
   parameters: Other parameters to pass to the reconfigure command.

  Example:
   $ccm->checkOut(file => "main.c", version => "1.1");

=cut

sub reconfigure() {
  my $self = shift;
  my %args = @_;
  my ($result, $command);

  $command = "ccm reconf -p $args{'project'} $args{'parameter'}";
  $result = `$command`;

  return $?;  
}

################################################################################
sub printDebug() {
  my $self = shift;
  my $tString = shift;

  if($self->{DEBUG} == 1) {
    print "DEBUG: $tString\n";
  }
};

################################################################################

=item debugOn:

  Sets the debugging information on.

=cut

sub debugOn() {
  my $self = shift;

  $self->{DEBUG} = 1;
}

################################################################################

=item debugOff:

  Sets the debugging information off.

=cut

sub debugOff() {
  my $self = shift;

  $self->{DEBUG} = 0;
}

################################################################################
sub untaint($) {	
  my $ToUntaint = shift();

  if ($ToUntaint =~ /(.+)/ms) { $ToUntaint = $1; }
  return $ToUntaint;
};

	    
################################################################################

=head1 AUTHOR

Continuus.pm~  view on Meta::CPAN

=cut

################################################################################

=item new:

  The new method creates a new Continuus object.

=cut

sub new() {
  my $self  = {};

  $self->{DEBUG} = 0;

  bless($self);      

  return $self;  
};

################################################################################

=item start:

  The start method starts a new Continuus session.

=cut

sub start() {
  my $self = shift;
  my %args = @_;
  my ($command);

  if (defined $args{'database'}) {
    $args{'database'} = untaint($args{'database'});
  } 
  else {
    $args{'database'} = "";
  }

Continuus.pm~  view on Meta::CPAN


  $ccm->start(database => '/proj/Continuus4',
	      host => 'stoxserv01');
  
  $ccm->command('status');

  $ccm->stop;

=cut

sub command() {
  my $self = shift;
  my $command = shift;
  my $result;
  
  printDebug($command);
  $result = `ccm $command`;

  print "$result\n";
};

################################################################################  

=item stop:

  The stop command quits the current Continuus session.

=cut

sub stop() {
  my $StopMessage = `ccm stop 2>&1`;
  if ($? ne 0) {
    # Continuus stop failed
    warn "Continuus stop failed.\n$StopMessage\n";
    return 0;
  }
  
  delete $ENV{CCM_DATETIME_FMT};
  delete $ENV{CCM_ADDR};
  delete $ENV{CCM_INI_FILE};

Continuus.pm~  view on Meta::CPAN

};
	    
###############################################################################	    

=item query:

  The query command is a interface to the Continuus query command.

=cut

sub query() {
  my $self = shift;
  my %args = @_;
  
  my ($output,$command,@list);
 
  $command = "ccm query \"$args{'query'}\" $args{'flags'} -f \"$args{'format'}\" 2>&1";
  $self->printDebug($command);

  $output = `$command`;
  $self->printDebug($output);

Continuus.pm~  view on Meta::CPAN

};

################################################################################

=item checkOut:

  Checks out a file.

=cut

sub checkOut() {
  my $self = shift;
  my %args = @_;
  my ($result, $command);

  if (defined $args{'version'}) {
    $args{'version'} = "-to $args{'version'}";
  }

  $command = "ccm co $args{'version'} $args{'file'}";
  $result = `$command`;

Continuus.pm~  view on Meta::CPAN

}

################################################################################

=item checkIn:

  Checks in a file.

=cut

sub checkIn() {
  my $self = shift;
  my %args = @_;
  my ($result, $command);

  if (defined $args{'comment'}) {
    $args{'comment'} = "-c $args{'comment'}";
  }
  else {
    $args{'comment'} = "-nc";
  }

Continuus.pm~  view on Meta::CPAN

}

################################################################################

=item reconfigure:

  Reconfigure command

=cut

sub reconfigure() {
  my $self = shift;
  my %args = @_;
  my ($result, $command);

  $command = "ccm reconf -p $args{'project'} $args{'parameter'}";
  $result = `$command`;

  return $?;  
}

################################################################################
sub printDebug() {
  my $self = shift;
  my $tString = shift;

  if($self->{DEBUG} == 1) {
    print "DEBUG: $tString\n";
  }
};

################################################################################

=item debugOn:

  Sets the debugging informatiopn on.

=cut

sub debugOn() {
  my $self = shift;

  $self->{DEBUG} = 1;
}

################################################################################

=item debugOff:

  Sets the debugging informatiopn off.

=cut

sub debugOff() {
  my $self = shift;

  $self->{DEBUG} = 0;
}

################################################################################
sub untaint($) {	
  my $ToUntaint = shift();

  if ($ToUntaint =~ /(.+)/ms) { $ToUntaint = $1; }
  return $ToUntaint;
};

	    
################################################################################

1;



( run in 0.303 second using v1.01-cache-2.11-cpan-1f129e94a17 )