[Jifty-commit] r1401 - in apps/WhyPlan: . bin doc etc lib lib/WhyPlan lib/WhyPlan/Action lib/WhyPlan/Model log share share/web share/web/static share/web/templates t var var/mason

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Jun 29 12:23:29 EDT 2006


Author: jesse
Date: Thu Jun 29 12:23:26 2006
New Revision: 1401

Added:
   apps/WhyPlan/Makefile.PL
   apps/WhyPlan/bin/
   apps/WhyPlan/bin/jifty   (contents, props changed)
   apps/WhyPlan/doc/
   apps/WhyPlan/etc/
   apps/WhyPlan/etc/config.yml
   apps/WhyPlan/lib/
   apps/WhyPlan/lib/WhyPlan/
   apps/WhyPlan/lib/WhyPlan/Action/
   apps/WhyPlan/lib/WhyPlan/Model/
   apps/WhyPlan/lib/WhyPlan/Model/Iteration.pm
   apps/WhyPlan/lib/WhyPlan/Model/Project.pm
   apps/WhyPlan/lib/WhyPlan/Model/ProjectRole.pm
   apps/WhyPlan/lib/WhyPlan/Model/Story.pm
   apps/WhyPlan/lib/WhyPlan/Model/Task.pm
   apps/WhyPlan/lib/WhyPlan/Model/TimeEntry.pm
   apps/WhyPlan/lib/WhyPlan/Model/User.pm
   apps/WhyPlan/log/
   apps/WhyPlan/share/
   apps/WhyPlan/share/po/
   apps/WhyPlan/share/web/
   apps/WhyPlan/share/web/static/
   apps/WhyPlan/share/web/templates/
   apps/WhyPlan/t/
   apps/WhyPlan/t/00-model-Iteration.t
   apps/WhyPlan/t/00-model-Project.t
   apps/WhyPlan/t/00-model-ProjectRole.t
   apps/WhyPlan/t/00-model-Story.t
   apps/WhyPlan/t/00-model-Task.t
   apps/WhyPlan/t/00-model-TimeEntry.t
   apps/WhyPlan/t/00-model-User.t
   apps/WhyPlan/var/
   apps/WhyPlan/var/mason/
Modified:
   apps/WhyPlan/   (props changed)

Log:
 r35446 at truegrounds:  jesse | 2006-06-29 11:23:21 -0500
  * First post!


Added: apps/WhyPlan/Makefile.PL
==============================================================================
--- (empty file)
+++ apps/WhyPlan/Makefile.PL	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,6 @@
+use inc::Module::Install;
+name('WhyPlan');
+version('0.01');
+requires('Jifty' => '0.60615');
+
+WriteAll;

Added: apps/WhyPlan/bin/jifty
==============================================================================
--- (empty file)
+++ apps/WhyPlan/bin/jifty	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+
+eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
+    if 0; # not running under some shell
+use warnings;
+use strict;
+use File::Basename qw(dirname); 
+use UNIVERSAL::require;
+
+BEGIN {
+    Jifty::Util->require or die $UNIVERSAL::require::ERROR;
+    my $root = Jifty::Util->app_root;
+    unshift @INC, "$root/lib" if ($root);
+}
+
+use Jifty::Script;
+$SIG{INT} = $SIG{TERM} = sub { warn "Stopped\n"; exit; };
+Jifty::Script->dispatch();

Added: apps/WhyPlan/etc/config.yml
==============================================================================
--- (empty file)
+++ apps/WhyPlan/etc/config.yml	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,35 @@
+--- 
+framework: 
+  AdminMode: 1
+  ApplicationClass: WhyPlan
+  ApplicationName: WhyPlan
+  Database: 
+    Database: whyplan
+    Driver: SQLite
+    Host: localhost
+    Password: ''
+    RecordBaseClass: Jifty::DBI::Record::Cachable
+    User: ''
+    Version: 0.0.1
+  DevelMode: 1
+  L10N: 
+    PoDir: share/po
+  LogLevel: INFO
+  Mailer: Sendmail
+  MailerArgs: []
+
+
+  Web: 
+    BaseURL: http://localhost
+    DataDir: var/mason
+    Globals: []
+
+    MasonConfig: 
+      autoflush: 0
+      default_escape_flags: h
+      error_format: text
+      error_mode: fatal
+    Port: 8888
+    ServeStaticFiles: 1
+    StaticRoot: share/web/static
+    TemplateRoot: share/web/templates

