Skip to content

Instantly share code, notes, and snippets.

@masak
Created February 18, 2011 22:02
Show Gist options
  • Save masak/834500 to your computer and use it in GitHub Desktop.
Save masak/834500 to your computer and use it in GitHub Desktop.
A sort of mini-tote until we have the real thing
#! /usr/bin/env perl6
use v6;
sub find($root, $p) {
sub f($dir) {
for dir($dir) -> $file {
given "$dir/$file".IO {
when .f { take $_ if $file ~~ $p }
when .d { f .path }
}
}
}
gather f $root;
}
my @pms = find("lib", /\.pm$/);
my @ts = find("t", /\.t$/);
loop {
say '' for ^40;
run "prove -v -e perl6 @ts».path.sort()";
my %c = (@pms, @ts)».path Z=> (@pms, @ts)».changed;
sleep .5 until grep { .changed after %c{.path} }, @pms, @ts;
say "";
}
perl6 -e 'sub find($root, $p) { sub f($dir) { for dir($dir) -> $file { given
"$dir/$file".IO { when .f { take $_ if $file ~~ $p }; when .d { f .path } }
} }; gather f $root }; my @pms = find("lib", /\.pm$/); my @ts = find("t",
/\.t$/); loop { say '' for ^40; run "prove -v -e perl6 @ts».path.sort()"; my
%c = (@pms, @ts)».path Z=> (@pms, @ts)».changed; sleep .5 until grep {
.changed after %c{.path} }, @pms, @ts; say "" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment