[Rt-commit] r2876 - in DBIx-SearchBuilder/trunk: . SearchBuilder

jesse at bestpractical.com jesse at bestpractical.com
Wed May 11 20:13:22 EDT 2005


Author: jesse
Date: Wed May 11 20:13:22 2005
New Revision: 2876

Modified:
   DBIx-SearchBuilder/trunk/   (props changed)
   DBIx-SearchBuilder/trunk/Changes
   DBIx-SearchBuilder/trunk/META.yml
   DBIx-SearchBuilder/trunk/Makefile.PL
   DBIx-SearchBuilder/trunk/SearchBuilder.pm
   DBIx-SearchBuilder/trunk/SearchBuilder/Record.pm
Log:
 r16508 at hualien:  jesse | 2005-05-12 01:12:55 +0100
 * Switch from manual subroutine aliases to capitalize.pm
 


Modified: DBIx-SearchBuilder/trunk/Changes
==============================================================================
--- DBIx-SearchBuilder/trunk/Changes	(original)
+++ DBIx-SearchBuilder/trunk/Changes	Wed May 11 20:13:22 2005
@@ -1,5 +1,7 @@
 Revision history for Perl extension DBIx::SearchBuilder.
 
+    - Patches from Ruslan to switch to using 'capitalize.pm' for our regular_case subroutine aliases
+
 1.27 Sun May  8 22:49:30 EDT 2005
 
     - Added supoprt for functions containing "?" to represent the parameter 

Modified: DBIx-SearchBuilder/trunk/META.yml
==============================================================================
--- DBIx-SearchBuilder/trunk/META.yml	(original)
+++ DBIx-SearchBuilder/trunk/META.yml	Wed May 11 20:13:22 2005
@@ -1,5 +1,5 @@
 name: DBIx-SearchBuilder
-version: 1.26
+version: 1.27
 license: perl
 distribution_type: module
 build_requires:

Modified: DBIx-SearchBuilder/trunk/Makefile.PL
==============================================================================
--- DBIx-SearchBuilder/trunk/Makefile.PL	(original)
+++ DBIx-SearchBuilder/trunk/Makefile.PL	Wed May 11 20:13:22 2005
@@ -7,8 +7,16 @@
 requires('Want');
 requires('Encode');
 requires('Class::ReturnValue', 0.40);
-requires( 'Cache::Simple::TimedExpiry' => '0.21');
+requires('Cache::Simple::TimedExpiry' => '0.21');
 build_requires('Test::More');
 
+features(
+	'Lower case API' => [
+		-defaults => 0,
+		'capitalization' => '0.03',
+	],
+);
+auto_install();
+
 &Makefile->write;
 &Meta->write;

Modified: DBIx-SearchBuilder/trunk/SearchBuilder.pm
==============================================================================
--- DBIx-SearchBuilder/trunk/SearchBuilder.pm	(original)
+++ DBIx-SearchBuilder/trunk/SearchBuilder.pm	Wed May 11 20:13:22 2005
@@ -31,6 +31,11 @@
 
 This module provides an object-oriented mechanism for retrieving and updating data in a DBI-accesible database. 
 
+=head1 METHODS NAMING
+ 
+All methods has lower case aliases, '_' is used to distinguish words.
+For example method C<RedoSearch> has alias C<redo_search>.
+
 =head1 METHODS
 
 =cut
@@ -397,7 +402,7 @@
 
 =cut
 
