Skip to content

Commit

Permalink
convert use Moose to use Moo
Browse files Browse the repository at this point in the history
  • Loading branch information
felliott committed Nov 3, 2014
1 parent 5bbde48 commit e416d30
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
2 changes: 2 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ requires 'Hash::Merge' => '0.11';
requires 'List::MoreUtils' => '0.22';
requires 'Module::Runtime' => '0.013';
requires 'Moose' => '1.10';
requires 'Moo' => '1.006';
requires 'namespace::clean';
requires 'Path::Class' => '0.21';
requires 'SQL::Translator' => '0.11006';
requires 'Scalar::Util' => '1.23';
Expand Down
4 changes: 3 additions & 1 deletion lib/Test/DBIx/Class/FixtureCommand/Populate.pm
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package Test::DBIx::Class::FixtureCommand::Populate; {

use Moose;
use Test::More ();

use Moo;
with 'Test::DBIx::Class::Role::FixtureCommand';
use namespace::clean;

sub install_fixtures {
my ($self, $arg, @rest) = @_;
Expand Down
4 changes: 3 additions & 1 deletion lib/Test/DBIx/Class/FixtureCommand/PopulateMore.pm
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package Test::DBIx::Class::FixtureCommand::PopulateMore; {

use Moose;
use Test::More ();
use DBIx::Class::Schema::PopulateMore::Command;

use Moo;
with 'Test::DBIx::Class::Role::FixtureCommand';
use namespace::clean;

sub install_fixtures {
my ($self, $arg, @rest) = @_;
Expand Down
28 changes: 17 additions & 11 deletions lib/Test/DBIx/Class/SchemaManager.pm
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
package Test::DBIx::Class::SchemaManager;

use Moose;
use Moose::Util;
use Test::More ();
use List::MoreUtils qw(uniq);
use Test::DBIx::Class::Types qw( :types :to );
use Types::Standard qw(Bool HashRef Str);

use Moo;
use namespace::clean;

has 'force_drop_table' => (
is=>'rw',
required=>1,
isa=>Bool,
builder => '_build_force_drop_table',
builder=>1,
);
sub _build_force_drop_table {
$ENV{force_drop_table} || $ENV{FORCE_DROP_TABLE} || 0
Expand All @@ -21,7 +23,7 @@ has 'keep_db' => (
is=>'ro',
isa=>Bool,
required=>1,
builder=>'_build_keep_db',
builder=>1,
);
sub _build_keep_db {
$ENV{keep_db} || $ENV{KEEP_DB} || 0
Expand All @@ -31,7 +33,7 @@ has 'tdbic_debug' => (
is=>'ro',
isa=>Bool,
required=>1,
builder=>'_build_tdbic_debug',
builder=>1,
);
sub _build_tdbic_debug {
$ENV{tdbic_debug} || $ENV{TDBIC_DEBUG} || 0
Expand All @@ -41,7 +43,7 @@ has 'deploy_db' => (
is=>'ro',
required=>1,
isa=>Bool,
builder=>'_build_deploy_db',
builder=>1,
);
sub _build_deploy_db {
$ENV{deploy_db} || $ENV{DEPLOY_DB} || 1
Expand All @@ -58,7 +60,7 @@ has 'schema_class' => (
isa => SchemaManagerClass,
required => 1,
coerce => 1,
builder => '_build_schema_class',
builder => 1,
);
sub _build_schema_class {
$ENV{schema_class} || $ENV{SCHEMA_CLASS}
Expand All @@ -67,14 +69,16 @@ sub _build_schema_class {

has 'schema' => (
is => 'ro',
lazy_build => 1,
lazy => 1,
builder => 1,
);

has 'connect_info' => (
is => 'ro',
isa => ConnectInfo,
coerce => 1,
lazy_build => 1,
lazy => 1,
builder => 1,
);

has 'connect_opts' => (
Expand All @@ -90,16 +94,17 @@ has 'deploy_opts' => (

has 'connect_info_with_opts' => (
is => 'ro',
lazy_build => 1,
isa => HashRef,
lazy => 1,
builder => 1,
);

has 'fixture_class' => (
is => 'ro',
isa => FixtureClass,
required => 1,
coerce => 1,
builder => '_build_fixture_class',
builder => 1,
);
sub _build_fixture_class {
$ENV{fixture_class} || $ENV{FIXTURE_CLASS} || '::Populate'
Expand All @@ -108,7 +113,8 @@ sub _build_fixture_class {
has 'fixture_command' => (
is => 'ro',
init_arg => undef,
lazy_build => 1,
lazy => 1,
builder => 1,
);

has 'fixture_sets' => (
Expand Down

0 comments on commit e416d30

Please sign in to comment.