From: Rafael Kitover Date: Thu, 1 Oct 2009 22:10:04 +0000 (+0000) Subject: remove optional dep X-Git-Tag: v0.09004~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=15cf8e32c4349d963afc00af6a9600c1feadd4c8;p=p5sagit%2FClass-Accessor-Grouped.git remove optional dep --- diff --git a/Changes b/Changes index 95310cf..5d00ae7 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Class::Accessor::Grouped. +0.09001 Thu Oct 1 21:48:06 2009 + - remove optional dep from Makefile.PL + 0.09000 Sun Aug 23 20:08:09 2009 - release diff --git a/Makefile.PL b/Makefile.PL index c468d26..d0ec6cf 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -13,10 +13,7 @@ requires 'Scalar::Util'; requires 'MRO::Compat'; requires 'Class::Inspector'; requires 'Sub::Name' => '0.04'; - -feature 'XS Accessor Support', - -default => 0, - 'Class::XSAccessor' => 0; +requires 'Class::XSAccessor'; test_requires 'Sub::Identify'; diff --git a/README b/README deleted file mode 100644 index 2c22a31..0000000 --- a/README +++ /dev/null @@ -1,141 +0,0 @@ -NAME - Class::Accessor::Grouped - Lets you build groups of accessors - -SYNOPSIS -DESCRIPTION - This class lets you build groups of accessors that will call different - getters and setters. - -METHODS - mk_group_accessors - Arguments: $group, @fieldspec - Returns: none - - Creates a set of accessors in a given group. - - $group is the name of the accessor group for the generated accessors; - they will call get_$group($field) on get and set_$group($field, $value) - on set. - - If you want to mimic Class::Accessor's mk_accessors $group has to be - 'simple' to tell Class::Accessor::Grouped to use its own get_simple and - set_simple methods. - - @fieldspec is a list of field/accessor names; if a fieldspec is a scalar - this is used as both field and accessor name, if a listref it is - expected to be of the form [ $accessor, $field ]. - - mk_group_ro_accessors - Arguments: $group, @fieldspec - Returns: none - - Creates a set of read only accessors in a given group. Identical to - but accessors will throw an error if passed a - value rather than setting the value. - - mk_group_wo_accessors - Arguments: $group, @fieldspec - Returns: none - - Creates a set of write only accessors in a given group. Identical to - but accessors will throw an error if not passed - a value rather than getting the value. - - make_group_accessor - Arguments: $group, $field - Returns: $sub (\CODE) - - Returns a single accessor in a given group; called by mk_group_accessors - for each entry in @fieldspec. - - make_group_ro_accessor - Arguments: $group, $field - Returns: $sub (\CODE) - - Returns a single read-only accessor in a given group; called by - mk_group_ro_accessors for each entry in @fieldspec. - - make_group_wo_accessor - Arguments: $group, $field - Returns: $sub (\CODE) - - Returns a single write-only accessor in a given group; called by - mk_group_wo_accessors for each entry in @fieldspec. - - get_simple - Arguments: $field - Returns: $value - - Simple getter for hash-based objects which returns the value for the - field name passed as an argument. - - set_simple - Arguments: $field, $new_value - Returns: $new_value - - Simple setter for hash-based objects which sets and then returns the - value for the field name passed as an argument. - - get_inherited - Arguments: $field - Returns: $value - - Simple getter for Classes and hash-based objects which returns the value - for the field name passed as an argument. This behaves much like - Class::Data::Accessor where the field can be set in a base class, - inherited and changed in subclasses, and inherited and changed for - object instances. - - set_inherited - Arguments: $field, $new_value - Returns: $new_value - - Simple setter for Classes and hash-based objects which sets and then - returns the value for the field name passed as an argument. When called - on a hash-based object it will set the appropriate hash key value. When - called on a class, it will set a class level variable. - - Note:: This method will die if you try to set an object variable on a - non hash-based object. - - get_component_class - Arguments: $field - Returns: $value - - Gets the value of the specified component class. - - __PACKAGE__->mk_group_accessors('component_class' => 'result_class'); - - $self->result_class->method(); - - ## same as - $self->get_component_class('result_class')->method(); - - set_component_class - Arguments: $field, $class - Returns: $new_value - - Inherited accessor that automatically loads the specified class before - setting it. This method will die if the specified class could not be - loaded. - - __PACKAGE__->mk_group_accessors('component_class' => 'result_class'); - __PACKAGE__->result_class('MyClass'); - - $self->result_class->method(); - - get_super_paths - Returns a list of 'parent' or 'super' class names that the current class - inherited from. - -AUTHORS - Matt S. Trout Christopher H. Laco - - - With contributions from: - - Guillermo Roditi - -LICENSE - You may distribute this code under the same terms as Perl itself. - diff --git a/lib/Class/Accessor/Grouped.pm b/lib/Class/Accessor/Grouped.pm index 0c4b502..33865b6 100644 --- a/lib/Class/Accessor/Grouped.pm +++ b/lib/Class/Accessor/Grouped.pm @@ -7,23 +7,8 @@ use Scalar::Util (); use MRO::Compat; use Sub::Name (); -our $VERSION = '0.09000'; - -BEGIN { - our $hasXS; - - sub _hasXS { - return $hasXS if defined $hasXS; - - $hasXS = 0; - eval { - require Class::XSAccessor; - $hasXS = 1; - }; - - return $hasXS; - } -} +our $VERSION = '0.09001'; +$VERSION = eval $VERSION; =head1 NAME @@ -453,6 +438,24 @@ sub get_super_paths { return @{mro::get_linear_isa($class)}; }; +# This is now a hard, rather than optional dep. Since we dep on Sub::Name, we no +# longer care about not using XS modules. +{ + our $hasXS; + + sub _hasXS { + return $hasXS if defined $hasXS; + + $hasXS = 0; + eval { + require Class::XSAccessor; + $hasXS = 1; + }; + + return $hasXS; + } +} + 1; =head1 AUTHORS