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', |
152 |
return $html; |
return $html; |
153 |
} |
} |
154 |
|
|
155 |
|
sub codeswarm_as_markup { |
156 |
|
my ($self) = @_; |
157 |
|
|
158 |
|
$self->content_type('text/xml'); |
159 |
|
|
160 |
|
my $file_events = ''; |
161 |
|
|
162 |
|
$self->iterator( sub { |
163 |
|
my $e = shift; |
164 |
|
|
165 |
|
my $rev = $e->{'revision'}; |
166 |
|
my $date = DateTimeX::Easy->new( $e->{'date'} )->epoch . '000'; # ms |
167 |
|
my $author = $e->{'author'}; |
168 |
|
|
169 |
|
foreach my $p (@{$e->{'paths'}->{'path'}}) { |
170 |
|
my ($action,$path) = ($p->{'action'},$p->{'content'}); |
171 |
|
$file_events .= qq|\t<event filename="$path" date="$date" author="$author" />\n|; |
172 |
|
} |
173 |
|
|
174 |
|
}); |
175 |
|
|
176 |
|
return qq|<?xml version="1.0"?> |
177 |
|
<!-- One commit per day for one month by a documenter and programmer. --> |
178 |
|
<file_events> |
179 |
|
$file_events |
180 |
|
</file_events> |
181 |
|
|; |
182 |
|
|
183 |
|
} |
184 |
|
|
185 |
1; |
1; |