Skip to content

Commit bd67196

Browse files
author
Nick Logan
committed
Revert "ecosystem update: 1446652945"
This reverts commit d33d88c.
1 parent d33d88c commit bd67196

File tree

10 files changed

+269
-27
lines changed

10 files changed

+269
-27
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
We, the module installer developers, hereby decree...
2+
3+
Too official? Ok, I'll go again.
4+
5+
In this repository you'll find metadata for projects and modules. It's nice
6+
to have that in a central place, apart from any specific module installer
7+
(*cough* proto neutro pls *cough*), for at least these three reasons:
8+
9+
* The set of people who want access to a module installer and the set of
10+
people who want access to module metadata are two different sets.
11+
12+
* If each installer has one set of metadata, that's more for everyone to
13+
keep updated. If it's in a central place, there's less work.
14+
15+
* The list of projects in the ecosystem is really an orthogonal to the
16+
installer, or even *an* installer. It might be used for other things,
17+
such as rendering the list at http://modules.perl6.org
18+
19+
To add a new module to the ecosystem, add the URL of the module's raw META.info
20+
file to the META.list file here in the ecosystem. Since the updates to
21+
the ecosystem are announced in the #perl6 IRC channel, it is helpful
22+
if you include the HTTP URL to your repo in your commit message, so others
23+
could easily view your new module, e.g.:
24+
25+
git commit -m 'Add FooBar to ecosystem' -m 'See https://github.com/foobar/FooBar'
26+
27+
So there you go. It probably bears repeating that all of this is quite
28+
temporary; something to sustain us until we can hook up with CPAN goodness
29+
in some more long-term way.
30+
31+
Have a nice day.

SHELTER/io-prompt/META.info

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "name" : "io-prompt", "version" : "*", "description" : "[old] Perl6 basic type validating IO prompting for command line tools.", "depends" : [ ], "source-url" : "git://github.com/pnu/io-prompt.git" }

SHELTER/lolsql/META.info

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "name" : "lolsql", "version" : "*", "description" : "[old] I can has lolsql parser?", "depends" : [ ], "source-url" : "git://github.com/jnthn/lolsql.git" }

projects.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

server/bin/app.pl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env perl
2+
use Dancer;
3+
use modules;
4+
dance;

server/public/module/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*

server/updatelist.pl

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
BEGIN { $ENV{HTTPS_CA_FILE} = '/etc/ssl/certs/ca-certificates.crt' }
2+
use 5.010;
3+
use strict;
4+
use warnings;
5+
use JSON::XS;
6+
use LWP::UserAgent;
7+
use autodie;
8+
use File::Spec;
9+
use FindBin;
10+
11+
use Data::Dumper;
12+
13+
my $OUTDIR = shift(@ARGV) // 'public/';
14+
my $ua = LWP::UserAgent->new;
15+
$ua->timeout(10);
16+
17+
my @modules;
18+
my @errors;
19+
20+
open my $fh, '<', "$FindBin::Bin/../META.list";
21+
for my $url (<$fh>) {
22+
chomp $url;
23+
next unless $url =~ /\S/;
24+
eval {
25+
print "$url ";
26+
my $response = $ua->get($url);
27+
say $response->code;
28+
if ($response->is_success) {
29+
my $module = decode_json $response->content;
30+
push @modules, $module;
31+
my $name = $module->{name};
32+
if ($name =~ m{[/\\]} || $name =~ m{\.\.}) {
33+
die "Invalid module name '$name'";
34+
}
35+
open my $OUT, '>', File::Spec->catfile($OUTDIR, 'module', $name);
36+
print $OUT $response->content;
37+
close $OUT;
38+
}
39+
};
40+
if ($@) {
41+
warn $@;
42+
push @errors, {
43+
url => $url,
44+
message => $@,
45+
};
46+
}
47+
}
48+
close $fh;
49+
#unlink 'metalist';
50+
51+
for my $basename ('projects.json', 'list') {
52+
open $fh, '>', File::Spec->catfile($OUTDIR, $basename);
53+
print $fh encode_json \@modules;
54+
close $fh;
55+
}
56+
57+
open $fh, '>', File::Spec->catfile($OUTDIR, 'errors.json');
58+
print $fh encode_json \@errors;
59+
close $fh;

