From 05fbffed0538e4be0105959384f234c45bf618ea Mon Sep 17 00:00:00 2001
From: Toby Inkster <tobyink@cpan.org>
Date: Fri, 18 Nov 2011 13:59:03 +0000
Subject: [PATCH 2/2] Allow extra options (the actual change)

---
 lib/MooseX/Declare/Context/WithOptions.pm |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/MooseX/Declare/Context/WithOptions.pm b/lib/MooseX/Declare/Context/WithOptions.pm
index 8bb99fa..8042396 100644
--- a/lib/MooseX/Declare/Context/WithOptions.pm
+++ b/lib/MooseX/Declare/Context/WithOptions.pm
@@ -2,7 +2,7 @@ package MooseX::Declare::Context::WithOptions;
 
 use Moose::Role;
 use Carp qw/croak/;
-use MooseX::Types::Moose 0.20 qw/HashRef/;
+use MooseX::Types::Moose 0.20 qw/HashRef ArrayRef/;
 
 use namespace::clean -except => 'meta';
 
@@ -13,6 +13,13 @@ has options => (
     lazy    => 1,
 );
 
+has allowed_option_names => (
+    is      => 'rw',
+    isa     => ArrayRef,
+    default => sub { [qw/extends with is/] },
+    lazy    => 1,
+);
+
 sub strip_options {
     my ($self) = @_;
     my %ret;
@@ -33,7 +40,7 @@ sub strip_options {
         }
 
         croak "unknown option name '$key'"
-            unless $key =~ /^(extends|with|is)$/;
+            unless grep { $key eq $_ } @{ $self->allowed_option_names };
 
         my $val = $self->strip_name;
         if (!defined $val) {
-- 
1.6.4.4

