Permalink
Browse files

whitespace

  • Loading branch information...
1 parent 94dda26 commit d9ebf397f8178bd635a9b51bc13c1e4159db97f3 @kscaldef kscaldef committed Aug 14, 2009
Showing with 17 additions and 17 deletions.
  1. +17 −17 bin/cmp
View
34 bin/cmp
@@ -14,19 +14,19 @@ sub setup {
# what commands to learn, ignoring private and debugging
#$c->register_commands( { -ignore_regexp => '^(_.*|D|Dumper)$' } );
- $c->register_commands( qw{report data} );
+ $c->register_commands( qw{report data} );
# whare are we in the dir tree?
my $root_path = File::Fu->THIS_FILE->absolute->dirname->dirname->stringify;
$c->stash->{root_path} = $root_path;
# build out a list of all languages and problems
- map {my ($lang,$prob) = split /\//, $_;
+ map {my ($lang,$prob) = split /\//, $_;
$c->stash->{implementation}->{$lang} = 1;
- $c->stash->{problem}->{$prob} = 1;
+ $c->stash->{problem}->{$prob} = 1;
} grep{m{/.*/}
- } map {$_ = $_->stringify;
- s/$root_path//;
+ } map {$_ = $_->stringify;
+ s/$root_path//;
$_
} File::Fu->THIS_FILE->absolute->dirname->dirname->find(sub{!m/(?:bin|[.]git)/ && -d}) ;
@@ -36,19 +36,19 @@ sub setup {
$c->stash->{perl6} = $ENV{RAKUDO} || $ENV{PERL6} || catfile( $ENV{HOME},qw{git rakudo perl6});
#$c->stash->{count} = $ENV{COUNT} || 100;
$c->stash->{count} = 100;
-
+
# now lets parse out what was passed to us via ARGV
foreach (@ARGV) {
if ($c->stash->{implementation}->{$_}) {
push @{$c->options->{implementation}}, $_;
}
else {
my $p = sprintf( q{%03d}, $_);
- push @{$c->options->{problem}}, $p
+ push @{$c->options->{problem}}, $p
if $c->stash->{problem}->{$p};
}
}
-};
+};
sub _build_cmd {
@@ -60,39 +60,39 @@ sub _build_cmd {
#D $runner;
my ($label) = reverse split /$lang/, $_;
"$lang$label" => sub{eval{`$runner`}} #5:file path => sub to run (trap output)
- }map { $dir = $_;
+ }map { $dir = $_;
map{join '/', $dir, $_ } #4:make a full path for each file
File::Fu->dir($dir)->absolute->contents #3:find all the files in these dirs
}grep{ -d #2:then trim down to the ones that exists
- }map { $c->stash->{root_path}. join '/', $lang, $_ #1:what dirs were asked for (guess)
+ }map { $c->stash->{root_path}. join '/', $lang, $_ #1:what dirs were asked for (guess)
} @$prob
} @$imp;
-
+
}
-sub default {
+sub default {
my $c = shift;
- # allow for --help
+ # allow for --help
if( $c->options->{HELP} || $c->options->{help} ) {
return $c->execute('help');
}
- report($c,@_)
-}
+ report($c,@_)
+}
sub report :Help(Output a report) {
my $c = shift;
my $count = $c->options->{count} || $c->stash->{count};
#say qq{Benchmarking $count iterations};
cmpthese(timethese($count, {_build_cmd($c)}));
undef; #this is here so that we dont attempt to spit out the cmpthese array
-};
+};
sub data :Help(Output just the data collected) {
my $c = shift;
my $count = $c->options->{count} || $c->stash->{count};
#say qq{Benchmarking $count iterations};
timethese($count, {_build_cmd($c)}, 'none');
-};
+};
sub post_process {
use JSON qw{-convert_blessed_universally};

0 comments on commit d9ebf39

Please sign in to comment.