spec.pod

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
=pod
2+
3+
=head1 The F<META.info> File
4+
5+
Every project willing to be a part of the Perl 6 module ecosystem should
6+
provide some sort of metadata that can be easily identified and handled
7+
properly. This is what the F<META.info> file is for.
8+
9+
The F<META.info> file I<must> exist in the project's root directory. If
10+
it doesn't, the module will not be identified as a Perl 6 project and is
11+
likely to be ignored by the package managers. The F<META.info> file I<must>
12+
contain valid L<JSON|http://json.org/>.
13+
14+
The JSON content of the file I<must> be a hash object with the following
15+
fields:
16+
17+
=head2 Mandatory fields
18+
19+
=over 4
20+
21+
=item C<name>
22+
23+
The fully-qualified module name. For example:
24+
25+
ufo
26+
JSON::Tiny
27+
HTTP::Server::Simple
28+
29+
The name B<should not> contain any elements indicating that the module is for
30+
Perl 6 (i.e. no C<perl6::Foo::Bar> or C<Baz::pm6>).
31+
32+
=item C<version>
33+
34+
The module version. If the version is not significant, then this field
35+
should be set to C<*>.
36+
37+
=item C<description>
38+
39+
A short description of the module.
40+
41+
=item C<depends>
42+
43+
An array that specifies the other modules (if any) that the module depends on.
44+
Any modules whose C<name> field is equal to the one mentioned in the C<depends>
45+
field will be installed before the one depending on them. If a module has no
46+
dependencies, the C<depends> field should be an empty array.
47+
48+
=item C<source-url>
49+
50+
A URL that represents where the module's source code can be obtained.
51+
52+
The URL protocol (or "scheme") determines the type of resource: C<ftp://> and
53+
C<http://> are assumed to point to archives containing the full module while C<git://>
54+
points to a Git source code repository.
55+
56+
I<NOTE>: At the time of writing, C<git://> is the only protocol that is known
57+
to be supported by an installer.
58+
59+
=back
60+
61+
=head2 Optional Fields
62+
63+
=over 4
64+
65+
=item C<source-type>
66+
67+
The type of source the module should be installed from. If this field is
68+
missing, the value in the C<source-url> field will be used instead.
69+
70+
I<NOTE>: At the time of writing, C<git> is the only type that is known to be
71+
supported by an installer.
72+
73+
=item C<author>
74+
75+
The author of the module.
76+
77+
=back
78+
79+
The module author can also add any number of other fields he or she wants.
80+
81+
=head1 Example
82+
83+
This is an example F<META.info> file for a module called C<Fast::Food> written
84+
by Ronald McDonald.
85+
86+
{
87+
"name" : "Fast::Food",
88+
"version" : "1.2.3",
89+
"author" : "Ronald McDonald",
90+
"description" : "Orders virtual fast food that no one can eat",
91+
"depends" : [],
92+
"source-type" : "git",
93+
"source-url" : "git://github.com/ronald-mcdonald/fast-food.git"
94+
}
95+
96+
=head1 The Directory Structure
97+
98+
The project directory can contain any of the following subdirectories:
99+
100+
=over 4
101+
102+
=item C<bin>
103+
104+
The executables should be placed here. They will be installed with the
105+
necessary permissions needed for to run them.
106+
107+
=item C<lib>
108+
109+
All C<.pm> (or C<.pm6>) files should be placed here. They may also be compiled
110+
to some intermediate form (e.g. PIR). All files will be installed to a path from
111+
which they can be used in Perl 6 code (usually F<~/.perl6/lib>).
112+
113+
=item C<t>
114+
115+
The tests should be placed here. They will be run after building the module and
116+
before installation.
117+
118+
=back
119+
120+
=cut

update.pl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
use v6;
2+
use JSON::Tiny;
3+
4+
sub run-or-die($x) {
5+
run $x and die "Failed running '$x'"
6+
}
7+
8+
my @modules;
9+
10+
my $fh = open('META.list');
11+
for $fh.lines -> $url {
12+
run-or-die "wget $url";
13+
my $info = from-json(slurp('META.info'));
14+
@modules.push($info);
15+
say $info.perl;
16+
unlink 'META.info';
17+
}
18+
19+
given open('projects.json', :w) {
20+
.say(to-json @modules);
21+
.close;
22+
}
23+
24+
$fh.close;

updatelist.pl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
use 5.010;
2+
use JSON::XS;
3+
use File::Slurp 'slurp';
4+
use Try::Tiny;
5+
use LWP::Simple;
6+
use autodie;
7+
system "wget https://raw.githubusercontent.com/perl6/ecosystem/master/META.list -O metalist";
8+
9+
my @modules;
10+
11+
open my $fh, '<', "metalist";
12+
for(<$fh>) {
13+
chomp;
14+
try {
15+
print "$_ ";
16+
say getstore($_, 'tmp');
17+
my $hash = decode_json slurp 'tmp';
18+
push @modules, $hash;
19+
};
20+
unlink 'tmp' if -e 'tmp';
21+
}
22+
close $fh;
23+
#unlink 'metalist';
24+
25+
open($fh, '>', "projects.json");
26+
27+
print $fh encode_json \@modules;
28+
close $fh;

0 commit comments

Comments
 (0)