Skip to content

Commit

Permalink
improvements to the layout of interesting stats page
Browse files Browse the repository at this point in the history
  • Loading branch information
barbie committed Aug 4, 2009
1 parent a6a36ae commit b222ab8
Show file tree
Hide file tree
Showing 13 changed files with 230 additions and 93 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Revision history for CPAN-Testers-WWW-Statistics

0.67 current
- improvements to the layout of interesting stats page.
- moved from Class::Accessor::Chained::Fast to Class::Accessor::Fast

0.66 25/07/2009
- added stats and graphs about CPAN, including extra menu section.

Expand Down
10 changes: 5 additions & 5 deletions META.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: CPAN::Testers::WWW::Statistics
version: 0.66
version: 0.67
abstract: Scripts to create the cpanstats website
author:
- Barbie <barbie@cpan.org>
Expand All @@ -11,7 +11,7 @@ installdirs: site

requires:
CGI: 0
Class::Accessor::Chained::Fast: 0
Class::Accessor::Fast: 0
Config::IniFiles: 0
CPAN::Testers::Common::DBUtils: 0.03
DBD::mysql: 0
Expand Down Expand Up @@ -46,13 +46,13 @@ build_requires:
provides:
CPAN::Testers::WWW::Statistics:
file: lib/CPAN/Testers/WWW/Statistics.pm
version: 0.66
version: 0.67
CPAN::Testers::WWW::Statistics::Graphs:
file: lib/CPAN/Testers/WWW/Statistics/Graphs.pm
version: 0.66
version: 0.67
CPAN::Testers::WWW::Statistics::Pages:
file: lib/CPAN/Testers/WWW/Statistics/Pages.pm
version: 0.66
version: 0.67

meta-spec:
version: 1.4
Expand Down
8 changes: 4 additions & 4 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WriteMakefile(
'VERSION_FROM' => 'lib/CPAN/Testers/WWW/Statistics.pm',
'PREREQ_PM' => {

Class::Accessor::Chained::Fast => 0,
Class::Accessor::Fast => 0,
Config::IniFiles => 0,
CPAN::Testers::Common::DBUtils => 0.03,
GD::Graph::lines => 0,
Expand Down Expand Up @@ -35,9 +35,9 @@ WriteMakefile(
File::Spec => 0, # for testing
},

NO_META => 1,
NO_META => 1,

($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT => 'Scripts to create the cpanstats website',
AUTHOR => 'Barbie <barbie@cpan.org>') : ()),
(ABSTRACT => 'Scripts to create the cpanstats website',
AUTHOR => 'Barbie <barbie@cpan.org>') : ()),
);
273 changes: 203 additions & 70 deletions data/01mailrc.txt

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions lib/CPAN/Testers/WWW/Statistics.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use warnings;
use strict;
use vars qw($VERSION);

$VERSION = '0.66';
$VERSION = '0.67';

#----------------------------------------------------------------------------

Expand All @@ -22,7 +22,7 @@ testers, and some backend code to help map tester address to a real identity.
# -------------------------------------
# Library Modules

use base qw(Class::Accessor::Chained::Fast);
use base qw(Class::Accessor::Fast);

