Permalink
Browse files

Switched to Any::Moose (as most stuff can be done - faster - using Mo…

…use)
  • Loading branch information...
1 parent 4e0e107 commit e7210f7eec7452d79c9f70b8afa2dcaffadbed76 @mfontani committed Dec 7, 2009
View
@@ -7,8 +7,7 @@ copyright_holder = Marco Fontani
[@Classic]
[Prereq]
-Moose = 0.87
-MooseX::StrictConstructor = 0
+Any::Moose = 0.10
LWP::ConnCache::MaxKeepAliveRequests = 0
LWP::UserAgent::Determined = 0
HTTP::Request = 0
@@ -17,4 +16,3 @@ YAML = 0
perl = 5.010_000
[PerlTidy]
-
@@ -1,8 +1,7 @@
package Net::RackSpace::CloudServers;
use warnings;
use strict;
-use Moose;
-use MooseX::StrictConstructor;
+use Any::Moose;
use Net::RackSpace::CloudServers::Flavor;
use Net::RackSpace::CloudServers::Server;
use Net::RackSpace::CloudServers::Image;
@@ -44,7 +43,7 @@ has 'storage_url' => (
has 'cdn_management_url' => ( is => 'rw', isa => 'Str', required => 0 );
has 'token' => ( is => 'rw', isa => 'Str', required => 0 );
-no Moose;
+no Any::Moose;
__PACKAGE__->meta->make_immutable();
# copied from Net::Mosso::CloudFiles
@@ -1,16 +1,15 @@
package Net::RackSpace::CloudServers::Flavor;
use warnings;
use strict;
-use Moose;
-use MooseX::StrictConstructor;
+use Any::Moose;
has 'cloudservers' => ( is => 'rw', isa => 'Net::RackSpace::CloudServers', required => 1 );
has 'id' => ( is => 'ro', isa => 'Int', required => 1 );
has 'name' => ( is => 'ro', isa => 'Str', required => 1 );
has 'ram' => ( is => 'ro', isa => 'Maybe[Int]', required => 1 );
has 'disk' => ( is => 'ro', isa => 'Maybe[Int]', required => 1 );
-no Moose;
+no Any::Moose;
__PACKAGE__->meta->make_immutable();
=head1 NAME
@@ -26,7 +25,7 @@ Net::RackSpace::CloudServers::Flavor - a RackSpace CloudServers Flavor
cloudservers => $cs,
id => '1', name => 'test', ram => 5, disk => 10,
);
- # get list:
+ # get list:
my @flavors = $cs->flavors;
foreach my $flavor ( @flavors ) {
print 'Have flavor ', $flavor->name, ' id ', $flavor->id, "\n";
@@ -49,7 +48,7 @@ The constructor creates a Flavor:
cloudserver => $cs
id => 'id', name => 'name',
);
-
+
This normally gets created for you by L<Net::RackSpace::Cloudserver>'s L<flavors> or L<flavorsdetails> methods.
Needs a Net::RackSpace::CloudServers::Flavor object.
@@ -1,8 +1,7 @@
package Net::RackSpace::CloudServers::Image;
use warnings;
use strict;
-use Moose;
-use MooseX::StrictConstructor;
+use Any::Moose;
has 'cloudservers' => ( is => 'rw', isa => 'Net::RackSpace::CloudServers', required => 1 );
has 'id' => ( is => 'ro', isa => 'Int', required => 1 );
@@ -13,7 +12,7 @@ has 'created' => ( is => 'ro', isa => 'Maybe[Str]', requi
has 'status' => ( is => 'ro', isa => 'Maybe[Str]', required => 1 );
has 'progress' => ( is => 'ro', isa => 'Maybe[Int]', required => 1 );
-no Moose;
+no Any::Moose;
__PACKAGE__->meta->make_immutable();
=head1 NAME
@@ -29,7 +28,7 @@ Net::RackSpace::CloudServers::Image - a RackSpace CloudServers Image
cloudservers => $cs,
id => '1', name => 'test',
);
- # get list:
+ # get list:
my @images = $cs->get_image();
foreach my $image ( @images ) {
print 'Have image ', $image->name, ' id ', $image->id, "\n";
@@ -53,7 +52,7 @@ The constructor creates an Image:
cloudserver => $cs
id => 'id', name => 'name',
);
-
+
This normally gets created for you by L<Net::RackSpace::Cloudserver>'s L<get_image> or L<get_image_details> methods.
Needs a Net::RackSpace::CloudServers object.
@@ -2,8 +2,7 @@ package Net::RackSpace::CloudServers::Limits;
use warnings;
use strict;
our $DEBUG = 0;
-use Moose;
-use MooseX::StrictConstructor;
+use Any::Moose;
use HTTP::Request;
use JSON;
use YAML;
@@ -14,7 +13,7 @@ has 'maxipgroups' => ( is => 'rw', isa => 'Int', );
has 'maxipgroupmembers' => ( is => 'rw', isa => 'Int', );
has 'rate' => ( is => 'rw', isa => 'Maybe[ArrayRef]', );
-no Moose;
+no Any::Moose;
__PACKAGE__->meta->make_immutable();
sub BUILD {
@@ -2,8 +2,7 @@ package Net::RackSpace::CloudServers::Server;
use warnings;
use strict;
our $DEBUG = 0;
-use Moose;
-use MooseX::StrictConstructor;
+use Any::Moose;
use HTTP::Request;
use JSON;
use YAML;
@@ -21,7 +20,7 @@ has 'public_address' => ( is => 'ro', isa => 'Maybe[ArrayRef[Str]]', re
has 'private_address' => ( is => 'ro', isa => 'Maybe[ArrayRef[Str]]', required => 1 );
has 'metadata' => ( is => 'ro', isa => 'Maybe[HashRef]', required => 1 );
-no Moose;
+no Any::Moose;
__PACKAGE__->meta->make_immutable();
sub change_root_password {
@@ -132,7 +131,7 @@ Net::RackSpace::CloudServers::Server - a RackSpace CloudServers Server instance
cloudservers => $cs,
id => '1', name => 'test',
);
- # get list:
+ # get list:
my @servers = $cs->get_server;
foreach my $server ( @servers ) {
print 'Have server ', $server->name, ' id ', $server->id, "\n";
@@ -164,7 +163,7 @@ The constructor creates a Server object, see L<create_server> to create a server
cloudserver => $cs
id => 'id', name => 'name',
);
-
+
This normally gets created for you by L<Net::RackSpace::Cloudserver>'s L<get_server> or L<get_server_detail> methods.
Needs a Net::RackSpace::CloudServers object as B<cloudserver> parameter.

0 comments on commit e7210f7

Please sign in to comment.