Added: apps/WhyPlan/lib/WhyPlan/Model/Iteration.pm
==============================================================================
--- (empty file)
+++ apps/WhyPlan/lib/WhyPlan/Model/Iteration.pm	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,22 @@
+use strict;
+use warnings;
+
+package WhyPlan::Model::Iteration::Schema;
+use Jifty::DBI::Schema;
+
+# Your column definitions go here.  See L<Jifty::DBI::Schema> for
+# documentation about how to write column definitions.
+
+column project => refers_to WhyPlan::Model::Project;
+column name => type is 'text';
+column description => type is 'text';
+column starts => type is 'date';
+column ends => type is 'date';
+
+package WhyPlan::Model::Iteration;
+use base qw/WhyPlan::Record/;
+
+# Your model-specific methods go here.
+
+1;
+

Added: apps/WhyPlan/lib/WhyPlan/Model/Project.pm
==============================================================================
--- (empty file)
+++ apps/WhyPlan/lib/WhyPlan/Model/Project.pm	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,23 @@
+use strict;
+use warnings;
+
+package WhyPlan::Model::Project::Schema;
+use Jifty::DBI::Schema;
+
+# Your column definitions go here.  See L<Jifty::DBI::Schema> for
+# documentation about how to write column definitions.
+
+column name => 
+    type is 'text';
+column description => 
+    type is 'text';
+column active      => 
+    valid_values are qw(active inactive);
+
+package WhyPlan::Model::Project;
+use base qw/WhyPlan::Record/;
+
+# Your model-specific methods go here.
+
+1;
+

Added: apps/WhyPlan/lib/WhyPlan/Model/ProjectRole.pm
==============================================================================
--- (empty file)
+++ apps/WhyPlan/lib/WhyPlan/Model/ProjectRole.pm	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,16 @@
+use strict;
+use warnings;
+
+package WhyPlan::Model::ProjectRole::Schema;
+use Jifty::DBI::Schema;
+
+# Your column definitions go here.  See L<Jifty::DBI::Schema> for
+# documentation about how to write column definitions.
+
+package WhyPlan::Model::ProjectRole;
+use base qw/WhyPlan::Record/;
+
+# Your model-specific methods go here.
+
+1;
+

Added: apps/WhyPlan/lib/WhyPlan/Model/Story.pm
==============================================================================
--- (empty file)
+++ apps/WhyPlan/lib/WhyPlan/Model/Story.pm	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,32 @@
+use strict;
+use warnings;
+
+package WhyPlan::Model::Story::Schema;
+use Jifty::DBI::Schema;
+
+# Your column definitions go here.  See L<Jifty::DBI::Schema> for
+# documentation about how to write column definitions.
+
+column iteration => refers_to WhyPlan::Model::Iteration;
+column name => type is 'text';
+column description => type is 'text';
+column customer => refers_to WhyPlan::Model::User;
+column tracker => refers_to WhyPlan::Model::User;
+column estimated_hours => type is 'integer';
+column postponed_hours => type is 'integer';
+column original_estimated_hours => type is 'integer';
+column iteration_start_estimated_hours => type is 'integer';
+column priority => type is 'integer';
+column status => valid_values are qw(Draft Defined Estimated Planned Implemeneted Verified Accepted);
+column active => valid_values are qw(active inactive);
+column disposition => valid_values are qw(Planned CarriedOver Added);
+column sorting => type is 'integer';
+
+
+package WhyPlan::Model::Story;
+use base qw/WhyPlan::Record/;
+
+# Your model-specific methods go here.
+
+1;
+

Added: apps/WhyPlan/lib/WhyPlan/Model/Task.pm
==============================================================================
--- (empty file)
+++ apps/WhyPlan/lib/WhyPlan/Model/Task.pm	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,27 @@
+use strict;
+use warnings;
+
+package WhyPlan::Model::Task::Schema;
+use Jifty::DBI::Schema;
+
+# Your column definitions go here.  See L<Jifty::DBI::Schema> for
+# documentation about how to write column definitions.
+
+column story => refers_to WhyPlan::Model::Story;
+column name => type is 'text';
+column description => type is 'text';
+column acceptor => refers_to WhyPlan::Model::User;
+column estimated_hours => type is 'integer';
+column original_estimated_hours => type is 'integer';
+column complete => type is 'bool';
+column disposition => valid_values are qw(Planned Discovered Added CarriedOver);
+column type => valid_values are qw(Feature Debt Defect FeatureTest AcceptanceTest Overhead);
+
+
+package WhyPlan::Model::Task;
+use base qw/WhyPlan::Record/;
+
+# Your model-specific methods go here.
+
+1;
+

