Skip to content

Commit

Permalink
Switch from Moose to Any::Moose so we can use a much lighter-weight M…
Browse files Browse the repository at this point in the history
…ouse implementation
  • Loading branch information
obra committed Jun 12, 2009
1 parent 0c2311b commit acd132a
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 55 deletions.
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license 'perl';
repository 'http://github.com/fayland/perl-net-github/tree/master';

requires 'URI::Escape';
requires 'Moose' => '0.57';
requires 'Any::Moose';
requires 'Crypt::SSLeay';
requires 'WWW::Mechanize::GZip';
requires 'JSON::Any';
Expand Down
15 changes: 6 additions & 9 deletions lib/Net/GitHub.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub;

use Moose;
use Any::Moose;

our $VERSION = '0.17';
our $AUTHORITY = 'cpan:FAYLAND';
Expand All @@ -12,19 +12,16 @@ sub new {
my $obj;
if ( exists $params->{version} and $params->{version} == 1 ) {
require Net::GitHub::V1;
$obj = Net::GitHub::V1->new($params);
return Net::GitHub::V1->new($params);
} else {
require Net::GitHub::V2;
$obj = Net::GitHub::V2->new($params);
return Net::GitHub::V2->new($params);
}

return $class->meta->new_object(
__INSTANCE__ => $obj,
@_,
);
#return $class->meta->new_object( __INSTANCE__ => $obj, @_,);
}

no Moose;
no Any::Moose;
__PACKAGE__->meta->make_immutable(inline_constructor => 0);

1;
Expand Down Expand Up @@ -96,7 +93,7 @@ L<http://github.com/fayland/perl-net-github/tree/master>
=head1 SEE ALSO
L<Moose>
L<Any::Moose>
=head1 AUTHOR
Expand Down
6 changes: 3 additions & 3 deletions lib/Net/GitHub/V1.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V1;

use Moose;
use Any::Moose;

our $VERSION = '0.06';
our $AUTHORITY = 'cpan:FAYLAND';
Expand Down Expand Up @@ -31,7 +31,7 @@ has '_search' => (
handles => ['search'],
);

no Moose;
no Any::Moose;
__PACKAGE__->meta->make_immutable;

1;
Expand Down Expand Up @@ -102,7 +102,7 @@ L<http://github.com/fayland/perl-net-github/tree/master>
=head1 SEE ALSO
L<Moose>
L<Any::Moose>
=head1 AUTHOR
Expand Down
4 changes: 2 additions & 2 deletions lib/Net/GitHub/V1/Project.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V1::Project;

use Moose;
use Any::Moose;

our $VERSION = '0.06';
our $AUTHORITY = 'cpan:FAYLAND';
Expand Down Expand Up @@ -67,7 +67,7 @@ sub BUILDARGS {
}
}

no Moose;
no Any::Moose;
__PACKAGE__->meta->make_immutable;

1;
Expand Down
4 changes: 2 additions & 2 deletions lib/Net/GitHub/V1/Project/Downloads.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V1::Project::Downloads;

use Moose;
use Any::Moose;

our $VERSION = '0.06';
our $AUTHORITY = 'cpan:FAYLAND';
Expand Down Expand Up @@ -52,7 +52,7 @@ sub _build_downloads {
return \@downloads;
}

no Moose;
no Any::Moose;
__PACKAGE__->meta->make_immutable;

1;
Expand Down
4 changes: 2 additions & 2 deletions lib/Net/GitHub/V1/Project/Info.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V1::Project::Info;

use Moose;
use Any::Moose;

our $VERSION = '0.06';
our $AUTHORITY = 'cpan:FAYLAND';
Expand Down Expand Up @@ -83,7 +83,7 @@ has 'watcher_num' => (
},
);

no Moose;
no Any::Moose;
__PACKAGE__->meta->make_immutable;

1;
Expand Down
6 changes: 3 additions & 3 deletions lib/Net/GitHub/V1/Project/Role.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V1::Project::Role;

use Moose::Role;
use Any::Moose 'Role';

our $VERSION = '0.06';
our $AUTHORITY = 'cpan:FAYLAND';
Expand Down Expand Up @@ -38,7 +38,7 @@ sub args_to_pass {
return $ret;
}

no Moose::Role;
no Any::Moose;

1;
__END__
Expand All @@ -51,7 +51,7 @@ Net::GitHub::V1::Project::Role - Common between Net::GitHub::V1::Project::* libs
package Net::GitHub::V1::Project::XXX;
use Moose;
use Any::Moose;
with 'Net::GitHub::V1::Project::Role';
=head1 DESCRIPTION
Expand Down
4 changes: 2 additions & 2 deletions lib/Net/GitHub/V1/Project/Source.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V1::Project::Source;

use Moose;
use Any::Moose;

our $VERSION = '0.06';
our $AUTHORITY = 'cpan:FAYLAND';
Expand Down Expand Up @@ -28,7 +28,7 @@ sub commit {
return $commits->{"commit"};
}

no Moose;
no Any::Moose;
__PACKAGE__->meta->make_immutable;

1;
Expand Down
4 changes: 2 additions & 2 deletions lib/Net/GitHub/V1/Project/Wiki.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V1::Project::Wiki;

use Moose;
use Any::Moose;

our $VERSION = '0.06';
our $AUTHORITY = 'cpan:FAYLAND';
Expand Down Expand Up @@ -69,7 +69,7 @@ sub edit_or_new {
}
}

no Moose;
no Any::Moose;
__PACKAGE__->meta->make_immutable;

1;
Expand Down
6 changes: 3 additions & 3 deletions lib/Net/GitHub/V1/Role.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V1::Role;

