Alien-Taco
view release on metacpan or search on metacpan
my $build = $class->new(
module_name => 'Alien::Taco',
dist_abstract => 'Taco Perl module',
dist_author => 'Graham Bell <graham.s.bell@gmail.com>',
license => 'gpl3',
requires => {
'JSON' => 0,
},
build_requires => {
'DateTime' => 0,
'IO::String' => 0,
'Test::More' => 0,
},
);
$build->create_build_script();
"gpl_3"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : 2
},
"name" : "Alien-Taco",
"prereqs" : {
"build" : {
"requires" : {
"DateTime" : "0",
"IO::String" : "0",
"Test::More" : "0"
}
},
"configure" : {
"requires" : {
"Module::Build" : "0.42"
}
},
"runtime" : {
---
abstract: 'Taco Perl module'
author:
- 'Graham Bell <graham.s.bell@gmail.com>'
build_requires:
DateTime: '0'
IO::String: '0'
Test::More: '0'
configure_requires:
Module::Build: '0.42'
dynamic_config: 1
generated_by: 'Module::Build version 0.4232, CPAN::Meta::Converter version 2.150010'
license: gpl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
lib/Alien/Taco.pm view on Meta::CPAN
return sub {
$self->call_function($name, args => \@_);
};
}
=item constructor('ClassName')
Return a subroutine reference to call the constructor for the
specified class, with plain arguments. For example, to
allow multiple L<DateTime> objects to be constructed easily,
a constructor can be used:
my $datetime = $taco->constructor('DateTime');
my $afd = $datetime->(year => 2000, month => 4, day => 1);
This is equivalent to calling the L</construct_object>
method:
my $afd = $taco->construct_object('DateTime',
kwargs => {year => 2000, month => 4, day => 1});
=cut
sub constructor {
my $self = shift;
my $class = shift;
return sub {
$self->construct_object($class, args => \@_);
t/3_server_sub.t view on Meta::CPAN
# Test server subroutines.
#
# This script tests the server module's subroutines.
use strict;
use DateTime;
use IO::String;
use Test::More tests => 9;
BEGIN {use_ok('Alien::Taco::Server');}
# Test parameter handling.
foreach ([
t/3_server_sub.t view on Meta::CPAN
]
) {
is_deeply([Alien::Taco::Server::_get_param($_->[0])], $_->[1], $_->[2]);
}
# Test object handling.
my $s = new TestServer();
my $obj = DateTime->now();
my %hash = (test_object => $obj);
$s->_replace_objects(\%hash);
is_deeply($hash{'test_object'}, {_Taco_Object_ => 1}, 'replace object');
isa_ok($s->_get_object(1), 'DateTime');
$s->prepare_input('{"x": {"_Taco_Object_": 1}}');
my $r = $s->{'xp'}->read();
isa_ok($r->{'x'}, 'DateTime');
$s->_delete_object(1);
is($s->_get_object(1), undef, 'delete object');
# Dummy Taco server.
package TestServer;
( run in 0.410 second using v1.01-cache-2.11-cpan-05444aca049 )