CVS-Metrics

 view release on metacpan or  search on metacpan

bin/cvs_wxlog  view on Meta::CPAN

    }

    my $html = $model->GenerateHTML();
    my $title = $html;
    $title =~ s/\.\w+$//;
    if (Wx::wxMSW()) {
        use Cwd;
        my $url = 'file://' . cwd() . '/' . $html;
        my $ie = MyIEFrame->new($title, $url);
        $ie->Show(1);
    }
    else {
        my $browser = MyHtmlFrame->new($title, $html);
        $browser->Show(1);
    }
}

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

package MyModel;

use strict;
use HTML::Template;
use File::Basename;

sub new {
    my $proto = shift;
    my $class = ref($proto) || $proto;
    my $self = {
            cvs_log     => $main::cvs_log,
            tags        => \@main::tags,
            title       => $main::title,
            flg_dead    => $main::flg_dead,
            flg_css     => $main::flg_css,
            start_date  => $main::start_date,
            output      => $main::output,
            regex_ignore_tag    => $main::regex_ignore_tag,
    };
    bless($self, $class);
    $self->{path} = '.';
    if (scalar(@{$self->{tags}}) >= 2) {
        $self->{tag_from} = ${$self->{tags}}[-2];
        $self->{tag_to} = ${$self->{tags}}[-1];
    }
    return $self;
}

sub GenerateBMP {
    my $self = shift;

    my $title = ($self->{path} eq '.') ? $self->{title} : $self->{path};
    my $gd = $self->{cvs_log}->EnergyGD($self->{tags}, $self->{path}, $title, 600, 400);
    return $gd;
}

sub GenerateHTML {
    my $self = shift;

my $html = q{
<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
  <head>
    <meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1' />
    <meta name='generator' content='<TMPL_VAR NAME=generator>' />
    <meta name='date' content='<TMPL_VAR NAME=date>' />
    <title>cvs_wxlog <!-- TMPL_VAR NAME=title --></title>
    <!-- TMPL_IF NAME=css -->
    <link href='cvs_wxlog.css' rel='stylesheet' type='text/css'/>
    <!-- TMPL_ELSE -->
    <style type='text/css'>
      <!-- TMPL_VAR NAME=style -->
    </style>
    <!-- /TMPL_IF -->
  </head>
  <body>
  <h1>Evolution Report</h1>
  <h1><!-- TMPL_VAR NAME=title --></h1>
  <hr />
  <h2>Activity</h2>
  <img src='<TMPL_VAR NAME=a_img>' />
  <h2>Context</h2>
  <table class='layout'>
    <tr>
      <td valign='top'><img src='<TMPL_VAR NAME=e_img>' /></td>
      <td valign='top'>
        <table border='1' cellpadding='5'>
          <tr>
            <th>Tag</th>
            <th>Date</th>
          </tr>
        <!-- TMPL_LOOP NAME=timed_tag -->
          <tr>
            <td><!-- TMPL_VAR NAME=tag --></td>
            <td><!-- TMPL_VAR NAME=timed --></td>
          </tr>
        <!-- /TMPL_LOOP -->
        </table>
      </td>
    </tr>
  </table>
  <hr />
  <h2>Evolution Report Summary</h2>
  <table border='1' cellpadding='5'>
    <tr>
      <th width='40%'>Directories</th>
      <th width='20%'>Added files</th>
      <th width='20%'>Modified files</th>
      <th width='20%'>Deleted files</th>
    </tr>
  <!-- TMPL_LOOP NAME=summary -->
    <tr>
      <td><a href='#<TMPL_VAR NAME=dir>'><!-- TMPL_VAR NAME=dir --></a></td>
      <td><!-- TMPL_VAR NAME=added --></td>
      <td><!-- TMPL_VAR NAME=modified --></td>
      <td><!-- TMPL_VAR NAME=deleted --></td>
    </tr>
  <!-- /TMPL_LOOP -->
  </table>
  <hr />
  <h2>Detailed Evolution Report</h2>



( run in 0.778 second using v1.01-cache-2.11-cpan-39bf76dae61 )