| 1 | package Dist::Zilla::Plugin::Web::RelaxedVersion; | ||
| 2 | $Dist::Zilla::Plugin::Web::RelaxedVersion::VERSION = '0.0.10'; | ||
| 3 | # ABSTRACT: Allow free-form version of the distribution, currently using dirty hack | ||
| 4 | |||
| 5 | use Moose; | ||
| 6 | |||
| 7 | with 'Dist::Zilla::Role::Plugin'; | ||
| 8 | |||
| 9 | use version 0.82; | ||
| 10 | |||
| 11 | has 'enabled' => ( | ||
| 12 | isa => 'Bool', | ||
| 13 | is => 'rw', | ||
| 14 | |||
| 15 | default => 0 | ||
| 16 | ); | ||
| 17 | |||
| 18 | |||
| 19 | #================================================================================================================================================================================================================================================ | ||
| 20 | sub BUILD { | ||
| 21 | my ($self) = @_; | ||
| 22 | |||
| 23 | if ($self->enabled) { | ||
| 24 | no warnings; | ||
| 25 | |||
| 26 | *version::is_lax = sub { 1 }; | ||
| 27 | } | ||
| 28 | } | ||
| 29 | |||
| 30 | |||
| 31 | no Moose; | ||
| 32 | __PACKAGE__->meta->make_immutable(inline_constructor => 0); | ||
| 33 | |||
| 34 | |||
| 35 | 1; | ||
| 36 | |||
| 37 | __END__ |