/[cvs]/nfo/perl/libs/Data/Rap.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Rap.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by joko, Sat Mar 29 07:08:56 2003 UTC revision 1.8 by joko, Fri Dec 5 04:59:33 2003 UTC
# Line 2  Line 2 
2  ##  $Id$  ##  $Id$
3  ## -------------------------------------------------------------------------  ## -------------------------------------------------------------------------
4  ##  $Log$  ##  $Log$
5    ##  Revision 1.8  2003/12/05 04:59:33  joko
6    ##  + minor update: disabled some unnecessary loggers
7    ##
8    ##  Revision 1.7  2003/05/13 05:52:58  joko
9    ##  minor update: modified description printing logic
10    ##
11  ##  Revision 1.6  2003/03/29 07:08:56  joko  ##  Revision 1.6  2003/03/29 07:08:56  joko
12  ##  rap goes global:  ##  rap goes global:
13  ##    + distinguish between running in global- or project-mode  ##    + distinguish between running in global- or project-mode
# Line 218  use Cwd; Line 224  use Cwd;
224  use File::Spec::Functions qw( splitpath splitdir catpath catdir );  use File::Spec::Functions qw( splitpath splitdir catpath catdir );
225    
226    
227    # a package global topic registry
228    our $registry;
229    
230    
231  sub constructor {  sub constructor {
232    my $self = shift;    my $self = shift;
233        
# Line 239  sub constructor { Line 249  sub constructor {
249    
250  sub start {  sub start {
251    my $self = shift;    my $self = shift;
252    $self->log("starting", 'info');    #$self->log("starting", 'info');
253        
254    $self->loadGlobalProperties();    $self->loadGlobalProperties();
255        
256    #print Dumper($self);    #print Dumper($self);
257    if (my $target = $self->{target}) {    if (my $target = $self->{target}) {
258      #$self->{targets}->{$target} = Data::Rap::Target->new( name => $target );      #$self->{targets}->{$target} = Data::Rap::Target->new( name => $target );
259      $self->log("target: $target", 'info');      #$self->log("target: $target", 'info');
260      $self->performTarget($target);      $self->performTarget($target);
261    } else {    } else {
262      my $meta_raw = $self->getTargetList();      my $meta_raw = $self->getTargetList();
263    
264        my $maxlength = 0;
265        map {
266          my $len = length($_->{name});
267          $maxlength = $len if $len > $maxlength;
268        } @$meta_raw;
269    
270        my $program = splitpath($0);
271      foreach my $entry (@$meta_raw) {      foreach my $entry (@$meta_raw) {
272        print "  - rap.pl $entry->{name}", "\n";        my $len = length($entry->{name});
273        print $entry->{description}, "\n" if $entry->{description};        #$len = ((1 / ($len / 8)) * 1.9);
274          #$len = ((1 / ($maxlength - $len / 8)) * 1.9);
275          $len = $maxlength - $len + 5;
276          #print "len: $len", "\n";
277          # one line per target
278          print "$program $entry->{name}", " " x $len;
279          print $entry->{description} if $entry->{description};
280          print "\n";
281          # more lines per target
282          #print "$program $entry->{name}", "\n";
283          #print "   ", $entry->{description}, "\n" if $entry->{description};
284      }      }
285    
286      return;      return;

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.8

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed