From: gfx Date: Tue, 18 Aug 2009 04:41:26 +0000 (+0900) Subject: require_xs("Class::MOP") with Module::Install::XSUtil X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=47c136e29352e3ceb33c9111e3b0725a29095b8c;p=gitmo%2FMoose.git require_xs("Class::MOP") with Module::Install::XSUtil --- diff --git a/Makefile.PL b/Makefile.PL index cd3cb28..a04f31b 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -10,9 +10,12 @@ perl_version '5.008001'; all_from 'lib/Moose.pm'; license 'perl'; +use_ppport 3.19; + +requires_xs 'Class::MOP' => '0.92'; # for mop.h + requires 'Scalar::Util' => '1.19'; requires 'Carp'; -requires 'Class::MOP' => '0.92'; requires 'List::MoreUtils' => '0.12'; requires 'Sub::Exporter' => '0.980'; requires 'Task::Weaken' => '0'; diff --git a/author/extract-inline-tests b/author/extract-inline-tests old mode 100755 new mode 100644 diff --git a/benchmarks/method_modifiers.pl b/benchmarks/method_modifiers.pl old mode 100755 new mode 100644 diff --git a/lib/Moose.pm b/lib/Moose.pm index f049fb0..1b0e66b 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -4,16 +4,22 @@ use warnings; use 5.008; -our $VERSION = '0.89'; -$VERSION = eval $VERSION; -our $AUTHORITY = 'cpan:STEVAN'; +use Class::MOP 0.92; + +BEGIN{ + our $VERSION = '0.89'; + $VERSION = eval $VERSION; + our $AUTHORITY = 'cpan:STEVAN'; + + require XSLoader; + XSLoader::load(__PACKAGE__, $VERSION); +} use Scalar::Util 'blessed'; use Carp 'confess'; use Moose::Exporter; -use Class::MOP 0.92; use Moose::Meta::Class; use Moose::Meta::TypeConstraint; diff --git a/lib/Moose/Meta/Method/Accessor.pm b/lib/Moose/Meta/Method/Accessor.pm index 483cfad..dbcab77 100644 --- a/lib/Moose/Meta/Method/Accessor.pm +++ b/lib/Moose/Meta/Method/Accessor.pm @@ -116,11 +116,11 @@ sub _value_needs_copy { return $attr->should_coerce; } -sub _generate_reader_method { shift->_generate_reader_method_inline(@_) } -sub _generate_writer_method { shift->_generate_writer_method_inline(@_) } -sub _generate_accessor_method { shift->_generate_accessor_method_inline(@_) } -sub _generate_predicate_method { shift->_generate_predicate_method_inline(@_) } -sub _generate_clearer_method { shift->_generate_clearer_method_inline(@_) } +#sub _generate_reader_method { shift->_generate_reader_method_inline(@_) } +#sub _generate_writer_method { shift->_generate_writer_method_inline(@_) } +#sub _generate_accessor_method { shift->_generate_accessor_method_inline(@_) } +#sub _generate_predicate_method { shift->_generate_predicate_method_inline(@_) } +#sub _generate_clearer_method { shift->_generate_clearer_method_inline(@_) } sub _inline_pre_body { '' } sub _inline_post_body { '' } diff --git a/t/010_basics/022_moose_exporter_groups.t b/t/010_basics/022_moose_exporter_groups.t old mode 100755 new mode 100644 diff --git a/t/020_attributes/004_attribute_triggers.t b/t/020_attributes/004_attribute_triggers.t index baa2a2a..459c656 100644 --- a/t/020_attributes/004_attribute_triggers.t +++ b/t/020_attributes/004_attribute_triggers.t @@ -205,7 +205,8 @@ use Test::Exception; \@Foo::calls, [ [ $foo, 3, 2 ] ], 'trigger called correctly on set (with old value)', - ); + ) + or do{ require Data::Dumper; diag(Data::Dumper::Dumper(\@Foo::calls)) }; @Foo::calls = (); Foo->meta->make_immutable, redo if Foo->meta->is_mutable; } diff --git a/t/020_attributes/021_method_generation_rules.t b/t/020_attributes/021_method_generation_rules.t index d634e57..0bf2a68 100644 --- a/t/020_attributes/021_method_generation_rules.t +++ b/t/020_attributes/021_method_generation_rules.t @@ -37,7 +37,7 @@ can_ok($obj, qw/foo _foo/); lives_ok {$obj->_foo(1)} "$class->_foo is writer"; is($obj->foo(), 1, "$class->foo is reader"); dies_ok {$obj->foo(2)} "$class->foo is not writer"; # this should fail -ok(!defined $obj->_foo(), "$class->_foo is not reader"); +dies_ok {$obj->_foo()} "$class->_foo is not reader"; $class = make_class('ro', 'writer', 'Test::Class::WriterRO'); ok($class, "Can define attr with ro + writer"); @@ -48,7 +48,7 @@ can_ok($obj, qw/foo _foo/); lives_ok {$obj->_foo(1)} "$class->_foo is writer"; is($obj->foo(), 1, "$class->foo is reader"); dies_ok {$obj->foo(1)} "$class->foo is not writer"; -isnt($obj->_foo(), 1, "$class->_foo is not reader"); +dies_ok {$obj->_foo()} "$class->_foo is not reader"; $class = make_class('rw', 'accessor', 'Test::Class::AccessorRW'); ok($class, "Can define attr with rw + accessor");