Skip to content

Commit dd6d4b4

Browse files
committed
Add namespace::autoclean, move make_immutable calls down to the bottom of the package
1 parent 4a5f7a3 commit dd6d4b4

24 files changed

+63
-43
lines changed

Makefile.PL

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ requires 'IO::Digest' => '0';
2323
requires 'Moose' => '0';
2424
requires 'MooseX::StrictConstructor' => '0';
2525
requires 'MooseX::Types::Path::Class' => '0';
26+
requires 'namespace::autoclean';
2627

2728
test_requires 'Test::More' => '0.88';
2829

lib/Git/PurePerl.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ use Git::PurePerl::Protocol;
3535
use IO::Digest;
3636
use IO::Socket::INET;
3737
use Path::Class;
38+
use namespace::autoclean;
39+
3840
our $VERSION = '0.45';
3941
$VERSION = eval $VERSION;
4042

lib/Git/PurePerl/Actor.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package Git::PurePerl::Actor;
22
use Moose;
33
use MooseX::StrictConstructor;
44
use Moose::Util::TypeConstraints;
5+
use namespace::autoclean;
56

67
has 'name' => ( is => 'ro', isa => 'Str', required => 1 );
78
has 'email' => ( is => 'ro', isa => 'Str', required => 1 );

lib/Git/PurePerl/Config.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package Git::PurePerl::Config;
22
use Moose;
33
use MooseX::StrictConstructor;
44
use Moose::Util::TypeConstraints;
5+
use namespace::autoclean;
56

67
extends 'Config::GitLike';
78

lib/Git/PurePerl/DirectoryEntry.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ package Git::PurePerl::DirectoryEntry;
22
use Moose;
33
use MooseX::StrictConstructor;
44
use Moose::Util::TypeConstraints;
5+
use namespace::autoclean;
56

67
has 'mode' => ( is => 'ro', isa => 'Str', required => 1 );
78
has 'filename' => ( is => 'ro', isa => 'Str', required => 1 );
89
has 'sha1' => ( is => 'ro', isa => 'Str', required => 1 );
910
has 'git' => ( is => 'ro', isa => 'Git::PurePerl', required => 1 );
1011

11-
__PACKAGE__->meta->make_immutable;
12-
1312
sub object {
1413
my $self = shift;
1514
return $self->git->get_object( $self->sha1 );
1615
}
1716

18-
1;
17+
__PACKAGE__->meta->make_immutable;
18+

lib/Git/PurePerl/Loose.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use MooseX::StrictConstructor;
44
use MooseX::Types::Path::Class;
55
use Compress::Zlib qw(compress uncompress);
66
use Path::Class;
7+
use namespace::autoclean;
78

89
has 'directory' => (
910
is => 'ro',
@@ -12,8 +13,6 @@ has 'directory' => (
1213
coerce => 1
1314
);
1415

15-
__PACKAGE__->meta->make_immutable;
16-
1716
sub get_object {
1817
my ( $self, $sha1 ) = @_;
1918

@@ -58,4 +57,5 @@ sub all_sha1s {
5857
);
5958
}
6059

61-
1;
60+
__PACKAGE__->meta->make_immutable;
61+

lib/Git/PurePerl/NewDirectoryEntry.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package Git::PurePerl::NewDirectoryEntry;
22
use Moose;
33
use MooseX::StrictConstructor;
44
use Moose::Util::TypeConstraints;
5+
use namespace::autoclean;
56

67
has 'mode' => ( is => 'ro', isa => 'Str', required => 1 );
78
has 'filename' => ( is => 'ro', isa => 'Str', required => 1 );

lib/Git/PurePerl/NewObject.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package Git::PurePerl::NewObject;
22
use Moose;
33
use MooseX::StrictConstructor;
44
use Moose::Util::TypeConstraints;
5+
use namespace::autoclean;
56

67
enum 'ObjectKind' => qw(commit tree blob tag);
78

@@ -10,8 +11,6 @@ has 'size' => ( is => 'ro', isa => 'Int', required => 0, lazy_build => 1 );
1011
has 'content' => ( is => 'rw', isa => 'Str', required => 0, lazy_build => 1 );
1112
has 'sha1' => ( is => 'ro', isa => 'Str', required => 0, lazy_build => 1 );
1213

13-
__PACKAGE__->meta->make_immutable;
14-
1514
sub _build_sha1 {
1615
my $self = shift;
1716
my $sha1 = Digest::SHA1->new;
@@ -30,4 +29,5 @@ sub raw {
3029
return $self->kind . ' ' . $self->size . "\0" . $self->content;
3130
}
3231

33-
1;
32+
__PACKAGE__->meta->make_immutable;
33+

lib/Git/PurePerl/NewObject/Blob.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package Git::PurePerl::NewObject::Blob;
22
use Moose;
33
use MooseX::StrictConstructor;
44
use Moose::Util::TypeConstraints;
5+
use namespace::autoclean;
6+
57
extends 'Git::PurePerl::NewObject';
68

79
has 'kind' =>

lib/Git/PurePerl/NewObject/Commit.pm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ use Moose;
33
use MooseX::StrictConstructor;
44
use Moose::Util::TypeConstraints;
55
use DateTime;
6+
use namespace::autoclean;
7+
68
extends 'Git::PurePerl::NewObject';
79

810
has 'kind' =>
@@ -16,8 +18,6 @@ has 'committer' =>
1618
has 'committed_time' => ( is => 'rw', isa => 'DateTime', required => 1 );
1719
has 'comment' => ( is => 'rw', isa => 'Str', required => 1 );
1820

19-
__PACKAGE__->meta->make_immutable;
20-
2121
sub _build_content {
2222
my $self = shift;
2323
my $content;
@@ -47,4 +47,5 @@ sub _build_content {
4747
$self->content($content);
4848
}
4949

50-
1;
50+
__PACKAGE__->meta->make_immutable;
51+

0 commit comments

Comments
 (0)