Permalink
Browse files

don't use Dancer in Dancer::Plugin, change versioning variable

  • Loading branch information...
1 parent 996cdec commit a0b38421bdcf74f4dcc18461268c44ded73ac4a5 @dams dams committed Mar 14, 2012
Showing with 4 additions and 3 deletions.
  1. +0 −1 lib/Dancer.pm
  2. +4 −2 lib/Dancer/Plugin.pm
View
1 lib/Dancer.pm
@@ -12,7 +12,6 @@ use Dancer::FileUtils;
our $VERSION = '1.9999_01';
our $AUTHORITY = 'SUKRIA';
-our $MAJOR_VERSION = 2;
#
# private
View
6 lib/Dancer/Plugin.pm
@@ -2,7 +2,9 @@ package Dancer::Plugin;
use Moo::Role;
use Carp 'croak';
use Dancer::Core::DSL;
-use Dancer;
+
+# The plugin system major version, to check compatibility against it
+our $PLUGIN_MAJOR_VERSION = 2;
sub _get_dsl {
my $dsl;
@@ -108,7 +110,7 @@ sub register_plugin {
ref $supported_versions eq 'ARRAY'
or croak "register_plugin must be called like this : register_plugin for_versions => [ 1, 2 ]";
- +{ map { $_ => 1 } @$supported_versions }->{$Dancer::MAJOR_VERSION}
+ +{ map { $_ => 1 } @$supported_versions }->{$PLUGIN_MAJOR_VERSION}
or croak "can't register plugin '$plugin', it doesn't support Dancer version $Dancer::MAJOR_VERSION, it only supports these version(s): " . join(',', @$supported_versions) . ". Please upgrade the plugin.";
# if the caller has not a dsl, we cant register the plugin

0 comments on commit a0b3842

Please sign in to comment.