Group
Extension

Matches 3

portable-loader ( T/TO/TOBYINK/portable-loader-0.003.tar.gz, TOBYINK, 2020; MetaCPAN )
portable-loader/lib/portable/loader/JSON.pm ( view source; MetaCPAN )
JSON;

our $AUTHORITY = 'cpan:TOBYINK';
our $VERSION   = '0.003';

use portable::lib;
use portable::loader;

sub init {
	my $me = shift;
	my ($loader) = @_;
	$loader->register_extension('portable.json
ur $decoder;

sub parse {
	my $me = shift;
	my ($filename) = @_;
	require JSON::Eval;
	$decoder ||= JSON::Eval->new;
	my $jsontext = do {
		open my $fh, '<', $filename
			or die "Could not open $filen
ame: $!";
		local $/;
		<$fh>;
	};
	return ($filename => $decoder->decode($jsontext));
}

1;

portable-loader ( T/TO/TOBYINK/portable-loader-0.003.tar.gz, TOBYINK, 2020; MetaCPAN )
portable-loader/lib/portable/loader/TOML.pm ( view source; MetaCPAN )
'portable');
	return;
}

sub parse {
	my $me = shift;
	my ($filename) = @_;
	require JSON::Eval;
	$decoder ||= JSON::Eval->new($me->_get_parser);
	my $tomltext = do {
		open my $fh, '<', $filename
			
portable-loader ( T/TO/TOBYINK/portable-loader-0.003.tar.gz, TOBYINK, 2020; MetaCPAN )
portable-loader/lib/portable/loader.pm ( view source; MetaCPAN )
hashref, it can be written in
other syntaxes. It could be written in JSON, if L<JSON::Eval> is used to
inflate coderefs in the JSON:

  {
    "version": 1.0,
    "toolkit": "Moo",
    "class:Tree": {
  },
    "class:Maple": {
      "extends": "Tree"
    }
  }

If this is saved at "Nature.portable.json", portable::loader should
be able to load it.

The default format that L<portable::loader> uses t
der->load($libname);

portable::loader will search for "$libname.portable.pl",
"$libname.portable.json", "$libname.portable.toml", or "$libname.portable"
(which will be assumed to be TOML). Other form

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.