App-Gitc

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately

lib/App/Gitc/Its/Jira.pm  view on Meta::CPAN

    project_config
    command_name
    current_branch
);


sub label_service { return 'JIRA'; }
sub label_issue   { return 'Issue'; }

our $default_jira_user     = 'someuser';
our $default_jira_password = 'somepassword';
our $jira_conf;

sub lookup_jira_user {
    my $self = shift;
    if (not $jira_conf and -e "$ENV{HOME}/.gitc/jira.conf") {
        $jira_conf = YAML::LoadFile("$ENV{HOME}/.gitc/jira.conf");
    } else {
        $jira_conf = {};
    }
    my $jira_user     = $jira_conf->{user} || $default_jira_user;
    my $jira_password = $jira_conf->{password} || $default_jira_password;
    return ($jira_user, $jira_password);
}

sub lookup_status_strings
{
    my $self = shift;

    my $jira = $self->get_jira_object or return;

    my $statuses = $jira->getStatuses();
    return unless $statuses;

lib/App/Gitc/Its/Jira.pm  view on Meta::CPAN

{
    my $self = shift;

    # to find an JIRA issue, we need a number and URI
    my $uri = project_config()->{'jira_uri'} or return;

    # build and return the Issue object
    our %jira;
    my $jira = $jira{$uri};
    if ( not $jira ) {
        my ($jira_user, $jira_password) = $self->lookup_jira_user;
        $jira{$uri} = $jira
            = JIRA::Client->new( $uri, $jira_user, $jira_password );
        die "Unable to connect to JIRA SOAP API" unless $jira;
    }

    return $jira;
}

sub get_jira_rest_object {
    my $self = shift;

    # to find an JIRA issue, we need a number and URI
    my $uri    = project_config()->{'jira_uri'} or return;

    # build and return the Issue object
    our %jira_rest;
    my $jira = $jira_rest{$uri};
    if ( not $jira ) {
        my ($jira_user, $jira_password) = $self->lookup_jira_user;
        $jira_rest{$uri} = $jira = JIRA::Client::REST->new(
               username => $jira_user,
               password => $jira_password,
               url => $uri,
           );
        die "Unable to connect to JIRA REST API" unless $jira;
    }

    return $jira;
}

sub get_issue {
    my $self = shift;

lib/App/Gitc/Its/RT.pm  view on Meta::CPAN

    my ( $class, $changeset ) = @_;

    my $project_config = project_config();

    # Removes non-digits.
    $changeset =~ tr/0-9//cd;

    my $self = {
        rt_url      => $project_config->{ rt_url },
        rt_user     => $project_config->{ rt_user },
        rt_password => $project_config->{ rt_password },
        changeset   => $changeset,
    };

    bless $self, $class;

    return $self;
}


sub run_rt {



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