-*next = \&Next;
+
 
 sub Next {
     my $self = shift;
@@ -430,7 +435,7 @@
 
 =cut
 
-*goto_first_item = \&GotoFirstItem;
+
 sub GotoFirstItem {
     my $self = shift;
     $self->GotoItem(0);
@@ -1345,7 +1350,7 @@
 =cut
 
 
-*count = \&Count;
+
 sub Count {
     my $self = shift;
 
@@ -1615,7 +1620,9 @@
 
 
 # }}}
-
+if( eval { require capitalization } ) {
+	capitalization->unimport( __PACKAGE__ );
+}
 
 1;
 __END__

Modified: DBIx-SearchBuilder/trunk/SearchBuilder/Record.pm
==============================================================================
--- DBIx-SearchBuilder/trunk/SearchBuilder/Record.pm	(original)
+++ DBIx-SearchBuilder/trunk/SearchBuilder/Record.pm	Wed May 11 20:13:22 2005
@@ -8,6 +8,7 @@
 use Class::ReturnValue;
 
 
+
 # {{{ Doc
 
 =head1 NAME
@@ -337,6 +338,10 @@
 ever else I think of.
 
 
+=head1 METHODS NAMING
+ 
+All methods has lower case aliases, '_' is used to distinguish words.
+For example method C<_PrimaryKeys> has alias C<_primary_keys>.
 
 =head1 METHODS
 
@@ -375,9 +380,10 @@
 =cut
 
 
-*Id = \&id;
 
-sub id  {
+*id = \&Id;
+
+sub Id  {
     my $pkey = $_[0]->_PrimaryKey();
     $_[0]->{'values'}->{$pkey};
 }
@@ -394,7 +400,7 @@
 
 
 
-*primary_keys = \&PrimaryKeys;
+
 sub PrimaryKeys { 
     my $self = shift; 
     my %hash = map { $_ => $self->{'values'}->{$_} } @{$self->_PrimaryKeys};
@@ -501,7 +507,7 @@
 
 =cut
 
-*_accessible = \&_Accessible;
+
 sub _Accessible {
     my $self = shift;
     my $attr = shift;
@@ -614,7 +620,7 @@
 
 =cut
 
-*__value = \&__Value;
+
 sub __Value {
   my $self = shift;
   my $field = lc(shift);
@@ -642,7 +648,7 @@
 
 =cut
 
-*_value = \&_Value;
+
 sub _Value  {
   my $self = shift;
   return ($self->__Value(@_));
@@ -660,7 +666,7 @@
 
 =cut
 
-*_set = \&_Set;
+
 sub _Set {
     my $self = shift;
     return ($self->__Set(@_));
@@ -668,7 +674,7 @@
 
 
 
-*__set = \&__Set;
+
 sub __Set {
     my $self = shift;
 
@@ -789,7 +795,7 @@
 
 #TODO: Implement _Validate.
 
-*_validate = \&_Validate;
+
 sub _Validate  {
     my $self = shift;
     my $field = shift;
@@ -926,7 +932,7 @@
 =cut
 
 
-*load = \&Load;
+
 sub Load  {
     my $self = shift;
     # my ($package, $filename, $line) = caller;
@@ -944,7 +950,7 @@
 
 =cut
 
-*load_by_col = \&LoadByCol;
+
 
 sub LoadByCol  {
     my $self = shift;
@@ -970,7 +976,7 @@
 
 =cut
 
-*load_by_cols = \&LoadByCols;
+
 sub LoadByCols  {
     my $self = shift;
     my %hash  = (@_);
@@ -1013,7 +1019,7 @@
 
 =cut
 
-*load_by_id = \&LoadById;
+
 sub LoadById  {
     my $self = shift;
     my $id = shift;
@@ -1034,7 +1040,7 @@
 
 =cut
 
-*load_by_primary_keys = \&LoadByPrimaryKeys;
+
 
 sub LoadByPrimaryKeys {
     my ($self, $data) = @_;
@@ -1063,7 +1069,7 @@
 
 =cut
 
-*load_from_hash = \&LoadFromHash;
+
 
 sub LoadFromHash {
   my $self = shift;
@@ -1087,7 +1093,7 @@
 
 =cut
 
-*load_from_sql = \&LoadFromSQL;
+
 
 
 sub _LoadFromSQL {
@@ -1143,7 +1149,7 @@
 
 =cut 
 
-*create = \&Create;
+
 
 sub Create {
     my $self    = shift;
@@ -1229,7 +1235,7 @@
 
 =cut
 
-*table = \&Table;
+
 
 sub Table {
     my $self = shift;
@@ -1249,7 +1255,7 @@
 
 =cut
 
-*_handle = \&_Handle;
+
 sub _Handle  {
     my $self = shift;
     if (@_) {
@@ -1260,6 +1266,9 @@
 
 # }}}
 
+if( eval { require capitalization } ) {
+	capitalization->unimport( __PACKAGE__ );
+}
 
 1;
 


More information about the Rt-commit mailing list