From: Karen Etheridge Date: Wed, 31 Oct 2012 20:21:55 +0000 (-0700) Subject: use namespace::autoclean in Moose classes X-Git-Tag: v1.003015~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aa8b764738156914d48d182ee0706e4c3d4e5c99;p=p5sagit%2FDevel-REPL.git use namespace::autoclean in Moose classes --- diff --git a/Changes b/Changes index b11aa49..7fcf1a2 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ - now using native Moose attribute traits, instead of the deprecated MooseX::AttributeHelper (thanks, Justin Hunter!) + - now using namespace::autoclean rather than namespace::clean (thanks, Karen + Etheridge!) 1.003013 - Make Sys::SigAction optional dependency for Win32 systems - Apply some plugin related patchs from Caleb Cushing diff --git a/Makefile.PL b/Makefile.PL index cf85e89..bf6a999 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -16,7 +16,7 @@ requires 'Term::ReadLine'; requires 'Moose' => '0.93'; requires 'MooseX::Object::Pluggable' => '0.0009'; requires 'MooseX::Getopt' => '0.18'; -requires 'namespace::clean'; +requires 'namespace::autoclean'; requires 'File::HomeDir'; requires 'Task::Weaken'; requires 'B::Concise'; diff --git a/lib/Devel/REPL.pm b/lib/Devel/REPL.pm index c48529e..6b46534 100644 --- a/lib/Devel/REPL.pm +++ b/lib/Devel/REPL.pm @@ -2,7 +2,7 @@ package Devel::REPL; use Term::ReadLine; use Moose; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; use 5.008001; # backwards compat, doesn't warn like 5.8.1 our $VERSION = '1.003013'; @@ -374,7 +374,7 @@ L >= 0.18 =item * -L +L =item * diff --git a/lib/Devel/REPL/Overview.pod b/lib/Devel/REPL/Overview.pod index cb36a93..2e643bf 100644 --- a/lib/Devel/REPL/Overview.pod +++ b/lib/Devel/REPL/Overview.pod @@ -234,7 +234,7 @@ take a look at it: use Moose; ### advanced OOP system for Perl ### keep those exports/imports out of our namespace - use namespace::clean -except => [ 'meta' ]; + use namespace::autoclean; with 'Devel::REPL::Profile'; ## seem perldoc Muse diff --git a/lib/Devel/REPL/Plugin/B/Concise.pm b/lib/Devel/REPL/Plugin/B/Concise.pm index 2965d9c..71b97be 100644 --- a/lib/Devel/REPL/Plugin/B/Concise.pm +++ b/lib/Devel/REPL/Plugin/B/Concise.pm @@ -7,7 +7,7 @@ use B::Concise (); B::Concise::compileOpts(qw(-nobanner)); -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; sub BEFORE_PLUGIN { my $self = shift; diff --git a/lib/Devel/REPL/Plugin/Colors.pm b/lib/Devel/REPL/Plugin/Colors.pm index e3d0725..46b30bb 100644 --- a/lib/Devel/REPL/Plugin/Colors.pm +++ b/lib/Devel/REPL/Plugin/Colors.pm @@ -2,7 +2,7 @@ package Devel::REPL::Plugin::Colors; use Devel::REPL::Plugin; use Term::ANSIColor; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; has normal_color => ( is => 'rw', lazy => 1, diff --git a/lib/Devel/REPL/Plugin/Commands.pm b/lib/Devel/REPL/Plugin/Commands.pm index 645d842..04aa22e 100644 --- a/lib/Devel/REPL/Plugin/Commands.pm +++ b/lib/Devel/REPL/Plugin/Commands.pm @@ -3,7 +3,7 @@ package Devel::REPL::Plugin::Commands; use Devel::REPL::Plugin; use Scalar::Util qw(weaken); -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; use vars qw($COMMAND_INSTALLER); has 'command_set' => ( diff --git a/lib/Devel/REPL/Plugin/Completion.pm b/lib/Devel/REPL/Plugin/Completion.pm index b1b4e99..dcc1837 100644 --- a/lib/Devel/REPL/Plugin/Completion.pm +++ b/lib/Devel/REPL/Plugin/Completion.pm @@ -2,7 +2,7 @@ package Devel::REPL::Plugin::Completion; use Devel::REPL::Plugin; use Scalar::Util 'weaken'; use PPI; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; has current_matches => ( is => 'rw', diff --git a/lib/Devel/REPL/Plugin/CompletionDriver/Globals.pm b/lib/Devel/REPL/Plugin/CompletionDriver/Globals.pm index 9ce0674..5dbed24 100644 --- a/lib/Devel/REPL/Plugin/CompletionDriver/Globals.pm +++ b/lib/Devel/REPL/Plugin/CompletionDriver/Globals.pm @@ -1,6 +1,6 @@ package Devel::REPL::Plugin::CompletionDriver::Globals; use Devel::REPL::Plugin; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; sub BEFORE_PLUGIN { my $self = shift; diff --git a/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm b/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm index 0daf803..40f147a 100644 --- a/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm +++ b/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm @@ -2,7 +2,7 @@ package Devel::REPL::Plugin::CompletionDriver::INC; use Devel::REPL::Plugin; use File::Next; use File::Spec; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; sub BEFORE_PLUGIN { my $self = shift; diff --git a/lib/Devel/REPL/Plugin/CompletionDriver/Keywords.pm b/lib/Devel/REPL/Plugin/CompletionDriver/Keywords.pm index 1178e8f..5078a14 100644 --- a/lib/Devel/REPL/Plugin/CompletionDriver/Keywords.pm +++ b/lib/Devel/REPL/Plugin/CompletionDriver/Keywords.pm @@ -1,7 +1,7 @@ package Devel::REPL::Plugin::CompletionDriver::Keywords; use Devel::REPL::Plugin; use B::Keywords qw/@Functions @Barewords/; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; sub BEFORE_PLUGIN { my $self = shift; diff --git a/lib/Devel/REPL/Plugin/CompletionDriver/LexEnv.pm b/lib/Devel/REPL/Plugin/CompletionDriver/LexEnv.pm index ea05e9a..133baaf 100644 --- a/lib/Devel/REPL/Plugin/CompletionDriver/LexEnv.pm +++ b/lib/Devel/REPL/Plugin/CompletionDriver/LexEnv.pm @@ -1,6 +1,6 @@ package Devel::REPL::Plugin::CompletionDriver::LexEnv; use Devel::REPL::Plugin; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; sub BEFORE_PLUGIN { my $self = shift; diff --git a/lib/Devel/REPL/Plugin/CompletionDriver/Methods.pm b/lib/Devel/REPL/Plugin/CompletionDriver/Methods.pm index 21c4e30..88afd5e 100644 --- a/lib/Devel/REPL/Plugin/CompletionDriver/Methods.pm +++ b/lib/Devel/REPL/Plugin/CompletionDriver/Methods.pm @@ -1,6 +1,6 @@ package Devel::REPL::Plugin::CompletionDriver::Methods; use Devel::REPL::Plugin; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; sub BEFORE_PLUGIN { my $self = shift; diff --git a/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm b/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm index bbb5a51..1472e37 100644 --- a/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm +++ b/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm @@ -1,6 +1,6 @@ package Devel::REPL::Plugin::CompletionDriver::Turtles; use Devel::REPL::Plugin; -use namespace::clean -except => [ "meta" ]; +use namespace::autoclean; sub BEFORE_PLUGIN { my $self = shift; diff --git a/lib/Devel/REPL/Plugin/DumpHistory.pm b/lib/Devel/REPL/Plugin/DumpHistory.pm index ed6e42b..3983e77 100644 --- a/lib/Devel/REPL/Plugin/DumpHistory.pm +++ b/lib/Devel/REPL/Plugin/DumpHistory.pm @@ -1,7 +1,7 @@ package Devel::REPL::Plugin::DumpHistory; use Devel::REPL::Plugin; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; ## Seems to be a sequence issue with requires # requires qw{ history }; diff --git a/lib/Devel/REPL/Plugin/FancyPrompt.pm b/lib/Devel/REPL/Plugin/FancyPrompt.pm index 1e7b40c..ce0225a 100644 --- a/lib/Devel/REPL/Plugin/FancyPrompt.pm +++ b/lib/Devel/REPL/Plugin/FancyPrompt.pm @@ -1,7 +1,7 @@ package Devel::REPL::Plugin::FancyPrompt; use Devel::REPL::Plugin; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; has 'fancy_prompt' => ( is => 'rw', lazy => 1, diff --git a/lib/Devel/REPL/Plugin/FindVariable.pm b/lib/Devel/REPL/Plugin/FindVariable.pm index 69a746c..cf2fd77 100644 --- a/lib/Devel/REPL/Plugin/FindVariable.pm +++ b/lib/Devel/REPL/Plugin/FindVariable.pm @@ -1,7 +1,7 @@ package Devel::REPL::Plugin::FindVariable; use Devel::REPL::Plugin; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; sub find_variable { my ($self, $name) = @_; diff --git a/lib/Devel/REPL/Plugin/History.pm b/lib/Devel/REPL/Plugin/History.pm index 9afa2be..8d77d05 100644 --- a/lib/Devel/REPL/Plugin/History.pm +++ b/lib/Devel/REPL/Plugin/History.pm @@ -1,7 +1,7 @@ package Devel::REPL::Plugin::History; use Devel::REPL::Plugin; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; has 'history' => ( isa => 'ArrayRef', is => 'rw', required => 1, lazy => 1, diff --git a/lib/Devel/REPL/Plugin/Interrupt.pm b/lib/Devel/REPL/Plugin/Interrupt.pm index 20adfec..7d64611 100644 --- a/lib/Devel/REPL/Plugin/Interrupt.pm +++ b/lib/Devel/REPL/Plugin/Interrupt.pm @@ -2,7 +2,7 @@ package Devel::REPL::Plugin::Interrupt; use Devel::REPL::Plugin; use Sys::SigAction qw(set_sig_handler); -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; around 'run' => sub { my ($orig, $self) = (shift, shift); diff --git a/lib/Devel/REPL/Plugin/LexEnv.pm b/lib/Devel/REPL/Plugin/LexEnv.pm index 8c99f17..e9a297f 100644 --- a/lib/Devel/REPL/Plugin/LexEnv.pm +++ b/lib/Devel/REPL/Plugin/LexEnv.pm @@ -1,7 +1,7 @@ package Devel::REPL::Plugin::LexEnv; use Devel::REPL::Plugin; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; use Lexical::Persistence; sub BEFORE_PLUGIN { diff --git a/lib/Devel/REPL/Plugin/MultiLine/PPI.pm b/lib/Devel/REPL/Plugin/MultiLine/PPI.pm index 1f23cfc..e9a2c2d 100644 --- a/lib/Devel/REPL/Plugin/MultiLine/PPI.pm +++ b/lib/Devel/REPL/Plugin/MultiLine/PPI.pm @@ -2,7 +2,7 @@ package Devel::REPL::Plugin::MultiLine::PPI; use Devel::REPL::Plugin; use PPI; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; has 'continuation_prompt' => ( is => 'rw', required => 1, lazy => 1, diff --git a/lib/Devel/REPL/Plugin/NewlineHack.pm b/lib/Devel/REPL/Plugin/NewlineHack.pm index 8f2a29d..03421cf 100644 --- a/lib/Devel/REPL/Plugin/NewlineHack.pm +++ b/lib/Devel/REPL/Plugin/NewlineHack.pm @@ -7,7 +7,7 @@ package Devel::REPL::Plugin::NewlineHack; use Devel::REPL::Plugin; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; warn < [ 'meta' ]; +use namespace::autoclean; use Scalar::Util qw(blessed); sub BEFORE_PLUGIN { diff --git a/lib/Devel/REPL/Plugin/OutputCache.pm b/lib/Devel/REPL/Plugin/OutputCache.pm index f1052e1..404c0b6 100644 --- a/lib/Devel/REPL/Plugin/OutputCache.pm +++ b/lib/Devel/REPL/Plugin/OutputCache.pm @@ -1,7 +1,7 @@ package Devel::REPL::Plugin::OutputCache; use Devel::REPL::Plugin; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; has output_cache => ( is => 'rw', diff --git a/lib/Devel/REPL/Plugin/PPI.pm b/lib/Devel/REPL/Plugin/PPI.pm index 85272d9..a53c767 100644 --- a/lib/Devel/REPL/Plugin/PPI.pm +++ b/lib/Devel/REPL/Plugin/PPI.pm @@ -6,7 +6,7 @@ use Devel::REPL::Plugin; use PPI; use PPI::Dumper; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; sub BEFORE_PLUGIN { my $self = shift; diff --git a/lib/Devel/REPL/Plugin/Packages.pm b/lib/Devel/REPL/Plugin/Packages.pm index a2b3fcd..616d320 100644 --- a/lib/Devel/REPL/Plugin/Packages.pm +++ b/lib/Devel/REPL/Plugin/Packages.pm @@ -1,7 +1,7 @@ package Devel::REPL::Plugin::Packages; use Devel::REPL::Plugin; -use namespace::clean -except => [ "meta" ]; +use namespace::autoclean; use vars qw($PKG_SAVE); diff --git a/lib/Devel/REPL/Plugin/Peek.pm b/lib/Devel/REPL/Plugin/Peek.pm index adb5667..c8a871f 100644 --- a/lib/Devel/REPL/Plugin/Peek.pm +++ b/lib/Devel/REPL/Plugin/Peek.pm @@ -5,7 +5,7 @@ use Devel::REPL::Plugin; use Devel::Peek qw(Dump); -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; sub BEFORE_PLUGIN { my $self = shift; diff --git a/lib/Devel/REPL/Plugin/Refresh.pm b/lib/Devel/REPL/Plugin/Refresh.pm index a94d5b6..f89f5d7 100644 --- a/lib/Devel/REPL/Plugin/Refresh.pm +++ b/lib/Devel/REPL/Plugin/Refresh.pm @@ -1,7 +1,7 @@ package Devel::REPL::Plugin::Refresh; use Devel::REPL::Plugin; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; use Module::Refresh; # before evaluating the code, ask Module::Refresh to refresh diff --git a/lib/Devel/REPL/Plugin/ShowClass.pm b/lib/Devel/REPL/Plugin/ShowClass.pm index b931cf1..9f79853 100644 --- a/lib/Devel/REPL/Plugin/ShowClass.pm +++ b/lib/Devel/REPL/Plugin/ShowClass.pm @@ -1,6 +1,6 @@ package Devel::REPL::Plugin::ShowClass; use Devel::REPL::Plugin; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; has 'metaclass_cache' => ( is => 'ro', diff --git a/lib/Devel/REPL/Plugin/Timing.pm b/lib/Devel/REPL/Plugin/Timing.pm index 503d625..c9248b7 100644 --- a/lib/Devel/REPL/Plugin/Timing.pm +++ b/lib/Devel/REPL/Plugin/Timing.pm @@ -2,7 +2,7 @@ package Devel::REPL::Plugin::Timing; use Devel::REPL::Plugin; use Time::HiRes 'time'; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; around 'eval' => sub { my $orig = shift; diff --git a/lib/Devel/REPL/Plugin/Turtles.pm b/lib/Devel/REPL/Plugin/Turtles.pm index ba26705..a8fd9df 100644 --- a/lib/Devel/REPL/Plugin/Turtles.pm +++ b/lib/Devel/REPL/Plugin/Turtles.pm @@ -3,7 +3,7 @@ use Devel::REPL::Plugin; use Scalar::Util qw(reftype); -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; has default_command_prefix => ( isa => "RegexpRef", diff --git a/lib/Devel/REPL/Profile.pm b/lib/Devel/REPL/Profile.pm index 5085298..c86b2ed 100644 --- a/lib/Devel/REPL/Profile.pm +++ b/lib/Devel/REPL/Profile.pm @@ -1,7 +1,6 @@ package Devel::REPL::Profile; use Moose::Role; -use namespace::clean -except => [ 'meta' ]; requires 'apply_profile'; @@ -14,7 +13,7 @@ Devel::REPL::Profile package Devel::REPL::Profile::MyProject; use Moose; - use namespace::clean -except => [ 'meta' ]; + use namespace::autoclean; with 'Devel::REPL::Profile'; diff --git a/lib/Devel/REPL/Profile/Default.pm b/lib/Devel/REPL/Profile/Default.pm index 8bfa69d..dc00876 100644 --- a/lib/Devel/REPL/Profile/Default.pm +++ b/lib/Devel/REPL/Profile/Default.pm @@ -1,7 +1,7 @@ package Devel::REPL::Profile::Default; use Moose; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; with 'Devel::REPL::Profile'; diff --git a/lib/Devel/REPL/Profile/Minimal.pm b/lib/Devel/REPL/Profile/Minimal.pm index 2b03ac9..6740fbe 100644 --- a/lib/Devel/REPL/Profile/Minimal.pm +++ b/lib/Devel/REPL/Profile/Minimal.pm @@ -1,7 +1,7 @@ package Devel::REPL::Profile::Minimal; use Moose; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; with 'Devel::REPL::Profile'; diff --git a/lib/Devel/REPL/Script.pm b/lib/Devel/REPL/Script.pm index 2265638..fec8e7d 100644 --- a/lib/Devel/REPL/Script.pm +++ b/lib/Devel/REPL/Script.pm @@ -5,7 +5,7 @@ use Devel::REPL; use File::HomeDir; use File::Spec; use vars qw($CURRENT_SCRIPT); -use namespace::clean -except => [ qw(meta) ]; +use namespace::autoclean; with 'MooseX::Getopt';