Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[poc] now pulls the ecosystem from the 'Net
  • Loading branch information
Carl Masak committed Aug 27, 2010
1 parent 7481a36 commit 61a5869
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 81 deletions.
78 changes: 0 additions & 78 deletions poc-projects.list

This file was deleted.

20 changes: 17 additions & 3 deletions proof-of-concept
Expand Up @@ -30,15 +30,27 @@ role FileBackend {
class POC::ProjectsState is App::Pls::ProjectsState::Hash does FileBackend {
}

class POC::Ecosystem does App::Pls::Ecosystem does FileBackend {
role WebBackend {
has $.url;

method load-from-url() {
my $projects = qqx[wget -q -O- $.url];
if !$projects {
die "Couldn't fetch ecosystem from the web";
}
%.projects = from-json($projects);
}
}

class POC::Ecosystem does App::Pls::Ecosystem does WebBackend {
has %.projects is rw;
has $!loaded-projects-file = False;

method project-info(Str $project --> Project) {
# This is *so* nice!
unless $!loaded-projects-file++ {
announce-start-of('load', 'ecosystem');
self.load-from-file;
self.load-from-url;
announce-end-of('load', success);
}
die "No such project: $project"
Expand Down Expand Up @@ -322,9 +334,11 @@ sub MAIN(Str $project, Bool :$force, Bool :$skip-test) {
my $projstate = POC::ProjectsState.new(:filename("poc-projects.state"));
$projstate.load-from-file;

my $ecosystem-url
= "http://github.com/perl6/ecosystem/raw/master/projects.list";
my $core = App::Pls::Core.new(
:projects($projstate),
:ecosystem( POC::Ecosystem.new(:filename("poc-projects.list")) ),
:ecosystem( POC::Ecosystem.new(:url($ecosystem-url)) ),
:fetcher( POC::Fetcher.new() does POC::FetchAnnouncer ),
:builder( POC::Builder.new() does POC::BuildAnnouncer ),
:tester( POC::Tester.new() does POC::TestAnnouncer ),
Expand Down

0 comments on commit 61a5869

Please sign in to comment.