Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

First attempt at installing pod aside .pms and .pirs. Tests work, mod…

…ules not really
  • Loading branch information...
commit 551cdc5393560c1ba4046abb3ce528b99d086e0c 1 parent 30a73ca
Tadeusz Sośnierz authored
4 lib/Panda/Builder.pm
View
@@ -36,7 +36,8 @@ class Panda::Builder does Pies::Builder {
my $workdir = $!resources.workdir($p);
return unless "$workdir/lib".IO ~~ :d;
indir $workdir, {
- my @files = find(dir => 'lib', name => /\.pm6?$/).list;
+ my @files = find(dir => 'lib',
+ name => /\.p(m6?)|(od)$/).list;
my @dirs = @files.map(*.dir).uniq;
mkpath "blib/$_" for @dirs;
@@ -44,6 +45,7 @@ class Panda::Builder does Pies::Builder {
my $p6lib = "{cwd}/blib/lib:{cwd}/lib:{%*ENV<PERL6LIB> // ''}";
for @tobuild -> $file {
$file.IO.copy: "blib/{$file.dir}/{$file.name}";
+ next if $file ~~ /\.pod$/;
say "Compiling $file";
shell "env PERL6LIB=$p6lib perl6 --target=pir "
~ "--output=blib/{$file.dir}/"
5 lib/Panda/Installer.pm
View
@@ -14,11 +14,8 @@ class Panda::Installer does Pies::Installer {
method install(Pies::Project $p) {
indir $!resources.workdir($p), {
if 'blib'.IO ~~ :d {
- for find(dir => 'blib', name => /\.pm$/).list,
- find(dir => 'blib', name => /\.pir$/).list
- -> $i {
+ for find(dir => 'blib', type => 'file').list -> $i {
# .substr(5) to skip 'blib/'
- say "Installing $i";
mkpath "$!destdir/{$i.dir.substr(5)}";
$i.IO.copy("$!destdir/{$i.Str.substr(5)}");
}
10 t/panda/builder.t
View
@@ -2,7 +2,7 @@ use Test;
use Panda::Builder;
use Panda::Resources;
-plan 3;
+plan 5;
my $srcdir = 'testmodules';
@@ -14,9 +14,11 @@ my $p = Pies::Project.new(name => 'dummymodule');
lives_ok { $b.build($p) };
-ok "$srcdir/dummymodule/blib/lib/foo.pir".IO ~~ :f, 'module compiled';
-ok "$srcdir/dummymodule/blib/lib/foo.pm".IO ~~ :f, 'module copied to blib';
+ok "$srcdir/dummymodule/blib/lib/foo.pir".IO ~~ :f, 'module compiled';
+ok "$srcdir/dummymodule/blib/lib/foo.pm".IO ~~ :f, 'and opied to blib';
+ok "$srcdir/dummymodule/blib/lib/bar.pod".IO ~~ :f, 'pod copied too';
+ok "$srcdir/dummymodule/blib/lib/bar.pir".IO !~~ :f, 'pod not compiled';
-shell "rm -rf $srcdir/dummymodule/blib $srcdir/dummymodule/Makefile";
+shell "rm -rf $srcdir/dummymodule/blib";
# vim: ft=perl6
3  t/panda/installer.t
View
@@ -2,7 +2,7 @@ use Test;
use Panda::Installer;
use Panda::Resources;
-plan 6;
+plan 7;
my $srcdir = 'testmodules';
my $destdir = "{cwd}/removeme";
@@ -20,6 +20,7 @@ sub file_exists_ok($a as Str, $msg as Str) {
file_exists_ok "$destdir/lib/foo.pm", 'module installed';
file_exists_ok "$destdir/lib/foo.pir", 'pir installed';
+file_exists_ok "$destdir/lib/bar.pod", 'pod installed';
file_exists_ok "$destdir/bin/bar", 'bin installed';
file_exists_ok "$destdir/compiled/module/doc/foofile",
'docs installed 1';
Please sign in to comment.
Something went wrong with that request. Please try again.