Alice
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
$class =~ s/^\Q$args{prefix}\E:://;
$args{name} ||= $class;
$args{version} ||= $class->VERSION;
unless ( $args{path} ) {
$args{path} = $args{name};
$args{path} =~ s!::!/!g;
}
$args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
$args{wrote} = 0;
bless( \%args, $class );
}
sub call {
my ($self, $method) = @_;
my $obj = $self->load($method) or return;
splice(@_, 0, 2, $obj);
goto &{$obj->can($method)};
}
sub load {
inc/Module/Install/Base.pm view on Meta::CPAN
#line 42
sub new {
my $class = shift;
unless ( defined &{"${class}::call"} ) {
*{"${class}::call"} = sub { shift->_top->call(@_) };
}
unless ( defined &{"${class}::load"} ) {
*{"${class}::load"} = sub { shift->_top->load(@_) };
}
bless { @_ }, $class;
}
#line 61
sub AUTOLOAD {
local $@;
my $func = eval { shift->_top->autoload } or return;
goto &$func;
}
inc/Module/Install/Base.pm view on Meta::CPAN
package Module::Install::Base::FakeAdmin;
use vars qw{$VERSION};
BEGIN {
$VERSION = $Module::Install::Base::VERSION;
}
my $fake;
sub new {
$fake ||= bless(\@_, $_[0]);
}
sub AUTOLOAD {}
sub DESTROY {}
# Restore warning handler
BEGIN {
$SIG{__WARN__} = $SIG{__WARN__}->();
}
inc/Module/Install/Metadata.pm view on Meta::CPAN
$self->version( ExtUtils::MM_Unix->parse_version($file) );
# for version integrity check
$self->makemaker_args( VERSION_FROM => $file );
}
sub abstract_from {
require ExtUtils::MM_Unix;
my ( $self, $file ) = @_;
$self->abstract(
bless(
{ DISTNAME => $self->name },
'ExtUtils::MM_Unix'
)->parse_abstract($file)
);
}
# Add both distribution and module name
sub name_from {
my ($self, $file) = @_;
if (
lib/Alice/HTTP/Request.pm view on Meta::CPAN
use parent 'Plack::Request';
sub new {
my($class, $env, $cb) = @_;
Carp::croak(q{$env is required})
unless defined $env && ref($env) eq 'HASH';
Carp::croak(q{$cb is required})
unless defined $cb && ref($cb) eq 'CODE';
bless { env => $env, cb => $cb }, $class;
}
sub new_response {
my $self = shift;
Alice::HTTP::Response->new($self->{cb}, @_);
}
sub param {
my $self = shift;
if (wantarray) {
lib/Alice/HTTP/Response.pm view on Meta::CPAN
package Alice::HTTP::Response;
use parent 'Plack::Response';
use Encode;
sub new {
my($class, $cb, $rc, $headers, $content) = @_;
Carp::croak(q{$cb is required})
unless defined $cb && ref($cb) eq 'CODE';
my $self = bless {cb => $cb}, $class;
$self->status($rc) if defined $rc;
$self->headers($headers) if defined $headers;
$self->body($content) if defined $content;
$self;
}
sub send {
my $self = shift;
my $res = $self->SUPER::finalize;
lib/Alice/HTTP/WebSocket.pm view on Meta::CPAN
}
package Alice::HTTP::WebSocket::Impl;
use Plack::Util::Accessor qw(env error_code version);
use Scalar::Util qw(weaken);
use IO::Handle;
use Protocol::WebSocket::Handshake::Server;
sub new {
my ($class, $env) = @_;
my $self = bless { env => $env }, $class;
weaken $self->{env};
return $self;
}
sub handshake {
my $self = shift;
my $env = $self->env;
my $hs = Protocol::WebSocket::Handshake::Server->new_from_psgi($env);
( run in 0.592 second using v1.01-cache-2.11-cpan-de7293f3b23 )