Permalink
Browse files

Support installing modules from a local directory

  • Loading branch information...
1 parent 3edcbfc commit ae9a71c6c906caf97bdf1c004fc25459f8fe25c0 @tadzik committed Mar 13, 2011
Showing with 20 additions and 0 deletions.
  1. +20 −0 lib/Panda.pm
View
@@ -1,5 +1,6 @@
use v6;
use Pies;
+use JSON::Tiny;
class Panda is Pies {
use Panda::Ecosystem;
@@ -58,6 +59,25 @@ class Panda is Pies {
multi method announce('depends', Pair $p) {
self.announce: "{$p.key.name} depends on {$p.value.join(", ")}"
}
+
+ method resolve($proj as Str, Bool :$nodeps, Bool :$notests) {
+ if $proj.IO ~~ :d and "$proj/META.info".IO ~~ :f {
+ my $mod = from-json slurp "$proj/META.info";
+ my $p = Pies::Project.new(
+ name => $mod<name>,
+ version => $mod<version>,
+ dependencies => $mod<depends>,
+ metainfo => $mod,
+ );
+ if $.ecosystem.get-project($p.name) {
+ self.announce: "Installing {$p.name} "
+ ~ "from a local directory '$proj'";
+ }
+ $.ecosystem.add-project($p);
+ nextwith($p.name, :$nodeps, :$notests);
+ }
+ nextsame;
+ }
}
# vim: ft=perl6

0 comments on commit ae9a71c

Please sign in to comment.