Adam

 view release on metacpan or  search on metacpan

ex/rt-plugin.pl  view on Meta::CPAN


    has rt => (
        isa        => 'RT::Client::REST',
        is         => 'ro',
        lazy_build => 1,
        handles    => { show_ticket => [ 'show', ( type => 'ticket' ) ] },
    );

    sub _build_rt {
        my $rt = RT::Client::REST->new( server => $_[0]->server );
        $rt->login( username => $_[0]->user, password => $_[0]->pass, );
        return $rt;
    }

    sub ticket {
        my ( $self, $id ) = @_;
        try {
            if ( my $t = $self->show_ticket( id => $id ) ) {
                return "$$t{Status} #${id}: $$t{Subject}";
            }
            return "Ticket $id not found";

lib/Adam.pm  view on Meta::CPAN

has username => (
    isa      => 'Str',
    accessor => 'get_username',
    traits   => ['Getopt'],
    cmd_flag => 'username',
    builder  => 'default_username',
);

sub default_username { 'adam' }

has password => (
    isa      => 'Str',
    accessor => 'get_password',
    traits   => ['Getopt'],
    cmd_flag => 'password',
    builder  => 'default_password',
);

sub default_password { '' }

has flood => (
    isa      => 'Bool',
    reader   => 'can_flood',
    traits   => ['Getopt'],
    cmd_flag => 'flood',
    builder  => 'default_flood',
);

sub default_flood { 0 }

lib/Adam.pm  view on Meta::CPAN

sub _build__irc {
	my $self = shift;
    POE::Component::IRC::State->spawn(
        Nick     => $self->get_nickname,
        Server   => $self->get_server,
        Port     => $self->get_port,
        Ircname  => $self->get_nickname,
        Options  => $self->get_poco_irc_options,
        Flood    => $self->can_flood,
        Username => $self->get_username,
        Password => $self->get_password,
		%{ $self->get_poco_irc_args },
    );
}

sub privmsg {
    my $self = shift;
    POE::Kernel->post( $self->irc_session_id => privmsg => @_ );
}

sub START {

lib/Adam.pm  view on Meta::CPAN

The IRC server to connect to.

=head2 port (Int)

The port for the IRC server, defaults to 6667

=head2 username(Str)

The username which we should use

=head2 password(Str)

The server password which we shoulduse

=head2 channels (ArrayRef[Str])

IRC channels to connect to.

=head2 owner (Str)

The hostmask of the ower of the bot. The owner can control the bot's plugins
through IRC using the <POE::Component::IRC::Plugin::Plugman|Plugman>
interface.

lib/Moses.pm  view on Meta::CPAN

    with_caller => [
        qw(
          nickname
          server
          port
          channels
          plugins
          username
          owner
          flood
          password
          poco_irc_args
          poco_irc_options
          )
    ],
    also => [qw(MooseX::POE)],
);

sub init_meta {
    my ( $class, %args ) = @_;

lib/Moses.pm  view on Meta::CPAN

    my $class = Moose::Meta::Class->initialize($caller);
    $class->add_method( 'custom_plugins' => sub { return \%plugins } );
}

sub username {
    my ( $caller, $username ) = @_;
    my $class = Moose::Meta::Class->initialize($caller);
    $class->add_method( 'default_username' => sub { return $username } );
}

sub password {
    my ( $caller, $password ) = @_;
    my $class = Moose::Meta::Class->initialize($caller);
    $class->add_method( 'default_password' => sub { return $password } );
}

sub flood {
    my ( $caller, $flood ) = @_;
    my $class = Moose::Meta::Class->initialize($caller);
    $class->add_method( 'default_flood' => sub { return $flood } );
}

sub owner {
    my ( $caller, $owner ) = @_;

lib/Moses.pm  view on Meta::CPAN

=head1 FUNCTIONS

=head2 nickname (Str $name)

Set the nickname for the bot. Default's to the current package.

=head2 username(Str)

The username which we should use

=head2 password(Str)

The server password which we shoulduse

=head2 server (Str $server)

Set the server for the bot.

=head2 port (Int $port)

Set the port for the bot's server. Default's to 6667.

=head2 owner (Str)

lib/oses.pm  view on Meta::CPAN


oses - A shortcut in the fashion of oose.pm

=head1 VERSION

version 0.91

=head1 SYNOPSIS

perl -Ilib -Moses=T -MNet::Twitter -e'event irc_public=>sub {
Net::Twitter->new(username=>$ARGV[0],password=>$ARGV[1])->update($_[ARG2])
};T->run'

=head1 AUTHORS

=over 4

=item *

Chris Prather <chris@prather.org>

t/02.override.t  view on Meta::CPAN


    sub _build__irc {
        POE::Component::IRC::Qnet::State->spawn(
            Nick     => $_[0]->get_nickname,
            Server   => $_[0]->get_server,
            Port     => $_[0]->get_port,
            Ircname  => $_[0]->get_nickname,
            Options  => $_[0]->get_poco_irc_options,
            Flood    => $_[0]->can_flood,
            Username => $_[0]->get_username,
            Password => $_[0]->get_password,
            %{ $_[0]->get_poco_irc_args },
        );
    }

}

my $bot = QnetBot->new();
is(
    ref $bot->irc,
    'POE::Component::IRC::Qnet::State',



( run in 0.551 second using v1.01-cache-2.11-cpan-49f99fa48dc )