Added: apps/WhyPlan/lib/WhyPlan/Model/TimeEntry.pm
==============================================================================
--- (empty file)
+++ apps/WhyPlan/lib/WhyPlan/Model/TimeEntry.pm	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,25 @@
+use strict;
+use warnings;
+
+package WhyPlan::Model::TimeEntry::Schema;
+use Jifty::DBI::Schema;
+use WhyPlan::Model::UserCollection;
+# Your column definitions go here.  See L<Jifty::DBI::Schema> for
+# documentation about how to write column definitions.
+
+column task => refers_to WhyPlan::Model::Task;
+column start => type is 'datetime';
+column end => type is 'datetime';
+column duration => type is 'integer';
+column reported => type is 'datetime';
+column description => type is 'text';
+column people => refers_to WhyPlan::Model::UserCollection;
+
+
+package WhyPlan::Model::TimeEntry;
+use base qw/WhyPlan::Record/;
+
+# Your model-specific methods go here.
+
+1;
+

Added: apps/WhyPlan/lib/WhyPlan/Model/User.pm
==============================================================================
--- (empty file)
+++ apps/WhyPlan/lib/WhyPlan/Model/User.pm	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,16 @@
+use strict;
+use warnings;
+
+package WhyPlan::Model::User::Schema;
+use Jifty::DBI::Schema;
+
+# Your column definitions go here.  See L<Jifty::DBI::Schema> for
+# documentation about how to write column definitions.
+
+package WhyPlan::Model::User;
+use base qw/WhyPlan::Record/;
+
+# Your model-specific methods go here.
+
+1;
+

Added: apps/WhyPlan/t/00-model-Iteration.t
==============================================================================
--- (empty file)
+++ apps/WhyPlan/t/00-model-Iteration.t	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+=head1 DESCRIPTION
+
+A basic test harness for the Iteration model.
+
+=cut
+
+use Jifty::Test tests => 11;
+
+# Make sure we can load the model
+use_ok('WhyPlan::Model::Iteration');
+
+# Grab a system user
+my $system_user = WhyPlan::CurrentUser->superuser;
+ok($system_user, "Found a system user");
+
+# Try testing a create
+my $o = WhyPlan::Model::Iteration->new(current_user => $system_user);
+my ($id) = $o->create();
+ok($id, "Iteration create returned success");
+ok($o->id, "New Iteration has valid id set");
+is($o->id, $id, "Create returned the right id");
+
+# And another
+$o->create();
+ok($o->id, "Iteration create returned another value");
+isnt($o->id, $id, "And it is different from the previous one");
+
+# Searches in general
+my $collection =  WhyPlan::Model::IterationCollection->new(current_user => $system_user);
+$collection->unlimit;
+is($collection->count, 2, "Finds two records");
+
+# Searches in specific
+$collection->limit(column => 'id', value => $o->id);
+is($collection->count, 1, "Finds one record with specific id");
+
+# Delete one of them
+$o->delete;
+$collection->redo_search;
+is($collection->count, 0, "Deleted row is gone");
+
+# And the other one is still there
+$collection->unlimit;
+is($collection->count, 1, "Still one left");
+

