[Jifty-commit] jifty-dbi branch, master, updated. 0.66-2-g82102d4
Jifty commits
jifty-commit at lists.jifty.org
Fri Feb 18 19:28:25 EST 2011
The branch, master has been updated
via 82102d4aa0dd6ee8b9f62cde296ca89fa9be71b8 (commit)
from c214967784aae148a6b3a3b5f1e4b804dad24673 (commit)
Summary of changes:
lib/Jifty/DBI/Column.pm | 4 ++--
lib/Jifty/DBI/Schema.pm | 42 +++++++++++++++++++++---------------------
t/99-tabs.t | 6 ++++++
t/metadata.t | 8 ++++----
4 files changed, 33 insertions(+), 27 deletions(-)
create mode 100644 t/99-tabs.t
- Log -----------------------------------------------------------------
commit 82102d4aa0dd6ee8b9f62cde296ca89fa9be71b8
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Fri Feb 18 19:26:55 2011 -0500
Kill tabs and add t/99-tabs.t which uses Test::NoTabs
diff --git a/lib/Jifty/DBI/Column.pm b/lib/Jifty/DBI/Column.pm
index c4c9875..d828084 100644
--- a/lib/Jifty/DBI/Column.pm
+++ b/lib/Jifty/DBI/Column.pm
@@ -55,7 +55,7 @@ for my $attr (@handy_attrs) {
no strict 'refs';
*$attr = sub {
my $self = shift;
- $self->attributes({}) unless $self->attributes;
+ $self->attributes({}) unless $self->attributes;
return $self->attributes->{$attr} unless @_;
$self->attributes->{$attr} = (@_ == 1 ? $_[0] : [@_]);
}
@@ -91,7 +91,7 @@ sub new {
# not in @attrs into attributes and just pass the whole hash
$self->attributes({});
for (keys %$args) {
- $self->can($_) ? $self->$_($args->{$_}) : $self->attributes->{$_} = $args->{$_};
+ $self->can($_) ? $self->$_($args->{$_}) : $self->attributes->{$_} = $args->{$_};
}
return $self;
diff --git a/lib/Jifty/DBI/Schema.pm b/lib/Jifty/DBI/Schema.pm
index 6e7973a..1d47c31 100644
--- a/lib/Jifty/DBI/Schema.pm
+++ b/lib/Jifty/DBI/Schema.pm
@@ -73,7 +73,7 @@ use Object::Declare (
# looks like a type name but not found
return ($_[0] => 1) unless $typehandler;
return $typehandler->();
- },
+ },
are => '',
as => '',
ajax => 'ajax_',
@@ -208,26 +208,26 @@ sub schema (&) {
my $from = caller;
my $new_code = sub {
- no warnings 'redefine';
- local *_ = sub { my $args = \@_; defer { _(@$args) } };
- $from->_init_columns;
-
- my @columns = &declare($code);
-
- # Unimport all our symbols from the calling package,
- # except for "lazy" and "defer".
- foreach my $sym (@EXPORT) {
- next if $sym eq 'lazy' or $sym eq 'defer';
-
- no strict 'refs';
- undef *{"$from\::$sym"}
- if \&{"$from\::$sym"} == \&$sym;
- }
-
- foreach my $column (@columns) {
- next if !ref($column);
- _init_column($column);
- }
+ no warnings 'redefine';
+ local *_ = sub { my $args = \@_; defer { _(@$args) } };
+ $from->_init_columns;
+
+ my @columns = &declare($code);
+
+# Unimport all our symbols from the calling package,
+ # except for "lazy" and "defer".
+ foreach my $sym (@EXPORT) {
+ next if $sym eq 'lazy' or $sym eq 'defer';
+
+ no strict 'refs';
+ undef *{"$from\::$sym"}
+ if \&{"$from\::$sym"} == \&$sym;
+ }
+
+ foreach my $column (@columns) {
+ next if !ref($column);
+ _init_column($column);
+ }
$from->_init_methods_for_columns;
};
diff --git a/t/99-tabs.t b/t/99-tabs.t
new file mode 100644
index 0000000..58b36df
--- /dev/null
+++ b/t/99-tabs.t
@@ -0,0 +1,6 @@
+use Test::More;
+eval "use Test::NoTabs 1.00";
+plan skip_all => "Test::NoTabs 1.00 required for testing POD coverage" if $@;
+plan skip_all => "Tab tests only run for authors" unless (-d 'inc/.author');
+
+Test::NoTabs::all_perl_files_ok('lib', 't');
diff --git a/t/metadata.t b/t/metadata.t
index 7cec43c..5122ac0 100644
--- a/t/metadata.t
+++ b/t/metadata.t
@@ -33,12 +33,12 @@ SKIP: {
my $rec = TestApp::User->new( handle => $handle );
isa_ok($rec, 'Jifty::DBI::Record');
- my $col = $rec->column('name');
- is($col->label, 'Name');
+ my $col = $rec->column('name');
+ is($col->label, 'Name');
- is($col->attributes->{arbitary_data}, 'fooo');
+ is($col->attributes->{arbitary_data}, 'fooo');
- is_deeply($col->serialize_metadata, { type => 'varchar', label => 'Name', sort_order => 0, writable => 1, name => 'name', readable => 1 });
+ is_deeply($col->serialize_metadata, { type => 'varchar', label => 'Name', sort_order => 0, writable => 1, name => 'name', readable => 1 });
cleanup_schema( 'TestApp', $handle );
disconnect_handle( $handle );
-----------------------------------------------------------------------
More information about the Jifty-commit
mailing list