/[Frey]/trunk/lib/Frey/SVN.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/SVN.pm

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

revision 804 by dpavlin, Wed Dec 10 22:49:31 2008 UTC revision 851 by dpavlin, Mon Dec 15 20:10:48 2008 UTC
# Line 11  with 'Frey::Web'; Line 11  with 'Frey::Web';
11  #with 'Frey::Storage';  #with 'Frey::Storage';
12    
13  use XML::Simple;  use XML::Simple;
14    use DateTimeX::Easy;
15    
16  has repository => (  has repository => (
17          is => 'rw',          is => 'rw',
# Line 139  sub as_markup { Line 140  sub as_markup {
140                                  push @files, "<ins>$path</ins>";                                  push @files, "<ins>$path</ins>";
141                          } elsif ($action eq "D") {                          } elsif ($action eq "D") {
142                                  push @files, "<del>$path</del>";                                  push @files, "<del>$path</del>";
143                          } else{                          } else {
144                                  push @files, $path;                                  push @files, $path;
145                          }                          }
146                  }                  }
147    
148                  html '<blockquote><p><tt style="color:#808080">',join(", ",@files),':</tt> ',encode($e->{'msg'}),'</p></blockquote>';                  my $msg = $e->{'msg'};
149                    $msg = '' if ref($msg); # FIXME why do I need this, dammit?
150                    $msg = encode( $msg );
151    
152                    html '<blockquote><p><tt style="color:#808080">',join(", ",@files),'</tt> ',$msg,'</p></blockquote>';
153    
154          });          });
155    
156          return $html;          return $html;
157  }  }
158    
159    sub codeswarm_as_markup {
160            my ($self) = @_;
161    
162            $self->content_type('text/xml');
163    
164            my $file_events = '';
165    
166            $self->iterator( sub {
167                    my $e = shift;
168                    
169                    my $rev = $e->{'revision'};
170                    my $date = DateTimeX::Easy->new( $e->{'date'} )->epoch . '000'; # ms
171                    my $author = $e->{'author'};
172    
173                    foreach my $p (@{$e->{'paths'}->{'path'}}) {
174                            my ($action,$path) = ($p->{'action'},$p->{'content'});
175                            $file_events .= qq|\t<event filename="$path" date="$date" author="$author" />\n|;
176                    }
177    
178            });
179    
180            return qq|<?xml version="1.0"?>
181            <!-- One commit per day for one month by a documenter and programmer. -->
182            <file_events>
183            $file_events
184            </file_events>
185            |;
186    
187    }
188    
189  1;  1;

Legend:
Removed from v.804  
changed lines
  Added in v.851

  ViewVC Help
Powered by ViewVC 1.1.26