diff --git a/Makefile.PL b/Makefile.PL index d4601a1..dab85dc 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -11,9 +11,8 @@ requires 'Net::OAuth'; requires 'LWP::UserAgent'; requires 'URI'; requires 'Lingua::EN::Inflect::Number'; -requires 'namespace::autoclean'; requires_any_moose( - prefer => 'Moose', + prefer => 'Mouse', moose => '0.56', mouse => '0.51', ); diff --git a/lib/Net/Google/DataAPI.pm b/lib/Net/Google/DataAPI.pm index 5760a34..2bc2cda 100644 --- a/lib/Net/Google/DataAPI.pm +++ b/lib/Net/Google/DataAPI.pm @@ -191,6 +191,10 @@ sub entry_has { } } +__PACKAGE__->meta->make_immutable; +no Any::Moose; +no Any::Moose '::Exporter'; + 1; __END__ diff --git a/lib/Net/Google/DataAPI/Auth/AuthSub.pm b/lib/Net/Google/DataAPI/Auth/AuthSub.pm index 4fc00ec..51bec8c 100644 --- a/lib/Net/Google/DataAPI/Auth/AuthSub.pm +++ b/lib/Net/Google/DataAPI/Auth/AuthSub.pm @@ -18,4 +18,8 @@ sub sign_request { return $req; } +__PACKAGE__->meta->make_immutable; + +no Any::Moose; + 1; diff --git a/lib/Net/Google/DataAPI/Auth/ClientLogin/Multiple.pm b/lib/Net/Google/DataAPI/Auth/ClientLogin/Multiple.pm index 2b74069..f9d2b2b 100644 --- a/lib/Net/Google/DataAPI/Auth/ClientLogin/Multiple.pm +++ b/lib/Net/Google/DataAPI/Auth/ClientLogin/Multiple.pm @@ -38,6 +38,10 @@ sub _get_auth_params { return [ $authsub->auth_params ]; } +__PACKAGE__->meta->make_immutable; + +no Any::Moose; + 1; __END__ diff --git a/lib/Net/Google/DataAPI/Auth/Null.pm b/lib/Net/Google/DataAPI/Auth/Null.pm index f9bb160..c072a15 100644 --- a/lib/Net/Google/DataAPI/Auth/Null.pm +++ b/lib/Net/Google/DataAPI/Auth/Null.pm @@ -4,4 +4,7 @@ with 'Net::Google::DataAPI::Role::Auth'; sub sign_request {$_[1]}; +__PACKAGE__->meta->make_immutable; +no Any::Moose; + 1; diff --git a/lib/Net/Google/DataAPI/Auth/OAuth.pm b/lib/Net/Google/DataAPI/Auth/OAuth.pm index d7d0147..7176755 100644 --- a/lib/Net/Google/DataAPI/Auth/OAuth.pm +++ b/lib/Net/Google/DataAPI/Auth/OAuth.pm @@ -145,6 +145,9 @@ sub sign_request { return $req; } +__PACKAGE__->meta->make_immutable; +no Any::Moose; + 1; __END__ diff --git a/lib/Net/Google/DataAPI/Role/Auth.pm b/lib/Net/Google/DataAPI/Role/Auth.pm index 8c484b4..a707b6c 100644 --- a/lib/Net/Google/DataAPI/Role/Auth.pm +++ b/lib/Net/Google/DataAPI/Role/Auth.pm @@ -1,7 +1,6 @@ package Net::Google::DataAPI::Role::Auth; use Any::Moose '::Role'; -use namespace::autoclean; - requires 'sign_request'; +no Any::Moose '::Role'; 1; diff --git a/lib/Net/Google/DataAPI/Role/Entry.pm b/lib/Net/Google/DataAPI/Role/Entry.pm index fc6cfe2..7ed2634 100644 --- a/lib/Net/Google/DataAPI/Role/Entry.pm +++ b/lib/Net/Google/DataAPI/Role/Entry.pm @@ -1,6 +1,5 @@ package Net::Google::DataAPI::Role::Entry; use Any::Moose '::Role'; -use namespace::autoclean; use Carp; use XML::Atom; use XML::Atom::Entry; @@ -133,6 +132,8 @@ sub delete { return $res->is_success; } +no Any::Moose '::Role'; + 1; __END__ diff --git a/lib/Net/Google/DataAPI/Role/HasContent.pm b/lib/Net/Google/DataAPI/Role/HasContent.pm index e9a6023..185b595 100644 --- a/lib/Net/Google/DataAPI/Role/HasContent.pm +++ b/lib/Net/Google/DataAPI/Role/HasContent.pm @@ -1,6 +1,5 @@ package Net::Google::DataAPI::Role::HasContent; use Any::Moose '::Role'; -use namespace::autoclean; our $VERSION='0.02'; requires 'update'; @@ -29,6 +28,8 @@ sub param { } } +no Any::Moose '::Role'; + 1; __END__ diff --git a/lib/Net/Google/DataAPI/Role/Service.pm b/lib/Net/Google/DataAPI/Role/Service.pm index be9166f..ec6c570 100644 --- a/lib/Net/Google/DataAPI/Role/Service.pm +++ b/lib/Net/Google/DataAPI/Role/Service.pm @@ -1,6 +1,5 @@ package Net::Google::DataAPI::Role::Service; use Any::Moose '::Role'; -use namespace::autoclean; use Carp; use LWP::UserAgent; use URI; @@ -213,6 +212,8 @@ sub delete { return $res; } +no Any::Moose '::Role'; + 1; __END__ diff --git a/lib/Net/Google/DataAPI/Types.pm b/lib/Net/Google/DataAPI/Types.pm index 3d7c38d..98e78df 100644 --- a/lib/Net/Google/DataAPI/Types.pm +++ b/lib/Net/Google/DataAPI/Types.pm @@ -26,4 +26,9 @@ coerce 'Net::Google::DataAPI::Types::URI' => from 'Str' => via { URI->new(( m{://} ) ? $_ : ('http://'.$_)) }; +__PACKAGE__->meta->make_immutable; + +no Any::Moose; +no Any::Moose '::Util::TypeConstraints'; + 1; diff --git a/t/01_role/01_service/03_request.t b/t/01_role/01_service/03_request.t index d96ab0c..4d1945e 100644 --- a/t/01_role/01_service/03_request.t +++ b/t/01_role/01_service/03_request.t @@ -1,10 +1,9 @@ use strict; use warnings; -use lib 't/lib'; -use t::Util; use Test::More; use Test::MockModule; use Test::Exception; +use Test::MockObject; use HTTP::Response; { diff --git a/t/01_role/01_service/04_methods.t b/t/01_role/01_service/04_methods.t index 24712ac..f4fae3a 100644 --- a/t/01_role/01_service/04_methods.t +++ b/t/01_role/01_service/04_methods.t @@ -1,7 +1,5 @@ use strict; use warnings; -use lib 't/lib'; -use t::Util; use Test::More; use Test::MockModule; use HTTP::Response; @@ -22,7 +20,6 @@ use HTTP::Response; default => 'http://example.com/myfeed', ); } - my $ua = Test::MockModule->new('LWP::UserAgent'); my $ok_res = HTTP::Response->parse(< ( diff --git a/t/Util.pm b/t/Util.pm deleted file mode 100644 index 557c41b..0000000 --- a/t/Util.pm +++ /dev/null @@ -1,21 +0,0 @@ -package t::Util; -use strict; -use warnings; -use Net::Google::AuthSub; -use Test::MockObject; - -sub import { - my ($class, %args) = @_; - my $caller = caller; - - my $res = Test::MockObject->new; - $res->mock(is_success => sub {1}); - $res->mock(auth => sub {'foobar'}); - { - no warnings 'redefine'; - - *Net::Google::AuthSub::login = sub { $res }; - } -} - -1;