Skip Menu |

This queue is for tickets about the Role-Tiny CPAN distribution.

Report information
The Basics
Id: 79747
Status: resolved
Priority: 0/
Queue: Role-Tiny

People
Owner: Nobody in particular
Requestors: perl [...] toby.ink
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 1.000000
  • 1.000001
  • 1.000_900
  • 1.000_901
  • 1.001000
  • 1.001001
  • 1.001002
  • 1.001003
  • 1.001004
  • 1.001005
Fixed in: (no value)



Subject: Role::Tiny doesn't override UNIVERSAL::DOES
While Role::Tiny roles provide a "does" method for classes that consume them, they don't touch "DOES", which (as of Perl 5.10) is the standard Perl way of indicating that objects and classes do a role. Moose and Mouse both override DOES. So should Moo.
Subject: moo-role.pl
use Test::More tests => 2; { package Transport; use Role::Tiny; } { package Train; use Role::Tiny::With; with qw(Transport); sub new { my ($class, %args) = @_; bless \%args => $class; } } my $thomas = Train->new; ok $thomas->does('Transport'); ok $thomas->DOES('Transport');
Newer version: http://buzzword.org.uk/2012/Role-Tiny-DOES-tobyink-20121003-2.diff haarg pointed out on IRC that with the previous patch method modifiers didn't work on DOES(). I noticed that the same was true for does(). The new version of the patch installs does() and DOES() before method modifiers are processed, this allowing them to be modified.
OK, there's now a patch for this in the "feature-DOES" branch... http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/Role- Tiny.git;a=shortlog;h=refs/heads/feature-DOES
Fixed in Role-Tiny-1.002000.