generate Takfile from SYNOPSIS in Tak.pm
Matt S Trout [Mon, 14 Nov 2011 23:28:37 +0000 (23:28 +0000)]
Takfile [deleted file]
maint/Makefile.PL.include

diff --git a/Takfile b/Takfile
deleted file mode 100644 (file)
index 618f348..0000000
--- a/Takfile
+++ /dev/null
@@ -1,15 +0,0 @@
-package Tak::MyScript;
-
-use Tak::Takfile;
-use Tak::ObjectClient;
-
-sub each_get_homedir {
-  my ($self, $remote) = @_;
-  my $oc = Tak::ObjectClient->new(remote => $remote);
-  my $home = $oc->new_object('Path::Class::Dir')->absolute->stringify;
-  $self->stdout->print(
-    $remote->host.': '.$home."\n"
-  );
-}
-
-1;
index 127b2d6..831fcc3 100644 (file)
@@ -1,9 +1,21 @@
 BEGIN { -e 'Distar' or system("git clone git://git.shadowcat.co.uk/p5sagit/Distar.git") }
 use lib 'Distar/lib';
 use Distar;
+use IO::All;
 
 author 'mst - Matt S. Trout (cpan:MSTROUT) <mst@shadowcat.co.uk>';
 
+# rebuild the fatpacked lib/Tak/STDIONode.pm
 system("maint/mk-fat");
 
+# rip the example Takfile out of the synopsis so I can play with it
+# more easily
+my $tak_pm = io('lib/Tak.pm')->all;
+
+my ($takfile) = $tak_pm =~ /(  package Tak::MyScript.*?  1;\n)/s;
+
+$takfile =~ s/^  //mg;
+
+io('Takfile')->print($takfile);
+
 1;