Added: apps/WhyPlan/t/00-model-Project.t
==============================================================================
--- (empty file)
+++ apps/WhyPlan/t/00-model-Project.t	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+=head1 DESCRIPTION
+
+A basic test harness for the Project model.
+
+=cut
+
+use Jifty::Test tests => 11;
+
+# Make sure we can load the model
+use_ok('WhyPlan::Model::Project');
+
+# Grab a system user
+my $system_user = WhyPlan::CurrentUser->superuser;
+ok($system_user, "Found a system user");
+
+# Try testing a create
+my $o = WhyPlan::Model::Project->new(current_user => $system_user);
+my ($id) = $o->create();
+ok($id, "Project create returned success");
+ok($o->id, "New Project has valid id set");
+is($o->id, $id, "Create returned the right id");
+
+# And another
+$o->create();
+ok($o->id, "Project create returned another value");
+isnt($o->id, $id, "And it is different from the previous one");
+
+# Searches in general
+my $collection =  WhyPlan::Model::ProjectCollection->new(current_user => $system_user);
+$collection->unlimit;
+is($collection->count, 2, "Finds two records");
+
+# Searches in specific
+$collection->limit(column => 'id', value => $o->id);
+is($collection->count, 1, "Finds one record with specific id");
+
+# Delete one of them
+$o->delete;
+$collection->redo_search;
+is($collection->count, 0, "Deleted row is gone");
+
+# And the other one is still there
+$collection->unlimit;
+is($collection->count, 1, "Still one left");
+

Added: apps/WhyPlan/t/00-model-ProjectRole.t
==============================================================================
--- (empty file)
+++ apps/WhyPlan/t/00-model-ProjectRole.t	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+=head1 DESCRIPTION
+
+A basic test harness for the ProjectRole model.
+
+=cut
+
+use Jifty::Test tests => 11;
+
+# Make sure we can load the model
+use_ok('WhyPlan::Model::ProjectRole');
+
+# Grab a system user
+my $system_user = WhyPlan::CurrentUser->superuser;
+ok($system_user, "Found a system user");
+
+# Try testing a create
+my $o = WhyPlan::Model::ProjectRole->new(current_user => $system_user);
+my ($id) = $o->create();
+ok($id, "ProjectRole create returned success");
+ok($o->id, "New ProjectRole has valid id set");
+is($o->id, $id, "Create returned the right id");
+
+# And another
+$o->create();
+ok($o->id, "ProjectRole create returned another value");
+isnt($o->id, $id, "And it is different from the previous one");
+
+# Searches in general
+my $collection =  WhyPlan::Model::ProjectRoleCollection->new(current_user => $system_user);
+$collection->unlimit;
+is($collection->count, 2, "Finds two records");
+
+# Searches in specific
+$collection->limit(column => 'id', value => $o->id);
+is($collection->count, 1, "Finds one record with specific id");
+
+# Delete one of them
+$o->delete;
+$collection->redo_search;
+is($collection->count, 0, "Deleted row is gone");
+
+# And the other one is still there
+$collection->unlimit;
+is($collection->count, 1, "Still one left");
+

Added: apps/WhyPlan/t/00-model-Story.t
==============================================================================
--- (empty file)
+++ apps/WhyPlan/t/00-model-Story.t	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+=head1 DESCRIPTION
+
+A basic test harness for the Story model.
+
+=cut
+
+use Jifty::Test tests => 11;
+
+# Make sure we can load the model
+use_ok('WhyPlan::Model::Story');
+
+# Grab a system user
+my $system_user = WhyPlan::CurrentUser->superuser;
+ok($system_user, "Found a system user");
+
+# Try testing a create
+my $o = WhyPlan::Model::Story->new(current_user => $system_user);
+my ($id) = $o->create();
+ok($id, "Story create returned success");
+ok($o->id, "New Story has valid id set");
+is($o->id, $id, "Create returned the right id");
+
+# And another
+$o->create();
+ok($o->id, "Story create returned another value");
+isnt($o->id, $id, "And it is different from the previous one");
+
+# Searches in general
+my $collection =  WhyPlan::Model::StoryCollection->new(current_user => $system_user);
+$collection->unlimit;
+is($collection->count, 2, "Finds two records");
+
+# Searches in specific
+$collection->limit(column => 'id', value => $o->id);
+is($collection->count, 1, "Finds one record with specific id");
+
+# Delete one of them
+$o->delete;
+$collection->redo_search;
+is($collection->count, 0, "Deleted row is gone");
+
+# And the other one is still there
+$collection->unlimit;
+is($collection->count, 1, "Still one left");
+

