Skip to content

Commit

Permalink
a slice in scalar context doesn't work - grep instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmay committed Dec 17, 2010
1 parent 466bbd8 commit 98252bb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions web/build-project-list.pl
Expand Up @@ -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;
Expand Down

0 comments on commit 98252bb

Please sign in to comment.