use Config::IniFiles;
use CPAN::Testers::Common::DBUtils;
Expand Down Expand Up @@ -79,7 +79,7 @@ sub new {
bless $self, $class;

# ensure we have a configuration file
die "Must specify the configuration file\n" unless($hash{config});
die "Must specify the configuration file\n" unless( $hash{config});
die "Configuration file [$hash{config}] not found\n" unless(-f $hash{config});

# load configuration file
Expand Down
2 changes: 1 addition & 1 deletion lib/CPAN/Testers/WWW/Statistics/Graphs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use warnings;
use strict;
use vars qw($VERSION);

$VERSION = '0.66';
$VERSION = '0.67';

#----------------------------------------------------------------------------

Expand Down
7 changes: 5 additions & 2 deletions lib/CPAN/Testers/WWW/Statistics/Pages.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use warnings;
use strict;
use vars qw($VERSION);

$VERSION = '0.66';
$VERSION = '0.67';

#----------------------------------------------------------------------------

Expand Down Expand Up @@ -604,24 +604,27 @@ sub _report_interesting {
my (@postersx,@entriesx,@reportsx);
for my $row (@posters) {
$row->[0] = $index{posters}{$row->[1]};
$row->[2] = uc $row->[2];
$row->[4] = $self->_tester_name($row->[4]) if($row->[4] =~ /\@/);
my @this = @$row;
push @postersx, \@this;
}
for my $row (@entries) {
$row->[0] = $index{entries}{$row->[1]};
$row->[2] = uc $row->[2];
$row->[4] = $self->_tester_name($row->[4]) if($row->[4] =~ /\@/);
my @this = @$row;
push @entriesx, \@this;
}
for my $row (@reports) {
$row->[0] = $index{reports}{$row->[1]};
$row->[2] = uc $row->[2];
$row->[4] = $self->_tester_name($row->[4]) if($row->[4] =~ /\@/);
my @this = @$row;
push @reportsx, \@this;
}

my @headings = ('count','id','state','postdate','tester','dist','version','platform','perl','osname','osvers','fulldate');
my @headings = qw( count id grade postdate tester dist version platform perl osname osvers fulldate );

$tvars{HEADINGS} = \@headings;
$tvars{POSTERS} = \@postersx;
Expand Down
1 change: 0 additions & 1 deletion t/05setup_db-cpanstats.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use warnings;
$|=1;
use Test::More tests => 1;
use DBI;
use DBD::SQLite;
use File::Spec;
use File::Path;
use File::Basename;
Expand Down
1 change: 0 additions & 1 deletion t/05setup_db-ixlatest.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use strict;
use warnings;
use Test::More tests => 1;
use DBI;
use DBD::SQLite;
use File::Spec;
use File::Path;
use File::Basename;
Expand Down
1 change: 0 additions & 1 deletion t/05setup_db-uploads.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use strict;
use warnings;
use Test::More tests => 1;
use DBI;
use DBD::SQLite;
use File::Spec;
use File::Path;
use File::Basename;
Expand Down
4 changes: 2 additions & 2 deletions t/20attributes.t
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ foreach my $k ( qw/
ok( $obj->can($k), "$label can" )
or skip "'$k' attribute missing", 3;
isnt( $obj->$k(), undef, "$label has default" );
is( $obj->$k(123), $obj, "$label set" ); # chained, so returns object, not value.
is( $obj->$k(123), 123, "$label set" );
is( $obj->$k, 123, "$label get" );
};
}
Expand All @@ -41,7 +41,7 @@ foreach my $k ( qw/
ok( $obj->can($k), "$label can" )
or skip "'$k' attribute missing", 3;
is( $obj->$k(), undef, "$label has no default" );
is( $obj->$k(123), $obj, "$label set" ); # chained, so returns object, not value.
is( $obj->$k(123), 123, "$label set" );
is( $obj->$k, 123, "$label get" );
};
}
Expand Down
Binary file modified t/expected.zip
Binary file not shown.
6 changes: 3 additions & 3 deletions templates/interest.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h2>All Posts to cpan-testers</h2>
<table>
<tr>[% FOREACH cell = HEADINGS %]<th class="top">[% cell %]</th>[% END %]</tr>
[% FOREACH row = POSTERS; cnt = 0 %]
<tr>[% FOREACH col = row; IF cnt == 1 %]<td><a href="http://nntp.x.perl.org/group/perl.cpan.testers/[% col %]">[% col %]</a></td>[% ELSE %]<td>[% col %]</td>[% END; cnt = cnt + 1; END %]</tr>
<tr>[% FOREACH col = row; IF cnt == 1 %]<td><a href="http://nntp.x.perl.org/group/perl.cpan.testers/[% col %]">[% col %]</a></td>[% ELSE %]<td[% IF cnt == 2 %] class="[% col %]"[% END %]>[% col %]</td>[% END; cnt = cnt + 1; END %]</tr>
[% END %]
</table>
</div>
Expand All @@ -58,7 +58,7 @@ <h2>Notable Entries posted to cpan-testers</h2>
<table>
<tr>[% FOREACH cell = HEADINGS %]<th class="top">[% cell %]</th>[% END %]</tr>
[% FOREACH row = ENTRIES; cnt = 0 %]
<tr>[% FOREACH col = row; IF cnt == 1 %]<td><a href="http://nntp.x.perl.org/group/perl.cpan.testers/[% col %]">[% col %]</a></td>[% ELSE %]<td>[% col %]</td>[% END; cnt = cnt + 1; END %]</tr>
<tr>[% FOREACH col = row; IF cnt == 1 %]<td><a href="http://nntp.x.perl.org/group/perl.cpan.testers/[% col %]">[% col %]</a></td>[% ELSE %]<td[% IF cnt == 2 %] class="[% col %]"[% END %]>[% col %]</td>[% END; cnt = cnt + 1; END %]</tr>
[% END %]
</table>
</div>
Expand All @@ -69,7 +69,7 @@ <h2>Notable Reports posted to cpan-testers</h2>
<table>
<tr>[% FOREACH cell = HEADINGS %]<th class="top">[% cell %]</th>[% END %]</tr>
[% FOREACH row = REPORTS; cnt = 0 %]
<tr>[% FOREACH col = row; IF cnt == 1 %]<td><a href="http://nntp.x.perl.org/group/perl.cpan.testers/[% col %]">[% col %]</a></td>[% ELSE %]<td>[% col %]</td>[% END; cnt = cnt + 1; END %]</tr>
<tr>[% FOREACH col = row; IF cnt == 1 %]<td><a href="http://nntp.x.perl.org/group/perl.cpan.testers/[% col %]">[% col %]</a></td>[% ELSE %]<td[% IF cnt == 2 %] class="[% col %]"[% END %]>[% col %]</td>[% END; cnt = cnt + 1; END %]</tr>
[% END %]
</table>
</div>

0 comments on commit b222ab8

Please sign in to comment.