From: Matt S Trout Date: Mon, 14 Nov 2011 23:28:37 +0000 (+0000) Subject: generate Takfile from SYNOPSIS in Tak.pm X-Git-Tag: v0.001001~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=39e8cf77c30d4a406ad177f27a6c2e1251ae1efa;p=scpubgit%2FTak.git generate Takfile from SYNOPSIS in Tak.pm --- diff --git a/Takfile b/Takfile deleted file mode 100644 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; diff --git a/maint/Makefile.PL.include b/maint/Makefile.PL.include index 127b2d6..831fcc3 100644 --- a/maint/Makefile.PL.include +++ b/maint/Makefile.PL.include @@ -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) '; +# 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;