From: Dave Rolsky Date: Thu, 28 Mar 2013 16:01:45 +0000 (-0500) Subject: Fix for breakage with Moose 2.08 X-Git-Tag: v0.27~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b0871254d569eb8f5c63d806b22d38689d05534f;p=gitmo%2FMooseX-ClassAttribute.git Fix for breakage with Moose 2.08 Moose::Util::_caller_info now returns a hash, not a reference --- diff --git a/lib/MooseX/ClassAttribute.pm b/lib/MooseX/ClassAttribute.pm index 53a2a7c..c43eccd 100644 --- a/lib/MooseX/ClassAttribute.pm +++ b/lib/MooseX/ClassAttribute.pm @@ -31,11 +31,19 @@ sub class_has { my $attrs = ref $name eq 'ARRAY' ? $name : [$name]; - my %options = ( definition_context => Moose::Util::_caller_info(), @_ ); + my %options = ( definition_context => _caller_info(), @_ ); $meta->add_class_attribute( $_, %options ) for @{$attrs}; } +# Copied from Moose::Util in 2.06 +sub _caller_info { + my $level = @_ ? ($_[0] + 1) : 2; + my %info; + @info{qw(package file line)} = caller($level); + return \%info; +} + 1; # ABSTRACT: Declare class attributes Moose-style