[Rt-commit] [svn] r1945 - in Business-SLA: . trunk trunk/lib/Business trunk/t

jesse at pallas.eruditorum.org jesse at pallas.eruditorum.org
Sun Nov 28 17:45:52 EST 2004


Author: jesse
Date: Sun Nov 28 17:45:51 2004
New Revision: 1945

Added:
   Business-SLA/trunk/t/01use.t
Modified:
   Business-SLA/   (props changed)
   Business-SLA/trunk/Changes
   Business-SLA/trunk/MANIFEST
   Business-SLA/trunk/META.yml
   Business-SLA/trunk/Makefile.PL
   Business-SLA/trunk/lib/Business/SLA.pm
Log:
 r9430 at tinbook:  jesse | 2004-11-28T22:47:27.390696Z
 Test fixes


Modified: Business-SLA/trunk/Changes
==============================================================================
--- Business-SLA/trunk/Changes	(original)
+++ Business-SLA/trunk/Changes	Sun Nov 28 17:45:51 2004
@@ -1,5 +1,10 @@
 Revision history for Perl module Business::Hours
 
+0.04 Sun Nov 28 17:43:34 EST 2004
+    - Test fixes
+    - perltidy 
+
+
 0.03 April 1 2003
         - fixed a bug in between
 

Modified: Business-SLA/trunk/MANIFEST
==============================================================================
--- Business-SLA/trunk/MANIFEST	(original)
+++ Business-SLA/trunk/MANIFEST	Sun Nov 28 17:45:51 2004
@@ -5,3 +5,4 @@
 lib/Business/SLA.pm
 Makefile.PL
 META.yml
+t/01use.t

Modified: Business-SLA/trunk/META.yml
==============================================================================
--- Business-SLA/trunk/META.yml	(original)
+++ Business-SLA/trunk/META.yml	Sun Nov 28 17:45:51 2004
@@ -1,12 +1,11 @@
-# http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Business-SLA
-version:      0.01
+version:      0.04
 version_from: lib/Business/SLA.pm
 installdirs:  site
 requires:
-    Set::IntSpan:                  0
+    Business::Hours:               0
     Test::Inline:                  0
 
 distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+generated_by: ExtUtils::MakeMaker version 6.12

