Franck Cuny > Net-GitHub-0.22 > Net::GitHub::V2::Issues

Download:
Net-GitHub-0.22.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  3
View/Report Bugs
Module Version: 0.18   Source  

NAME ^

Net::GitHub::V2::Issues - GitHub Issues API

SYNOPSIS ^

    use Net::GitHub::V2::Issues;

    my $issue = Net::GitHub::V2::Issues->new(
        owner => 'fayland', repo => 'perl-net-github'
    );

DESCRIPTION ^

http://develop.github.com/p/issues.html

For those (authentication required) below, you must set login and token (in https://github.com/account)

    my $issue = Net::GitHub::V2::Issues->new(
        owner => 'fayland', repo => 'perl-net-github',
        login => 'fayland', token => '54b5197d7f92f52abc5c7149b313cf51', # faked
    );

METHODS ^

search
    my $issues = $issue->search('open', 'test');

search issues

list
    my $issues = $issue->list('open');
    my $issues = $issue->list('closed');

see a list of issues for a project.

each issue is a hash reference which contains:

    'number' => 2,
    'position' => '1',
    'state' => 'open',
    'body' => 'Bug Detail',
    'created_at' => '2009/04/20 10:00:45 -0700',
    'updated_at' => '2009/04/20 10:00:45 -0700',
    'user' => 'foobar',
    'title' => 'Bug Title',
    'votes' => 0
view
    my $iss = $issue->view( $issues->[0]->{number} );

get data on an individual issue by number

open
    my $iss = $issue->open( 'Bug title', 'Bug detail' );

open a new issue on a project (authentication required)

close
reopen
    $issue->close( $number );
    $issue->reopen( $number );

close or reopen an issue (authentication required)

edit
    $issue->edit( $number, 'New bug title', 'New bug detail' );

edit an existing issue (authentication required)

add_label
remove_label
    my $labels = $issue->add_label( $number, 'testing' );
    my $labels = $issue->remove_label( $number, $label );

add/remove a label (authentication required)

comment
    my $comment = $issue->comment( $number, 'this is amazing' );

comment on issues

comments

note: this is not the official api of github, in fact, it's done by scrapping.

    my $comments = $issue->comments( $number );

return an arrayref containing a list of comments, each comment is a hashref like

    {
        id      => 12345,
        author  => 'foo',
        date    => '2009/06/08 18:28:42 -0700',
        content => 'blalba',
    }

if no comments, return []

AUTHOR ^

Fayland Lam, <fayland at gmail.com>

sunnavy <sunnavy@bestpractical.com>

COPYRIGHT & LICENSE ^

Copyright 2009 Fayland Lam, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: