From c46a2bdaa92873508dcae074b21c021c99aa6480 Mon Sep 17 00:00:00 2001 From: Tomas Doran Date: Wed, 25 Aug 2010 19:07:26 +0100 Subject: [PATCH 1/6] Check the actual roles applied rather than the accessor --- t/01-basic.t | 4 ++-- t/04-no_merge.t | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/t/01-basic.t b/t/01-basic.t index 9f78aba..50ee3fc 100644 --- a/t/01-basic.t +++ b/t/01-basic.t @@ -73,7 +73,7 @@ is eval { $instance->bar }, 'baz', is $instance->find_app_class, 'MyApp', 'Can find app class passing instance'; is_deeply( - MyApp->controller('MyController')->_traits, - [qw/Foo Bar Quux/], + [MyApp->controller('MyController')->meta->calculate_all_roles]->[0]->name, + 'Catalyst::TraitFor::Controller::SomeController::Foo|MyApp::TraitFor::Controller::SomeController::Bar|MyApp::TraitFor::Controller::SomeController::Quux', 'traits merged correctly' ); diff --git a/t/04-no_merge.t b/t/04-no_merge.t index 350bd0e..7eed01a 100644 --- a/t/04-no_merge.t +++ b/t/04-no_merge.t @@ -57,7 +57,7 @@ is eval { MyApp->controller('MyController')->bar }, 'baz', 'trait initialized from app config works'; is_deeply( - MyApp->controller('MyController')->_traits, - [qw/Foo Bar Baz/], + [MyApp->controller('MyController')->meta->calculate_all_roles]->[0]->name, + 'Catalyst::TraitFor::Controller::SomeController::Foo|MyApp::TraitFor::Controller::SomeController::Bar|MyApp::TraitFor::Controller::SomeController::Baz', 'traits from app config override traits from component config' ); From b51ed204edf0c4cdc3a918099c1ad1b691f51be6 Mon Sep 17 00:00:00 2001 From: Tomas Doran Date: Wed, 25 Aug 2010 19:10:00 +0100 Subject: [PATCH 2/6] Change repos metadata --- Makefile.PL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index bea2c59..523da78 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -2,7 +2,7 @@ use inc::Module::Install; name 'CatalystX-Component-Traits'; all_from 'lib/CatalystX/Component/Traits.pm'; -author 'Rafael Kitover '; +author 'Rafael Kitover '; license 'perl'; test_requires 'Test::More' => '0.88'; @@ -19,6 +19,6 @@ auto_provides; auto_install; resources repository => - 'git://github.com/rkitover/catalystx-component-traits.git'; + 'git://github.com/bobtfish/catalystx-component-traits.git'; WriteAll; From 1c3ae43f97c94e5cb626c5e50612eef18791190a Mon Sep 17 00:00:00 2001 From: Tomas Doran Date: Wed, 25 Aug 2010 19:10:13 +0100 Subject: [PATCH 3/6] Verion 0.15 --- Changes | 5 +++++ lib/CatalystX/Component/Traits.pm | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index d3b27eb..22aabd3 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Revision history for CatalystX-Component-Traits +0.15 2010-08-25 19:09:00 + - Change excludes to -excludes when using MooseX::Traits::Pluggable + to avoid the deprecation warning. + - Change primary repository URI in metadata + 0.14 2009-11-08 05:43:37 - minor code cleanup diff --git a/lib/CatalystX/Component/Traits.pm b/lib/CatalystX/Component/Traits.pm index 3d398b5..683ef90 100644 --- a/lib/CatalystX/Component/Traits.pm +++ b/lib/CatalystX/Component/Traits.pm @@ -5,7 +5,7 @@ use Moose::Role; use Carp; use List::MoreUtils qw/firstidx any uniq/; use Scalar::Util 'reftype'; -with 'MooseX::Traits::Pluggable' => { excludes => ['_find_trait'] }; +with 'MooseX::Traits::Pluggable' => { -excludes => ['_find_trait'] }; =head1 NAME From 3bd5b365134f19d521d11397fb6648fe3b019802 Mon Sep 17 00:00:00 2001 From: Tomas Doran Date: Thu, 26 Aug 2010 19:07:46 +0100 Subject: [PATCH 4/6] Version 0.16 --- Changes | 3 +++ lib/CatalystX/Component/Traits.pm | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 22aabd3..991fdbb 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for CatalystX-Component-Traits +0.16 2010-08-26 19:07:00 + - Neglected to bump the version in last release. + 0.15 2010-08-25 19:09:00 - Change excludes to -excludes when using MooseX::Traits::Pluggable to avoid the deprecation warning. diff --git a/lib/CatalystX/Component/Traits.pm b/lib/CatalystX/Component/Traits.pm index 683ef90..79023db 100644 --- a/lib/CatalystX/Component/Traits.pm +++ b/lib/CatalystX/Component/Traits.pm @@ -14,11 +14,11 @@ Catalyst Components =head1 VERSION -Version 0.14 +Version 0.16 =cut -our $VERSION = '0.14'; +our $VERSION = '0.16'; our $AUTHORITY = 'id:RKITOVER'; =head1 SYNOPSIS From a3cba4bc924f71f81c01313cd8fa07ab7db2cdb9 Mon Sep 17 00:00:00 2001 From: Tomas Doran Date: Thu, 2 Jan 2014 13:32:24 +0000 Subject: [PATCH 5/6] Fix RT#91014 --- Changes | 2 ++ Makefile.PL | 1 + lib/CatalystX/Component/Traits.pm | 10 +++------- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Changes b/Changes index 991fdbb..03669fb 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for CatalystX-Component-Traits + - Fix RT#91014 + 0.16 2010-08-26 19:07:00 - Neglected to bump the version in last release. diff --git a/Makefile.PL b/Makefile.PL index 523da78..602b262 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -12,6 +12,7 @@ requires 'MooseX::Traits::Pluggable' => '0.08'; requires 'namespace::autoclean'; requires 'List::MoreUtils'; requires 'Scalar::Util'; +requires 'Class::Load'; test_requires 'Module::Pluggable' => '3.9'; diff --git a/lib/CatalystX/Component/Traits.pm b/lib/CatalystX/Component/Traits.pm index 79023db..e39b280 100644 --- a/lib/CatalystX/Component/Traits.pm +++ b/lib/CatalystX/Component/Traits.pm @@ -5,6 +5,8 @@ use Moose::Role; use Carp; use List::MoreUtils qw/firstidx any uniq/; use Scalar::Util 'reftype'; +use Class::Load qw/ load_first_existing_class /; + with 'MooseX::Traits::Pluggable' => { -excludes => ['_find_trait'] }; =head1 NAME @@ -183,13 +185,7 @@ sub _merge_traits { sub _find_trait { my ($class, $base, $name) = @_; - my @tried; # FIXME - This sux, use load_first_existing_class ? - for my $trait ($class->_trait_search_order($base, $name)) { - push @tried, $trait; - return $trait if eval { Class::MOP::load_class($trait) }; - } - - croak "Could not find a class for trait: $name (tried " . join(',', @tried) . ")"; + load_first_existing_class($class->_trait_search_order($base, $name)); } sub _trait_search_order { From 9dff510255bb224e40fcf22ab93661f43c1cc29f Mon Sep 17 00:00:00 2001 From: Tomas Doran Date: Thu, 2 Jan 2014 13:33:00 +0000 Subject: [PATCH 6/6] Version 0.17 --- Changes | 1 + lib/CatalystX/Component/Traits.pm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 03669fb..33244e1 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ Revision history for CatalystX-Component-Traits +0.17 2014-01-02 13:32:00 - Fix RT#91014 0.16 2010-08-26 19:07:00 diff --git a/lib/CatalystX/Component/Traits.pm b/lib/CatalystX/Component/Traits.pm index e39b280..5a62979 100644 --- a/lib/CatalystX/Component/Traits.pm +++ b/lib/CatalystX/Component/Traits.pm @@ -16,11 +16,11 @@ Catalyst Components =head1 VERSION -Version 0.16 +Version 0.17 =cut -our $VERSION = '0.16'; +our $VERSION = '0.17'; our $AUTHORITY = 'id:RKITOVER'; =head1 SYNOPSIS