r45375 - in /trunk/libjira-client-perl: Changes META.yml README debian/changelog lib/JIRA/Client.pm

angelabad-guest at users.alioth.debian.org angelabad-guest at users.alioth.debian.org
Mon Oct 5 11:28:32 UTC 2009


Author: angelabad-guest
Date: Mon Oct  5 11:28:25 2009
New Revision: 45375

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=45375
Log:
New upstream 0.16

Modified:
    trunk/libjira-client-perl/Changes
    trunk/libjira-client-perl/META.yml
    trunk/libjira-client-perl/README
    trunk/libjira-client-perl/debian/changelog
    trunk/libjira-client-perl/lib/JIRA/Client.pm

Modified: trunk/libjira-client-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjira-client-perl/Changes?rev=45375&op=diff
==============================================================================
--- trunk/libjira-client-perl/Changes (original)
+++ trunk/libjira-client-perl/Changes Mon Oct  5 11:28:25 2009
@@ -1,4 +1,17 @@
 Revision history for JIRA-Client
+
+0.16	2009-10-04
+
+	Implements the method get_favourite_filters, which caches the
+	user's favourite filters.
+
+	Casts automatically filter names into filter id in the
+	arguments for getIssueCountForFilter, getIssuesFromFilter, and
+	getIssuesFromFilterWithLimit.
+
+	These changes were inspired by Andrew Grangaard's example in
+	http://www.lowlevelmanager.com/2009/09/access-jira-api-from-perl-with.html.
+	Thanks!
 
 0.15	2009-09-28
 

Modified: trunk/libjira-client-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjira-client-perl/META.yml?rev=45375&op=diff
==============================================================================
--- trunk/libjira-client-perl/META.yml (original)
+++ trunk/libjira-client-perl/META.yml Mon Oct  5 11:28:25 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                JIRA-Client
-version:             0.15
+version:             0.16
 abstract:            An extended interface to JIRA's SOAP API.
 license:             ~
 author:              

Modified: trunk/libjira-client-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjira-client-perl/README?rev=45375&op=diff
==============================================================================
--- trunk/libjira-client-perl/README (original)
+++ trunk/libjira-client-perl/README Mon Oct  5 11:28:25 2009
@@ -1,6 +1,6 @@
 Name:    JIRA-Client
 What:    A OO interface to JIRA's SOAP API.
-Version: 0.15
+Version: 0.16
 Author:  Gustavo Chaves <gnustavo at cpan.org>
 
 JIRA is a proprietary bug tracking system from Atlassian

Modified: trunk/libjira-client-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjira-client-perl/debian/changelog?rev=45375&op=diff
==============================================================================
--- trunk/libjira-client-perl/debian/changelog (original)
+++ trunk/libjira-client-perl/debian/changelog Mon Oct  5 11:28:25 2009
@@ -1,3 +1,9 @@
+libjira-client-perl (0.16-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Angel Abad (Ikusnet SLL) <angel at grupoikusnet.com>  Mon, 05 Oct 2009 13:23:48 +0200
+
 libjira-client-perl (0.15-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/libjira-client-perl/lib/JIRA/Client.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjira-client-perl/lib/JIRA/Client.pm?rev=45375&op=diff
==============================================================================
--- trunk/libjira-client-perl/lib/JIRA/Client.pm (original)
+++ trunk/libjira-client-perl/lib/JIRA/Client.pm Mon Oct  5 11:28:25 2009
@@ -11,11 +11,11 @@
 
 =head1 VERSION
 
-Version 0.15
-
-=cut
-
-our $VERSION = '0.15';
+Version 0.16
+
+=cut
+
+our $VERSION = '0.16';
 
 =head1 SYNOPSIS
 
@@ -406,6 +406,27 @@
     $cache->{$project_key};
 }
 
+=item B<get_favourite_filters>
+
+Returns a hash mapping the user's favourite filter names to its filter
+ids.
+
+=cut
+
+sub get_favourite_filters {
+    my ($self) = @_;
+    my $cache = $self->{cache};
+    unless (exists $cache->{filters}) {
+	my %filters;
+	my $filters = $self->getFavouriteFilters();
+	foreach my $filter (@$filters) {
+	    $filters{$filter->{name}} = $filter;
+	}
+	$cache->{filters} = \%filters;
+    }
+    $cache->{filters};
+}
+
 =item B<set_filter_iterator> FILTER [, CACHE_SIZE]
 
 Sets up an iterator for the filter identified by FILTER. It must
@@ -618,7 +639,7 @@
 	}
     }
 
-    # Convert version ids and names into RemoteVersion objects
+    # Convert version names and RemoteVersion objects into version ids
     for my $versions (qw/fixVersions affectsVersions/) {
 	if (exists $params->{$versions}) {
 	    croak "The '$versions' value must be a ARRAY ref.\n"
@@ -748,7 +769,9 @@
     createIssueWithSecurityLevel       => {1 => 'long'},
     deleteProjectRole                  => {1 => 'boolean'},
     getComment                         => {0 => 'long'},
-    getIssuesFromFilterWithLimit       => {1 => 'int', 2 => 'int'},
+    getIssueCountForFilter             => {0 => \&_cast_filter_name_to_id},
+    getIssuesFromFilter                => {0 => \&_cast_filter_name_to_id},
+    getIssuesFromFilterWithLimit       => {0 => \&_cast_filter_name_to_id, 1 => 'int', 2 => 'int'},
     getIssuesFromTextSearchWithLimit   => {1 => 'int', 2 => 'int'},
     getIssuesFromTextSearchWithProject => {2 => 'int'},
     getProjectById                     => {0 => 'long'},
@@ -759,15 +782,24 @@
 );
 
 sub _cast_remote_comment {
-    my ($arg) = @_;
+    my ($self, $arg) = @_;
     unless (ref $arg) {
 	return bless({body => $arg}, 'RemoteComment');
     }
     return $arg;
 }
 
+sub _cast_filter_name_to_id {
+    my ($self, $arg) = @_;
+    ref $arg and croak "Filter arg must be a scalar, not a ", ref($arg), "\n";
+    return $arg unless $arg =~ /\D/;
+    my $filters = $self->get_favourite_filters();
+    exists $filters->{$arg} or croak "Unknown filter: $arg\n";
+    return $filters->{$arg}{id};
+}
+
 sub _cast_remote_field_values {
-    my ($arg) = @_;
+    my ($self, $arg) = @_;
     if (ref $arg && ref $arg eq 'HASH') {
 	my @params;
 	while (my ($id, $values) = each %$arg) {
@@ -790,7 +822,7 @@
     if (my $typeof = $typeof{$method}) {
 	while (my ($i, $type) = each %$typeof) {
 	    if (ref $type && ref $type eq 'CODE') {
-		$args[$i] = $type->($args[$i]);
+		$args[$i] = $type->($self, $args[$i]);
 	    }
 	    elsif (! ref $args[$i]) {
 		$args[$i] = SOAP::Data->type($type => $args[$i]);




More information about the Pkg-perl-cvs-commits mailing list