From: Justin Hunter Date: Thu, 2 Jul 2009 16:29:46 +0000 (-0700) Subject: move from no Moose[::Role] to use namespace::autoclean X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=abb2c32785d707559ca34b277e70d8f9536ecd48;p=dbsrgits%2FSQL-Translator-2.0-ish.git move from no Moose[::Role] to use namespace::autoclean --- diff --git a/lib/SQL/Translator/Object/Column.pm b/lib/SQL/Translator/Object/Column.pm index 89d6ceb..3d7a061 100644 --- a/lib/SQL/Translator/Object/Column.pm +++ b/lib/SQL/Translator/Object/Column.pm @@ -1,4 +1,5 @@ package SQL::Translator::Object::Column; +use namespace::autoclean; use Moose; use MooseX::Types::Moose qw(Bool Int Maybe Str); use SQL::Translator::Types qw(Trigger); @@ -54,7 +55,6 @@ has 'trigger' => ( required => 0 ); -no Moose; __PACKAGE__->meta->make_immutable; 1; diff --git a/lib/SQL/Translator/Object/Constraint.pm b/lib/SQL/Translator/Object/Constraint.pm index e9fb5df..a5c303a 100644 --- a/lib/SQL/Translator/Object/Constraint.pm +++ b/lib/SQL/Translator/Object/Constraint.pm @@ -1,4 +1,5 @@ package SQL::Translator::Object::Constraint; +use namespace::autoclean; use Moose; use MooseX::Types::Moose qw(HashRef Str); use MooseX::AttributeHelpers; @@ -30,7 +31,6 @@ has 'type' => ( required => 1 ); -no Moose; __PACKAGE__->meta->make_immutable; 1; diff --git a/lib/SQL/Translator/Object/Index.pm b/lib/SQL/Translator/Object/Index.pm index e65624d..e5a0bb6 100644 --- a/lib/SQL/Translator/Object/Index.pm +++ b/lib/SQL/Translator/Object/Index.pm @@ -1,4 +1,5 @@ package SQL::Translator::Object::Index; +use namespace::autoclean; use Moose; use MooseX::Types::Moose qw(HashRef Str); use MooseX::AttributeHelpers; @@ -31,7 +32,6 @@ has 'type' => ( required => 1 ); -no Moose; __PACKAGE__->meta->make_immutable; 1; diff --git a/lib/SQL/Translator/Object/Procedure.pm b/lib/SQL/Translator/Object/Procedure.pm index 42fec3e..1350b5c 100644 --- a/lib/SQL/Translator/Object/Procedure.pm +++ b/lib/SQL/Translator/Object/Procedure.pm @@ -1,4 +1,5 @@ package SQL::Translator::Object::Procedure; +use namespace::autoclean; use Moose; use MooseX::Types::Moose qw(HashRef Int Maybe Str); use MooseX::AttributeHelpers; @@ -50,7 +51,6 @@ has 'schema' => ( default => sub { SQL::Translator::Object::Schema->new } ); -no Moose; __PACKAGE__->meta->make_immutable; 1; diff --git a/lib/SQL/Translator/Object/Schema.pm b/lib/SQL/Translator/Object/Schema.pm index 3062a02..cbbf87b 100644 --- a/lib/SQL/Translator/Object/Schema.pm +++ b/lib/SQL/Translator/Object/Schema.pm @@ -1,4 +1,5 @@ package SQL::Translator::Object::Schema; +use namespace::autoclean; use Moose; use MooseX::Types::Moose qw(HashRef Maybe Str); use MooseX::AttributeHelpers; @@ -54,7 +55,6 @@ has 'procedures' => ( required => 0 ); -no Moose; __PACKAGE__->meta()->make_immutable; 1; diff --git a/lib/SQL/Translator/Object/Table.pm b/lib/SQL/Translator/Object/Table.pm index 763fa02..ed540cb 100644 --- a/lib/SQL/Translator/Object/Table.pm +++ b/lib/SQL/Translator/Object/Table.pm @@ -1,4 +1,5 @@ package SQL::Translator::Object::Table; +use namespace::autoclean; use Moose; use MooseX::Types::Moose qw(HashRef Str); use MooseX::AttributeHelpers; @@ -54,7 +55,6 @@ has 'constraints' => ( required => 0 ); -no Moose; __PACKAGE__->meta()->make_immutable; 1; diff --git a/lib/SQL/Translator/Object/Trigger.pm b/lib/SQL/Translator/Object/Trigger.pm index 2f98b41..8f91658 100644 --- a/lib/SQL/Translator/Object/Trigger.pm +++ b/lib/SQL/Translator/Object/Trigger.pm @@ -1,4 +1,5 @@ package SQL::Translator::Object::Trigger; +use namespace::autoclean; use Moose; use MooseX::Types::Moose qw(Str); use SQL::Translator::Types qw(); @@ -6,7 +7,6 @@ extends 'SQL::Translator::Object'; has 'name' => (is => 'ro', isa => Str, required => 1); -no Moose; __PACKAGE__->meta->make_immutable; 1; diff --git a/lib/SQL/Translator/Object/View.pm b/lib/SQL/Translator/Object/View.pm index d179c63..dfabb15 100644 --- a/lib/SQL/Translator/Object/View.pm +++ b/lib/SQL/Translator/Object/View.pm @@ -1,4 +1,5 @@ package SQL::Translator::Object::View; +use namespace::autoclean; use Moose; use MooseX::Types::Moose qw(HashRef Str); use MooseX::AttributeHelpers; @@ -30,7 +31,6 @@ has 'sql' => ( required => 1 ); -no Moose; __PACKAGE__->meta->make_immutable; 1; diff --git a/lib/SQL/Translator/Parser.pm b/lib/SQL/Translator/Parser.pm index 4f4aa3f..13e3eb0 100644 --- a/lib/SQL/Translator/Parser.pm +++ b/lib/SQL/Translator/Parser.pm @@ -1,4 +1,5 @@ package SQL::Translator::Parser; +use namespace::autoclean; use Moose; use MooseX::Types::Moose qw(Str); use SQL::Translator::Types qw(DBIHandle); @@ -38,6 +39,6 @@ after BUILD => sub { print Dumper($schema); }; -no Moose; __PACKAGE__->meta->make_immutable; + 1; diff --git a/lib/SQL/Translator/Parser/DBI.pm b/lib/SQL/Translator/Parser/DBI.pm index 96f25a1..f81aebc 100644 --- a/lib/SQL/Translator/Parser/DBI.pm +++ b/lib/SQL/Translator/Parser/DBI.pm @@ -1,4 +1,5 @@ package SQL::Translator::Parser::DBI; +use namespace::autoclean; use Moose::Role; use MooseX::Types::Moose qw(Maybe Str); use DBI::Const::GetInfoType; @@ -41,8 +42,6 @@ has 'catalog_name' => ( default => undef ); -no Moose::Role; - sub _subclass { my $self = shift; diff --git a/lib/SQL/Translator/Parser/DBI/MySQL.pm b/lib/SQL/Translator/Parser/DBI/MySQL.pm index 60f65ea..6f39b5f 100644 --- a/lib/SQL/Translator/Parser/DBI/MySQL.pm +++ b/lib/SQL/Translator/Parser/DBI/MySQL.pm @@ -1,6 +1,5 @@ package SQL::Translator::Parser::DBI::MySQL; +use namespace::autoclean; use Moose::Role; -no Moose::Role; - 1; diff --git a/lib/SQL/Translator/Parser/DBI/Oracle.pm b/lib/SQL/Translator/Parser/DBI/Oracle.pm index 2d28060..be89f91 100644 --- a/lib/SQL/Translator/Parser/DBI/Oracle.pm +++ b/lib/SQL/Translator/Parser/DBI/Oracle.pm @@ -1,6 +1,5 @@ package SQL::Translator::Parser::DBI::Oracle; +use namespace::autoclean; use Moose::Role; -no Moose::Role; - 1; diff --git a/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm b/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm index 4f46d43..065166b 100644 --- a/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm +++ b/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm @@ -1,17 +1,15 @@ package SQL::Translator::Parser::DBI::PostgreSQL; +use namespace::autoclean; use Moose::Role; use MooseX::Types::Moose qw(Str); -has 'schema_name' => ( - is => 'rw', +has '+schema_name' => ( isa => Str, required => 1, lazy => 1, default => 'public' ); -no Moose::Role; - sub _get_view_sql { my $self = shift; my $view = shift; diff --git a/lib/SQL/Translator/Parser/DBI/SQLite.pm b/lib/SQL/Translator/Parser/DBI/SQLite.pm index 857566f..2df7a62 100644 --- a/lib/SQL/Translator/Parser/DBI/SQLite.pm +++ b/lib/SQL/Translator/Parser/DBI/SQLite.pm @@ -1,6 +1,5 @@ package SQL::Translator::Parser::DBI::SQLite; +use namespace::autoclean; use Moose::Role; -no Moose::Role; - 1; diff --git a/lib/SQL/Translator/Parser/DBI/Sybase.pm b/lib/SQL/Translator/Parser/DBI/Sybase.pm index 3c1d012..055f2bb 100644 --- a/lib/SQL/Translator/Parser/DBI/Sybase.pm +++ b/lib/SQL/Translator/Parser/DBI/Sybase.pm @@ -1,6 +1,5 @@ package SQL::Translator::Parser::DBI::Sybase; +use namespace::autoclean; use Moose::Role; -no Moose::Role; - 1; diff --git a/lib/SQL/Translator/Parser/DDL.pm b/lib/SQL/Translator/Parser/DDL.pm index 8e8c2ad..2e29d40 100644 --- a/lib/SQL/Translator/Parser/DDL.pm +++ b/lib/SQL/Translator/Parser/DDL.pm @@ -1,6 +1,5 @@ package SQL::Translator::Parser::DDL; +use namespace::autoclean; use Moose::Role; -no Moose::Role; - 1; diff --git a/lib/SQL/Translator/Parser/DDL/MySQL.pm b/lib/SQL/Translator/Parser/DDL/MySQL.pm index 91f2f74..0f13bef 100644 --- a/lib/SQL/Translator/Parser/DDL/MySQL.pm +++ b/lib/SQL/Translator/Parser/DDL/MySQL.pm @@ -1,6 +1,5 @@ package SQL::Translator::Parser::DDL::MySQL; +use namespace::autoclean; use Moose::Role; -no Moose::Role; - 1; diff --git a/lib/SQL/Translator/Parser/DDL/Oracle.pm b/lib/SQL/Translator/Parser/DDL/Oracle.pm index cee7a74..4045a3b 100644 --- a/lib/SQL/Translator/Parser/DDL/Oracle.pm +++ b/lib/SQL/Translator/Parser/DDL/Oracle.pm @@ -1,6 +1,5 @@ package SQL::Translator::Parser::DDL::Oracle; +use namespace::autoclean; use Moose::Role; -no Moose::Role; - 1; diff --git a/lib/SQL/Translator/Parser/DDL/PostgreSQL.pm b/lib/SQL/Translator/Parser/DDL/PostgreSQL.pm index 8a52df7..9715e95 100644 --- a/lib/SQL/Translator/Parser/DDL/PostgreSQL.pm +++ b/lib/SQL/Translator/Parser/DDL/PostgreSQL.pm @@ -1,6 +1,5 @@ package SQL::Translator::Parser::DDL::PostgreSQL; +use namespace::autoclean; use Moose::Role; -no Moose::Role; - 1; diff --git a/lib/SQL/Translator/Parser/DDL/SQLite.pm b/lib/SQL/Translator/Parser/DDL/SQLite.pm index c7ffe87..448ba3d 100644 --- a/lib/SQL/Translator/Parser/DDL/SQLite.pm +++ b/lib/SQL/Translator/Parser/DDL/SQLite.pm @@ -1,6 +1,5 @@ package SQL::Translator::Parser::DDL::SQLite; +use namespace::autoclean; use Moose::Role; -no Moose::Role; - 1; diff --git a/lib/SQL/Translator/Parser/DDL/Sybase.pm b/lib/SQL/Translator/Parser/DDL/Sybase.pm index 126067d..70dbde6 100644 --- a/lib/SQL/Translator/Parser/DDL/Sybase.pm +++ b/lib/SQL/Translator/Parser/DDL/Sybase.pm @@ -1,6 +1,5 @@ package SQL::Translator::Parser::DDL::Sybase; +use namespace::autoclean; use Moose::Role; -no Moose::Role; - 1;