Permalink
Browse files

a slice in scalar context doesn't work - grep instead

  • Loading branch information...
1 parent 466bbd8 commit 98252bb75687f6d8f29f2b81bc0b08000deb9956 @jasonmay jasonmay committed Dec 17, 2010
Showing with 9 additions and 2 deletions.
  1. +9 −2 web/build-project-list.pl
View
11 web/build-project-list.pl
@@ -62,8 +62,15 @@
$project ->{badge_has_tests} = $files{t} || $files{test} || $files{tests} ;
- my @readmes = @files{ qw/README README.pod README.md README.mkdn README.markdown/ };
- $project ->{badge_has_readme} = scalar(@readmes) ? "http://github.com/$project->{auth}/$project->{name}/blob/master/README" : undef;
+ my $has_readme = grep exists $files{$_}, qw/
+ README
+ README.pod
+ README.md
+ README.mkdn
+ README.markdown
+ /;
+
+ $project ->{badge_has_readme} = $has_readme ? "http://github.com/$project->{auth}/$project->{name}/blob/master/README" : undef;
$project ->{badge_is_popular} = $repository->{repository}->{watchers} && $repository->{repository}->{watchers} > 50;
sleep(3) ; #We are allowed 60 calls/min = 1 api call per second, and we are wasting 3 per request so we sleep for 3 secs to make up
return;

0 comments on commit 98252bb

Please sign in to comment.