Navigation Menu

Skip to content

Commit

Permalink
make the M:I implementation work
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbs committed Mar 9, 2009
1 parent 0684c67 commit e8c3f2f
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions lib/Module/Install/JSONMETA.pm
@@ -1,14 +1,39 @@
use strict;
use warnings;
package Module::Install::JSONMETA;
our $VERSION = '1.000';
use Module::Install::Base;

BEGIN {
our @ISA = qw(Module::Install::Base);
our $ISCORE = 1;
our $VERSION = '1.000';
}

=head1 NAME
Module::Install::JSONMETA - (unimplemented) write META.yml with JSON syntax
Module::Install::JSONMETA - write META.yml with JSON syntax
=cut

die "not yet implemented";
sub jsonmeta {
my ($self) = @_;

no warnings 'redefine';
require Module::Install::Metadata;
*Module::Install::Metadata::write = sub {
my ($self) = @_;
return $self unless $self->is_admin;

unless (eval { require JSON; JSON->VERSION(2); 1 }) {
die "could not load JSON.pm version 2 or better; can't use jsonmeta\n";
}

local *YAML::Tiny::Dump = sub { JSON->new->pretty->ascii->encode(shift) . "\n" };

$self->admin->write_meta;

return $self;
};
}

1;

0 comments on commit e8c3f2f

Please sign in to comment.