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', |
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; |