Added: apps/WhyPlan/t/00-model-Task.t
==============================================================================
--- (empty file)
+++ apps/WhyPlan/t/00-model-Task.t	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+=head1 DESCRIPTION
+
+A basic test harness for the Task model.
+
+=cut
+
+use Jifty::Test tests => 11;
+
+# Make sure we can load the model
+use_ok('WhyPlan::Model::Task');
+
+# Grab a system user
+my $system_user = WhyPlan::CurrentUser->superuser;
+ok($system_user, "Found a system user");
+
+# Try testing a create
+my $o = WhyPlan::Model::Task->new(current_user => $system_user);
+my ($id) = $o->create();
+ok($id, "Task create returned success");
+ok($o->id, "New Task has valid id set");
+is($o->id, $id, "Create returned the right id");
+
+# And another
+$o->create();
+ok($o->id, "Task create returned another value");
+isnt($o->id, $id, "And it is different from the previous one");
+
+# Searches in general
+my $collection =  WhyPlan::Model::TaskCollection->new(current_user => $system_user);
+$collection->unlimit;
+is($collection->count, 2, "Finds two records");
+
+# Searches in specific
+$collection->limit(column => 'id', value => $o->id);
+is($collection->count, 1, "Finds one record with specific id");
+
+# Delete one of them
+$o->delete;
+$collection->redo_search;
+is($collection->count, 0, "Deleted row is gone");
+
+# And the other one is still there
+$collection->unlimit;
+is($collection->count, 1, "Still one left");
+

Added: apps/WhyPlan/t/00-model-TimeEntry.t
==============================================================================
--- (empty file)
+++ apps/WhyPlan/t/00-model-TimeEntry.t	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+=head1 DESCRIPTION
+
+A basic test harness for the TimeEntry model.
+
+=cut
+
+use Jifty::Test tests => 11;
+
+# Make sure we can load the model
+use_ok('WhyPlan::Model::TimeEntry');
+
+# Grab a system user
+my $system_user = WhyPlan::CurrentUser->superuser;
+ok($system_user, "Found a system user");
+
+# Try testing a create
+my $o = WhyPlan::Model::TimeEntry->new(current_user => $system_user);
+my ($id) = $o->create();
+ok($id, "TimeEntry create returned success");
+ok($o->id, "New TimeEntry has valid id set");
+is($o->id, $id, "Create returned the right id");
+
+# And another
+$o->create();
+ok($o->id, "TimeEntry create returned another value");
+isnt($o->id, $id, "And it is different from the previous one");
+
+# Searches in general
+my $collection =  WhyPlan::Model::TimeEntryCollection->new(current_user => $system_user);
+$collection->unlimit;
+is($collection->count, 2, "Finds two records");
+
+# Searches in specific
+$collection->limit(column => 'id', value => $o->id);
+is($collection->count, 1, "Finds one record with specific id");
+
+# Delete one of them
+$o->delete;
+$collection->redo_search;
+is($collection->count, 0, "Deleted row is gone");
+
+# And the other one is still there
+$collection->unlimit;
+is($collection->count, 1, "Still one left");
+

Added: apps/WhyPlan/t/00-model-User.t
==============================================================================
--- (empty file)
+++ apps/WhyPlan/t/00-model-User.t	Thu Jun 29 12:23:26 2006
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+=head1 DESCRIPTION
+
+A basic test harness for the User model.
+
+=cut
+
+use Jifty::Test tests => 11;
+
+# Make sure we can load the model
+use_ok('WhyPlan::Model::User');
+
+# Grab a system user
+my $system_user = WhyPlan::CurrentUser->superuser;
+ok($system_user, "Found a system user");
+
+# Try testing a create
+my $o = WhyPlan::Model::User->new(current_user => $system_user);
+my ($id) = $o->create();
+ok($id, "User create returned success");
+ok($o->id, "New User has valid id set");
+is($o->id, $id, "Create returned the right id");
+
+# And another
+$o->create();
+ok($o->id, "User create returned another value");
+isnt($o->id, $id, "And it is different from the previous one");
+
+# Searches in general
+my $collection =  WhyPlan::Model::UserCollection->new(current_user => $system_user);
+$collection->unlimit;
+is($collection->count, 2, "Finds two records");
+
+# Searches in specific
+$collection->limit(column => 'id', value => $o->id);
+is($collection->count, 1, "Finds one record with specific id");
+
+# Delete one of them
+$o->delete;
+$collection->redo_search;
+is($collection->count, 0, "Deleted row is gone");
+
+# And the other one is still there
+$collection->unlimit;
+is($collection->count, 1, "Still one left");
+


More information about the Jifty-commit mailing list