use Moose::Role;
use Any::Moose 'Role';

our $VERSION = '0.06';
our $AUTHORITY = 'cpan:FAYLAND';
Expand Down Expand Up @@ -91,7 +91,7 @@ sub signin {
}
}

no Moose::Role;
no Any::Moose;

1;
__END__
Expand All @@ -104,7 +104,7 @@ Net::GitHub::V1::Role - Common between Net::GitHub::V1::* libs
package Net::GitHub::V1::XXX;
use Moose;
use Any::Moose;
with 'Net::GitHub::V1::Role';
=head1 DESCRIPTION
Expand Down
4 changes: 2 additions & 2 deletions lib/Net/GitHub/V1/Search.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V1::Search;

use Moose;
use Any::Moose;

our $VERSION = '0.06';
our $AUTHORITY = 'cpan:FAYLAND';
Expand All @@ -18,7 +18,7 @@ sub search {
return $data;
}

no Moose;
no Any::Moose;
__PACKAGE__->meta->make_immutable;

1;
Expand Down
6 changes: 3 additions & 3 deletions lib/Net/GitHub/V1/User.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V1::User;

use Moose;
use Any::Moose;

our $VERSION = '0.06';
our $AUTHORITY = 'cpan:FAYLAND';
Expand Down Expand Up @@ -35,7 +35,7 @@ sub BUILDARGS {
package # hide from PAUSE
Net::GitHub::V1::UserObj;

use Moose;
use Any::Moose;

has 'name' => ( is => 'rw' );
has 'repositories' => (
Expand All @@ -46,7 +46,7 @@ has 'email' => ( is => 'rw' );
has 'location' => ( is => 'rw' );
has 'company' => ( is => 'rw' );

no Moose;
no Any::Moose;
__PACKAGE__->meta->make_immutable;

1;
Expand Down
6 changes: 3 additions & 3 deletions lib/Net/GitHub/V2.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V2;

use Moose;
use Any::Moose;

our $VERSION = '0.08';
our $AUTHORITY = 'cpan:FAYLAND';
Expand Down Expand Up @@ -80,7 +80,7 @@ has 'network' => (
handles => ['network_meta', 'network_data_chunk']
);

no Moose;
no Any::Moose;
__PACKAGE__->meta->make_immutable;

1;
Expand Down Expand Up @@ -168,7 +168,7 @@ L<Net::GitHub::Network>
=head1 SEE ALSO
L<Moose>
L<Any::Moose>
=head1 AUTHOR
Expand Down
4 changes: 2 additions & 2 deletions lib/Net/GitHub/V2/Commits.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V2::Commits;

use Moose;
use Any::Moose;

our $VERSION = '0.13';
our $AUTHORITY = 'cpan:FAYLAND';
Expand Down Expand Up @@ -42,7 +42,7 @@ sub show {
return $self->get_json_to_obj( "commits/show/$owner/$repo/$sha1", 'commit' );
}

no Moose;
no Any::Moose;
__PACKAGE__->meta->make_immutable;

1;
Expand Down
6 changes: 3 additions & 3 deletions lib/Net/GitHub/V2/HasRepo.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V2::HasRepo;

use Moose::Role;
use Any::Moose 'Role';

our $VERSION = '0.13';
our $AUTHORITY = 'cpan:FAYLAND';
Expand All @@ -19,7 +19,7 @@ sub args_to_pass {
return $ret;
}

no Moose::Role;
no Any::Moose;

1;
__END__
Expand All @@ -32,7 +32,7 @@ Net::GitHub::V2::HasRepo - Role for Net::GitHub::V2 for classes that use repos
package Net::GitHub::V2::XXX;
use Moose;
use Any::Moose;
with 'Net::GitHub::V2::HasRepo';
=head1 DESCRIPTION
Expand Down
4 changes: 2 additions & 2 deletions lib/Net/GitHub/V2/Issues.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V2::Issues;

use Moose;
use Any::Moose;

our $VERSION = '0.17';
our $AUTHORITY = 'cpan:FAYLAND';
Expand Down Expand Up @@ -154,7 +154,7 @@ sub comments {
}
}

no Moose;
no Any::Moose;
__PACKAGE__->meta->make_immutable;

1;
Expand Down
4 changes: 2 additions & 2 deletions lib/Net/GitHub/V2/Network.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V2::Network;

use Moose;
use Any::Moose;

our $VERSION = '0.07';
our $AUTHORITY = 'cpan:FAYLAND';
Expand Down Expand Up @@ -33,7 +33,7 @@ sub network_data_chunk {
return $self->json->jsonToObj($json);
}

no Moose;
no Any::Moose;
__PACKAGE__->meta->make_immutable;

1;
Expand Down
6 changes: 3 additions & 3 deletions lib/Net/GitHub/V2/NoRepo.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Net::GitHub::V2::NoRepo;

use Moose::Role;
use Any::Moose 'Role';

our $VERSION = '0.17';
our $AUTHORITY = 'cpan:FAYLAND';
Expand Down Expand Up @@ -110,7 +110,7 @@ sub args_to_pass {
return $ret;
}

no Moose::Role;
no Any::Moose;

1;
__END__
Expand All @@ -123,7 +123,7 @@ Net::GitHub::V2::NoRepo - Base role for Net::GitHub::V2, no repo access
package Net::GitHub::V2::XXX;
use Moose;
use Any::Moose;
with 'Net::GitHub::V2::NoRepo';
=head1 DESCRIPTION
Expand Down
Loading

0 comments on commit acd132a

Please sign in to comment.