Fedora-Bugzilla
view release on metacpan or search on metacpan
lib/Fedora/Bugzilla/Bug.pm view on Meta::CPAN
lazy => 1,
provides => {
'empty' => 'depends_on_anything',
'count' => 'num_deps',
'exists' => 'depends_on_bug',
'keys' => 'all_dependent_bugs',
},
);
has _blocked => (
traits => [ 'MooseX::AttributeHelpers::Trait::Collection::Bag' ],
clear_master => 'xml',
# FIXME trigger on set needed
is => 'ro',
isa => 'Bag',
auto_deref => 1,
# right now, use of lazy_build or builder is broken with this metaclass
#lazy_build => 1,
default => sub { shift->_build__blocked },
clearer => '_clear__blocked',
predicate => '_has__blocked',
lazy => 1,
provides => {
'empty' => 'blocks_anything',
'count' => 'num_blocked',
'exists' => 'blocks_bug',
'keys' => 'all_blocked_bugs',
},
);
sub _build__dependson
{ return { map { $_ => 1 } @{ shift->_from_atts('dependson') } } }
sub _build__blocked
{ return { map { $_ => 1 } @{ shift->_from_atts('blocked') } } }
has cc_list => (
traits => [ 'MooseX::AttributeHelpers::Trait::Collection::List' ],
clear_master => 'xml',
is => 'ro',
#isa => 'ArrayRef[EmailAddress]',
isa => 'ArrayRef[Email::Address]',
auto_deref => 1,
lib/Fedora/Bugzilla/NewBug.pm view on Meta::CPAN
has alias => (
is => 'rw',
isa => 'Maybe[Str]',
lazy_build => 1,
);
sub _build_alias { undef }
my @attrs = qw{
dependson assigned_to comment version op_sys platform
severity priority blocked
};
has [ @attrs ] => (is => 'rw', lazy_build => 1, isa => 'Maybe[Str]');
has bug_file_loc => (
is => 'rw',
isa => Uri,
coerce => 1,
lazy_build => 1,
);
# some sensible defaults, too
sub _build_version { undef }
sub _build_op_sys { undef }
sub _build_platform { undef }
sub _build_severity { undef }
sub _build_priority { undef }
sub _build_blocked { undef }
sub _build_dependson { undef }
sub _build_bug_file_loc { undef }
sub url { shift->bug_file_loc(@_) }
########################################################################
# create a hashref capable of being passed to Bugzilla.create_bug()
sub bughash {
my $self = shift @_;
lib/Fedora/Bugzilla/NewBug.pm view on Meta::CPAN
=item I<version>
=item I<op_sys>
=item I<platform>
=item I<severity>
=item I<priority>
=item I<blocked>
=item I<bug_file_loc>
Aka the "URL".
=back
=head1 BUGS AND LIMITATIONS
There are still many common attributes we do not handle yet.
t/06.xml_bits.t view on Meta::CPAN
=cut
my $moose = $bz->bug('perl-Moose');
my $mouse = $bug;
my $curl = $bz->bug('perl-WWW-Curl');
isa_ok $moose => 'Fedora::Bugzilla::Bug';
isa_ok $curl => 'Fedora::Bugzilla::Bug';
is $moose->blocks_anything => 1, 'moose blocks';
is $moose->num_blocked => 1, 'blocked count correct';
is $moose->blocks_bug(163779) => 1, 'correct bug blocked';
is $moose->blocks_bug(123456) => 0, 'no block 123456';
is $moose->depends_on_anything => 1, 'finds deps';
is $moose->num_deps => 5, 'deps count correct';
is $mouse->blocks_anything => 1, q{mouse does block 1 bug, hmm};
is $mouse->blocks_bug(123456) => 0, 'no block 123456';
is $mouse->depends_on_anything => 1, 'finds deps';
is $mouse->num_deps => 1, 'deps count correct';
# ok, this one doesn't actually either block or depend on anything
( run in 0.979 second using v1.01-cache-2.11-cpan-49f99fa48dc )