Skip to content
This repository
Browse code

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

  • Loading branch information...
commit a0b38421bdcf74f4dcc18461268c44ded73ac4a5 1 parent 996cdec
Damien Krotkine dams authored

Showing 2 changed files with 4 additions and 3 deletions. Show diff stats Hide diff stats

  1. +0 1  lib/Dancer.pm
  2. +4 2 lib/Dancer/Plugin.pm
1  lib/Dancer.pm
@@ -12,7 +12,6 @@ use Dancer::FileUtils;
12 12
13 13 our $VERSION = '1.9999_01';
14 14 our $AUTHORITY = 'SUKRIA';
15   -our $MAJOR_VERSION = 2;
16 15
17 16 #
18 17 # private
6 lib/Dancer/Plugin.pm
@@ -2,7 +2,9 @@ package Dancer::Plugin;
2 2 use Moo::Role;
3 3 use Carp 'croak';
4 4 use Dancer::Core::DSL;
5   -use Dancer;
  5 +
  6 +# The plugin system major version, to check compatibility against it
  7 +our $PLUGIN_MAJOR_VERSION = 2;
6 8
7 9 sub _get_dsl {
8 10 my $dsl;
@@ -108,7 +110,7 @@ sub register_plugin {
108 110 ref $supported_versions eq 'ARRAY'
109 111 or croak "register_plugin must be called like this : register_plugin for_versions => [ 1, 2 ]";
110 112
111   - +{ map { $_ => 1 } @$supported_versions }->{$Dancer::MAJOR_VERSION}
  113 + +{ map { $_ => 1 } @$supported_versions }->{$PLUGIN_MAJOR_VERSION}
112 114 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.";
113 115
114 116 # if the caller has not a dsl, we cant register the plugin

0 comments on commit a0b3842

Please sign in to comment.
Something went wrong with that request. Please try again.