Revision history for Perl extension Class::Meta.
- Fixed broken rt.cpan.org email address.
- Added missing call to `build()` in the synopsis. Thanks to Laurnet
Dami for the report (RT #72058).
- Fixed a couple of typos in the Pod, with thanks to Gregor Herrmann and
the Debian project (RT #78163).
- Require Test::Pod 1.41 to run the Pod tests.
- Removed redundant bug reporting email address from the documentation.
- Fixed tests failures on Windows (hopefully). Thanks to Eric Brine for
the suggested fix.
- Moved repostitory to [GitHub](https://github.com/theory/class-meta/).
- Switched to a "traditional" `Makefile.PL`.
- Fixed POD formatting typo in Class::Meta::Type with thanks to Gregor
Herrmann (RT #36143).
- Fixed a warning from Perl 5.11 (I think).
- Removed the spelling test from the distribution, since it can
fail on systems without a spell program or using a different locale.
Reported by Andreas Koenig.
- Fixed test failures on Perl 5.6. Reported by Slaven Rezic and many
others via cpan-testers.
- Required constraints are now enforced by the constructor, as well as
the individual attributes themselves. Frankly, it was a bug that this
isn't the way it worked before, although at the time I thought it was
a feature. This is a backwards compatibility change, but see the next
point. Reported by Jon Swartz.
- Added support for an optional subroutine reference to be passed as the
final argument to constructors created by Class::Meta. The object
being constructed will be passed to the anonymous sub after all of the
specified and default values have been set, but before required
constraints are enforced. This allows developers to have a scope
within which to work before required attributes throw an exception.
Yes, I did borrow this idea from Ruby.
- Added a link to the Subversion repository.
- Moved the "Justification" section of the documentation nearer to the
bottom. Suggested by Jon Swartz.
- The "view" parameter (PUBLIC, PRIVATE, PROTECTED, TRUSTED) is now
enforced for methods when the method body is passed via the "code"
parameter. Reported by Jon Swartz.
- Added the `trusted` method to Class::Meta::Class.
- You can now use strings to specify constant values when declaring
class attributes, methods, etc. The strings correspond to their
equivalent constant names, such as "PUBLIC", "PRIVATE", "GET", "SET",
"OBJECT", "CLASS", and so on. The corresponding constant value will,
however, be stored in the resulting Class::Meta object.
- A more useful exception is now thrown when an attribute is added with
a missing or unknown type.
- Added the `default_type` parameter to `new()`, and the corresponding
attribute to Class::Meta::Class. This value will be used for the data
type of attributes created without a data type. Borrowed from
- Many of the parameters to `Class::Meta->new` are now passed on to
suclasses if they are not explicitly specified by those subclasses.
This makes it easier to get the same settings (e.g., for Class::Meta
subclasses or for the default type) without typing the same things
over and over in subclasses.
- Added a spelling test. This has the benefit of reducing the number of
annoying spelling errors in the documentation.
- Added the "configure_requires", and "recommends" parameters to
- Updated the copyright.
- Documented the 'name' parameter to new().
- The 'name' attribute of classes now defaults to the key name with
underscores replaced with spaces and each word capitalized by the
ucfirst operator. So "foo" will become "Foo" and "contact_type" will
become "Contact Type".
- Added an example and brief discussion of Class::Meta::Express to the
docs. Suggested by Jonathan Swartz.
- Added 'code' parameter to "new_constructor()" to install a constructor
written by the user. This essentially works just like the 'code'
- Fixed tests that fail with Data::Types 0.06 and later.
- Added 'is' parameter to the attribute constructor as an alias for
'type'. If both 'type and 'is' are passed to the attribute
constructor, 'is' will be used.
- Added the boolean method is() to the attribute class to compare a
- Documented the 'create' parameter to "new_constructor()".
- Data types in defined in the Class::Meta::Types namespace are now
automatically loaded if they are used in an attribute and not
- The constructor method created by Class::Meta::Constructor no longer
assigns the default value to an attribute if that attribute has
already been set by another attribute accessor. This is useful, for
example, when the setting of one attribute triggers the setting of
another attribute, as when a public attribute implicitly sets a
- Added "code" parameter to add_method(), so that a new method can be
defined right in the call to add_method(), and Class::Meta::Method
will install it. Inspired by Ovid's Class::Meta::Declare.
- Constructors created by Class::Meta now iterate over the attributes
when assigning arguments or defaults in the order in which the
were defined, rather than randomly.
- The "attributes()", "constructors()", and "methods()" methods of
Class::Meta::Class now return *all* objects, including private and
trusted objects, when called from the class that defined those
- Minor optimizations to the constructor created by Class::Meta.
- Added "keys" method to allow all Class Object keys to be fetched.
- Added "args" and "returns" parameters to "add_method()" to allow
methods to be better described.
- Added "clear" method to delete Class Object keys.
- Fixed accessor generation for "once" attributes with a default so that
a value can be passed to a constructor and properly assigned to the
"once" attribute instead of its default, rather than throwing a
- Added "default_builder()" class method to Class::Meta::Type. This
allows a default builder other than "default" to be specified when
none is explicitly passed to Class::Meta::Type->add(), such as when
data types are implicitly created for attributes that reference
objects of Class::Meta classes.
- Changed the "constructors()", "attributes()", and "methods()" methods
in Class::Meta::Class so that any classes thta inherit from
Class::Meta::Class are never considered to be the caller.
- Added the "trusted" parameter to "new()" to identify trusted packages.
Added a new constant, TRUSTED, for the "view" parameter to identfy
constructors, attributes, and methods that can be used by trusted
- Fixed documentation to reflect that the "class()" method in the
Constructor class requires the package name as its first argument.
- Modified "add_method()" so that methods can optionally be
automatically created by "build()". Patch from Tim Canfield.
- A call to "build()" now deletes unneeded references to objects,
freeing up a bit of memory.
- Changed minimum required Perl version to 5.6.1. Certain tests are
disabled in this version, since the version of Carp included in
Perl 5.6 lacks the @CARP_NOT feature. Everything should work fine,
however. Suggested by Tim Canfield.
- Added "parents()" method to Class::Meta::Class to return the class
objects for any classes that the class inherits from.
- Attributes that use an alias to set their types will now have the
alias converted to the canonical type key.
- Fixed typo in Class::Meta that named the generated method "class()"
instead of "my_class()". Reported by Curtis Poe.
- Documented "bool" synonym for the "boolean" data type in the
Class::Meta library documentation (it was already documented in
Class::Meta::Types::Boolean, of course).
- Fixed broken links to Class::Meta::Types classes in Class::Meta
library documentation. Reported by Curtis Poe.
- Classes created by Class::Meta will now be used as data types. This
saves the developer having to generate classes *and* add the new
classes as data types when objects of a class will be attributes of
- Added "class_validation_generator()" class method to Class::Meta::Type
so that a custom object validation generator can be specified instead
of the default. This simplifies specifying objects as data types
without custom creating validation checks for every one, and is
especially useful with the new implicit Class::Meta class data types,
as it will be used to generate the validation checks.
- Accessor builder classes that don't properly load will now correctly
cause Class::Meta to die.
- Class::Meta::Class->handle_error() now joins multiple arguments it
receives into a single string to be passed to the error handler
- Class::Meta::Attribute now correctly finds attribute accessors that
were not created by Class::Meta (that is, when the "create" parameter
is set to NONE), provided that the build_attr_set() and
build_attr_get() functions of the accessor builder package can
find them (as the accessor builders include with Class::Meta can).
- Fixed test failures on Windows in "t/errors.t".
- Added "abstract" attribute to class objects to identify abstract
(a.k.a. "virtual") classes. Constructors generated by Class::Meta
will throw an exception if they are used to try to construct an
object in an abstract class.
- Added "for_key()" class method to Class::Meta to return a
Class::Meta::Class class for a class key.
- Eliminated '"my" variable $objs masks earlier declaration in same
- Remembered to actually apply the patch taht fixes the tests under
- Subclasses of Class, Constructor, Attribute, and Method can now call
"SUPER::new()" and "SUPER::build()" without getting errors.
- Changed implementation of Class::Meta::Class so that its attributes
are stored in the object hash itself. This brings it in line with
the implementation of Constructor, Attribute, and Method, thus
making subclassing consistent with those classes. However it also
required that references to its contents be changed in all the other
classes, as well. Hence the bump to 0.40.
- Finally, truly got the tests fixed for Windows. Without question.
The fix was even tested, first! Thanks to Robert Rothenberg for
- Minor doc fixes, repoted by Jesse Vincent.
- Added simple example for a default value code reference. Suggested
by Jesse Vincent.
- Fixed the names of the included types classes in the documentation
of Class::Meta::Type. Spotted by Dan Kubb.
- Fixed a few documentation references to a "class()" method to
reference the correctly named "my_class()" method.
- Fixed failing tests on Win32. For real this time, I hope! Reported
by Robert Rothenberg's CPAN testing.
- Added build() method to Class::Meta::Method to parallel the same
method in Class::Meta::Attribute and Class::Meta::Constructor.
It's a no-op, but will be called when Class::Meta::build() is
called, so it could be useful for subclasses. Inspired by a
suggestion by Mark Jaroski.
- Added POD coverage test.
- Documented undocumented methods and functions. Most of these are
actually protected methods, but they will be of interest to those
creating their own subclasses or accessor generators Class::Meta.
- Fixed failing tests on Win32. Reported by Robert Rothenberg's CPAN
- Added "override" parameter to "add_attribute()" so that subclasses
can override attributes in their parent classes.
- Fixed the MANIFEST so that the new semi-affordance accessor generation
actually works. Reported by Mark Jaroski.
- Moved extra code to prevent AccessorBuilder from pointing to
Constructor in the default (croak) error handler from AccessorBuilder
to the default error handler. Carp is a PITA.
- Added "handle_error()" class method to Class::Meta. This method is
used by Class::Meta classes when no Class::Meta::Class object is
- Added semi-affordance accessor generation.
- Modified arguments passed to check code references. Now, in addition
to the new value to be assiged to the attribute, the object being
assigned to and the Class::Meta::Attribute object that describes the
attribute are passed. If the attribute is a class attribute, then the
second argument is a hash reference containing the existing value and
the name of the package.
- Thanks the the presence of the attribute object as an argument to
check code references, the name of the attribute is now included in
exceptions thrown for "once" and "required" attributes.
- Added "class" accessors to Constructor, Attribute, and Method, to
return the Class object for the class in which the constructor,
attribute, or method was defined.
- Added "error_handler" parameter to Class::Meta->new to be called for
- Added default_error_handler() class method to Class::Meta to act
as the default error handler when no "error_handler" parameter is
passed to Class::Meta->new.
- Added more documentation to the Class::Meta synopsis that highlights
the generated constructor and attribute accessors, as well as the
- Fixed documentation to reflect that the introspection class method
installed in a generated class is called my_class(), not class().
Thanks to Marcus Ramberg for the spot!
- Documented the "required" attribute of Class::Meta::Attribute.
- Added "once" attribute to Class::Meta::Attribute. This attribute
indicates whether an attribute value can be set to a defined value
- Renamed the call_get() and call_set() methods of
Class::Meta::Attribute to simply get() and set().
- Private and protected constructors generated by Class::Meta are now
truly private and protected.
- Class::Meta no longer generates constructors when they're added with
create => 0.
- For default accessors, object and class attribute accessors were
- Private and protected attributes now are truly private and protected
if they're constructed by the accessor builder packages that come with
- The call_get() and call_set() methods of Class::Meta::Attribute and
the call() methods of Class::Meta::Constructor and
Class::Meta::::Method now use goto to execute the true methods. This
removes the call to call_get() or call_set() or call() from the call
stack trace, and makes it possible for the private and protected
checks to always work properly.
- The class "name" attribute now defaults to be the same as the key
if it is not explicitly set.
- The constructor generated by Class::Meta no longer attempts to set
- A package name now must be passed to the Class::Meta::Constructor's
call() method as the first argument. This is allow for proper support
- Accessor generators now create accessors for class attributes as
class attributes, instead of as object attributes.
- Added link to rt.cpan.org for reporting bugs.
- Added distribution information to all modules.
- The package attribute now properly defaults to the package
- Class::Meta::Class->construtors now works.
- Initial public release.