Skip to content

Commit

Permalink
First shot at offline bootstraping; seems to work
Browse files Browse the repository at this point in the history
  • Loading branch information
Tadeusz Sośnierz committed Jul 23, 2012
1 parent 04b6755 commit b475cb2
Show file tree
Hide file tree
Showing 32 changed files with 850 additions and 4 deletions.
20 changes: 17 additions & 3 deletions bootstrap.pl
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
use v6;

my $oldenv = %*ENV<PERL6LIB> // '';
my $env_sep = $*VM<config><osname> eq 'MSWin32' ?? ';' !! ':';
%*ENV<PERL6LIB> = join $env_sep, $oldenv, cwd() ~ '/ext', cwd() ~ '/lib';
my $home = $*OS eq 'MSWin32' ?? %*ENV<HOMEDRIVE> ~ %*ENV<HOMEPATH> !! %*ENV<HOME>;

mkdir $home unless $home.IO.d;
mkdir "$home/.panda" unless "$home/.panda".IO.d;
my $projects = slurp 'projects.json.bootstrap';
$projects ~~ s:g/_BASEDIR_/{cwd}\/ext/;
given open "$home/.panda/projects.json", :w {
.say: $projects;
.close;
}

%*ENV<PERL6LIB> ~= ":{cwd}/ext/File__Tools/lib";
%*ENV<PERL6LIB> ~= ":{cwd}/ext/JSON__Tiny/lib";
%*ENV<PERL6LIB> ~= ":{cwd}/ext/Test__Mock/lib";
%*ENV<PERL6LIB> ~= ":{cwd}/lib";
shell "perl6 bin/panda install File::Tools JSON::Tiny Test::Mock";
%*ENV<PERL6LIB> = join $env_sep, $oldenv, cwd() ~ '/lib';
shell "perl6 bin/panda install .";

unlink "$home/.panda/projects.json";
21 changes: 21 additions & 0 deletions ext/File__Tools/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2010 Tadeusz Sośnierz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
7 changes: 7 additions & 0 deletions ext/File__Tools/META.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name" : "File::Tools",
"version" : "*",
"description" : "Various modules for file operations",
"depends" : [],
"source-url" : "git://github.com/tadzik/perl6-File-Tools.git"
}
5 changes: 5 additions & 0 deletions ext/File__Tools/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This Perl 6 distribution contains the following modules:

File::Copy
File::Find
File::Mkdir
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions ext/File__Tools/t/01-file-find.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
use v6;
use Test;
use File::Find;
plan 7;

my $res = find(:dir<t/dir1>);
my @test = $res.map({ .Str }).sort;
is @test, <t/dir1/another_dir t/dir1/another_dir/empty_file t/dir1/file.bar t/dir1/file.foo t/dir1/foodir t/dir1/foodir/not_a_dir>, 'just a dir';

# names

$res = find(:dir<t/dir1>, :name(/foo/));
@test = $res.map({ .Str }).sort;
is @test, <t/dir1/file.foo t/dir1/foodir t/dir1/foodir/not_a_dir>, 'name with regex';

$res = find(:dir<t/dir1>, :name<file.bar>);
is $res.elems, 1, 'name with a string';

$res = find(:dir<t/dir1>, :name<notexisting>);
is $res.elems, 0, 'no results';

# types

$res = find(:dir<t/dir1>, :type<dir>);
@test = $res.map({ .Str }).sort;
is @test, <t/dir1/another_dir t/dir1/foodir>, 'types: dir';

$res = find(:dir<t/dir1>, :type<dir>, :name(/foo/));
@test = $res.map({ .Str }).sort;
is @test, <t/dir1/foodir>, 'types: dir, combined with name';

$res = find(:dir<t/dir1>, :type<file>, :name(/foo/));
@test = $res.map({ .Str }).sort;
is @test, <t/dir1/file.foo t/dir1/foodir/not_a_dir>,
'types: file, combined with name';
11 changes: 11 additions & 0 deletions ext/File__Tools/t/02-shell-command.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use v6;
use Test;
use Shell::Command;
plan 2;

mkpath 't/dupa/foo/bar';
ok ('t/dupa/foo'.IO ~~ :d), 'mkpath, 1/2';
ok ('t/dupa/foo/bar'.IO ~~ :d), 'mkpath, 1/2';
rmdir 't/dupa/foo/bar';
rmdir 't/dupa/foo';
rmdir 't/dupa/';
Empty file.
Empty file added ext/File__Tools/t/dir1/file.bar
Empty file.
Empty file added ext/File__Tools/t/dir1/file.foo
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions ext/File__Tools/t/test.file
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
foo foo
asd
foo bar
3 changes: 3 additions & 0 deletions ext/JSON__Tiny/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.swp
Makefile
*.pir
12 changes: 12 additions & 0 deletions ext/JSON__Tiny/MANIFEST
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
lib/JSON/Tiny.pm
lib/JSON/Tiny/Actions.pm
lib/JSON/Tiny/Grammar.pm
lib/Configure.pm
t/04-roundtrip.t
t/03-unicode.t
t/01-parse.t
t/02-structure.t
META.yml
Makfile.in
README
Configure
8 changes: 8 additions & 0 deletions ext/JSON__Tiny/META.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name" : "JSON::Tiny",
"version" : "*",
"description" : "A minimal JSON (de)serializer",
"depends" : [ ],
"source-url" : "git://github.com/moritz/json.git"
}

26 changes: 26 additions & 0 deletions ext/JSON__Tiny/META.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: JSON-Tiny
version: '0.1.2_1'
author:
- 'Moritz Lenz <moritz@faui2k3.org>'
- 'Johan Viklund <johan.viklund@gmail.com>'
abstract: 'JSON parser and generator'
license: artistic_2
resources:
license: http://www.perlfoundation.org/artistic_2_0_notes
distribution_type: module
requires:
perl: 6.0
provides:
JSON::Tiny:
file: lib/JSON/Tiny.pm
version: '0.1.2_1'
JSON::Tiny::Grammar:
file: lib/JSON/Tiny/Grammar.pm
JSON::Tiny::Actions:
file: lib/JSON/Tiny/Actions.pm
generated_by: 'Moritz Lenz'
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.2.html
version: 1.2

36 changes: 36 additions & 0 deletions ext/JSON__Tiny/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
An initial Perl 6 grammar for JSON.

This is a work in progress. For more information please join #perl6 on
irc.freenode.net, and talk to moritz_ or viklund, or write a mail to
perl6-users@perl.org.

All files (unless noted otherwise) can be used, modified and redistributed
under the terms of the Artistic License Version 2. Examples (in the
documentation, in tests or distributed as separate files) can be considered
public domain.

To build and test this module, plese get 'ufo' from
http://github.com/masak/ufo and run

ufo
make
make test

(installation is not yet supported; you can do that manually by copying the .pm
files from lib/ recursivley in your ~/.perl6/lib/ dir; installing .pir files
is discouraged, since simple changes in Rakudo will render them worthless,
might result in confusing errors).

State:

The parser is pretty complete, if you find anything that it should
parse and doesn't, or the other way round, please let me know.

The emitter works.

Both currently ignore possible surrogate pairs.

Credits
Moritz Lenz <moritz@faui2k3.org>
Johan Viklund
Jonathan Worthington
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added ext/JSON__Tiny/logotype/logo_32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b475cb2

Please sign in to comment.