Modified: Business-SLA/trunk/Makefile.PL
==============================================================================
--- Business-SLA/trunk/Makefile.PL	(original)
+++ Business-SLA/trunk/Makefile.PL	Sun Nov 28 17:45:51 2004
@@ -4,7 +4,7 @@
 WriteMakefile(
     NAME         => 'Business::SLA',
     VERSION_FROM => 'lib/Business/SLA.pm', # finds $VERSION
-    AUTHOR       => 'Linda Julien (leira at bestpractical.com)',
+    AUTHOR       => 'Linda Julien <leira at bestpractical.com>',
     PREREQ_PM	=> { Test::Inline => 0,
     		     Business::Hours => 0
 		     },

Modified: Business-SLA/trunk/lib/Business/SLA.pm
==============================================================================
--- Business-SLA/trunk/lib/Business/SLA.pm	(original)
+++ Business-SLA/trunk/lib/Business/SLA.pm	Sun Nov 28 17:45:51 2004
@@ -4,10 +4,8 @@
 use warnings;
 use Business::Hours;
 
-	use vars qw ($VERSION);
-	$VERSION     = 0.01;
-
-########################################### main pod documentation begin ##
+use vars qw ($VERSION);
+$VERSION = '0.04';
 
 =head1 NAME
 
@@ -40,7 +38,7 @@
 
 =head1 SUPPORT
 
-Send email  to bug-business-sla at rt.cpan.org
+Send email to bug-business-sla at rt.cpan.org
 
 
 =head1 AUTHOR
@@ -65,14 +63,12 @@
 
 =cut
 
-############################################# main pod documentation end ##
-
 sub new {
-	my $class = shift;
+    my $class = shift;
 
-	my $self = bless ({}, ref ($class) || $class);
+    my $self = bless( {}, ref($class) || $class );
 
-	return ($self);
+    return ($self);
 }
 
 =head2 SetBusinessHours
@@ -99,7 +95,7 @@
 =cut
 
 sub SetBusinessHours {
-    my $self = shift;
+    my $self     = shift;
     my $bizhours = shift;
 
     $self->{'business_hours'} = $bizhours;
@@ -142,7 +138,7 @@
 
 sub SetInHoursDefault {
     my $self = shift;
-    my $sla = shift;;
+    my $sla  = shift;
 
     $self->{'in_hours_default'} = $sla;
 }
@@ -182,7 +178,7 @@
 
 sub SetOutOfHoursDefault {
     my $self = shift;
-    my $sla = shift;;
+    my $sla  = shift;
 
     $self->{'out_of_hours_default'} = $sla;
 }
@@ -199,7 +195,6 @@
     return $self->{'out_of_hours_default'};
 }
 
-
 =begin testing
 
 
@@ -259,12 +254,12 @@
     my $date = shift;
 
     # if no business hours are set, by definition we're in hours
-    if ( !(defined $self->BusinessHours()) ) {
-	return 1;
+    if ( !( defined $self->BusinessHours() ) ) {
+        return 1;
     }
 
-    if ($self->BusinessHours()->first_after($date) != $date) { 
-	return 0;
+    if ( $self->BusinessHours()->first_after($date) != $date ) {
+        return 0;
     }
 
     return 1;
@@ -334,10 +329,11 @@
     my $self = shift;
     my $date = shift;
 
-    if ($self->IsInHours($date)) {
-	return $self->InHoursDefault();
-    } else {
-	return $self->OutOfHoursDefault();
+    if ( $self->IsInHours($date) ) {
+        return $self->InHoursDefault();
+    }
+    else {
+        return $self->OutOfHoursDefault();
     }
 
 }
@@ -356,7 +352,7 @@
 
 sub Add {
     my $self = shift;
-    my $sla = shift;
+    my $sla  = shift;
 
     my %hash = @_;
 
@@ -388,15 +384,16 @@
 
 sub AddRealMinutes {
     my $self = shift;
-    my $sla = shift;
+    my $sla  = shift;
 
     return undef unless defined $sla;
 
     my $minutes;
-    if ($self->{'hash'} && $self->{'hash'}->{$sla}) {
-	$minutes = $self->{'hash'}->{$sla}->{'RealMinutes'};
-    } else {
-	$minutes = undef;
+    if ( $self->{'hash'} && $self->{'hash'}->{$sla} ) {
+        $minutes = $self->{'hash'}->{$sla}->{'RealMinutes'};
+    }
+    else {
+        $minutes = undef;
     }
 
     return $minutes;
@@ -433,19 +430,20 @@
 
 sub AddBusinessMinutes {
     my $self = shift;
-    my $sla = shift;
+    my $sla  = shift;
 
     return undef unless defined $sla;
 
-    if (!$self->BusinessHours) {
-	return undef;
+    if ( !$self->BusinessHours ) {
+        return undef;
     }
 
     my $minutes;
-    if ($self->{'hash'} && $self->{'hash'}->{$sla}) {
-	$minutes = $self->{'hash'}->{$sla}->{'BusinessMinutes'};
-    } else {
-	$minutes = undef;
+    if ( $self->{'hash'} && $self->{'hash'}->{$sla} ) {
+        $minutes = $self->{'hash'}->{$sla}->{'BusinessMinutes'};
+    }
+    else {
+        $minutes = undef;
     }
 
     return $minutes;
@@ -477,12 +475,13 @@
 sub Starts {
     my $self = shift;
     my $date = shift;
-    my $sla = shift;
+    my $sla  = shift;
 
-    if (defined $self->AddBusinessMinutes($sla)) {
-	return $self->BusinessHours()->first_after($date);
-    } else {
-	return $date;
+    if ( defined $self->AddBusinessMinutes($sla) ) {
+        return $self->BusinessHours()->first_after($date);
+    }
+    else {
+        return $date;
     }
 }
 
@@ -512,19 +511,18 @@
 sub Due {
     my $self = shift;
     my $date = shift;
-    my $sla = shift;
+    my $sla  = shift;
 
     # find start time
     my $due = $self->Starts($date);
 
     # don't add business minutes unless we have some set
-    if (defined $self->AddBusinessMinutes($sla)) {
-	my $bh = $self->BusinessHours();
-	$due = $bh->add_seconds($due, 
-				60 * $self->AddBusinessMinutes($sla));
+    if ( defined $self->AddBusinessMinutes($sla) ) {
+        my $bh = $self->BusinessHours();
+        $due = $bh->add_seconds( $due, 60 * $self->AddBusinessMinutes($sla) );
     }
 
-    $due += (60 * $self->AddRealMinutes($sla));
+    $due += ( 60 * $self->AddRealMinutes($sla) );
 
     return $due;
 

Added: Business-SLA/trunk/t/01use.t
==============================================================================
--- (empty file)
+++ Business-SLA/trunk/t/01use.t	Sun Nov 28 17:45:51 2004
@@ -0,0 +1,6 @@
+#!/usr/bin/perl -w
+use strict;
+
+use Test::More qw/no_plan/;
+
+use_ok('Business::SLA');


More information about the Rt-commit mailing list