[Bps-public-commit] SD branch, master, updated. ac31ba362732855f82e87e1dc30e07461a990256
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Thu Jun 18 23:52:58 EDT 2009
The branch, master has been updated
via ac31ba362732855f82e87e1dc30e07461a990256 (commit)
via 90eca29364443088fafa46b48ba7b1d2db0a9d90 (commit)
from acb3e33ce6e2d745c59ccc3c0a1f0c0aa4d0123f (commit)
Summary of changes:
lib/App/SD/CLI/Command.pm | 4 +---
t/01-create.t | 1 -
t/05-config-file-loading.t | 1 -
t/06-ticket-show.t | 1 -
t/07-sort-group.t | 1 -
t/attachment-content.t | 5 ++---
t/sd-gcode/basic.t | 1 -
t/sd-github/basic.t | 1 -
t/sd-rt/basic.t | 7 +++----
t/sd-rt/bogus-rt-data.t | 1 -
t/sd-rt/pull-owner.t | 1 -
t/sd-rt/pull-watchers.t | 1 -
t/sd-rt/race-condition.t | 1 -
t/sd-rt/rt-auto-open-conflict.t | 1 -
14 files changed, 6 insertions(+), 21 deletions(-)
- Log -----------------------------------------------------------------
commit 90eca29364443088fafa46b48ba7b1d2db0a9d90
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Jun 19 11:52:24 2009 +0800
Prophet::Util has slurp method
diff --git a/lib/App/SD/CLI/Command.pm b/lib/App/SD/CLI/Command.pm
index e280f8b..bc95e20 100644
--- a/lib/App/SD/CLI/Command.pm
+++ b/lib/App/SD/CLI/Command.pm
@@ -31,9 +31,7 @@ sub get_content {
my $content;
if (my $file = $self->delete_arg('file')) {
my ( $vol, $dir, $name ) = File::Spec->splitpath( $file );
- local $/;
- open my $fh, '<', $file;
- $content = <$fh>;
+ $content = Prophet::Util->slurp( $file );
$self->set_prop(name => $name);
} elsif ($content = $self->delete_arg('content')) {
commit ac31ba362732855f82e87e1dc30e07461a990256
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Jun 19 11:52:50 2009 +0800
remove Path::Class in tests
diff --git a/t/01-create.t b/t/01-create.t
index 1b95005..2c7f6ea 100644
--- a/t/01-create.t
+++ b/t/01-create.t
@@ -5,7 +5,6 @@ use strict;
use Prophet::Test tests => 3;
use App::SD::Test;
use File::Temp qw/tempdir/;
-use Path::Class;
no warnings 'once';
diff --git a/t/05-config-file-loading.t b/t/05-config-file-loading.t
index e40a7d3..8224b6d 100644
--- a/t/05-config-file-loading.t
+++ b/t/05-config-file-loading.t
@@ -5,7 +5,6 @@ use strict;
use Prophet::Test tests => 10;
use App::SD::Test;
use File::Temp qw/tempdir/;
-use Path::Class;
no warnings 'once';
diff --git a/t/06-ticket-show.t b/t/06-ticket-show.t
index fa3802d..7e83157 100644
--- a/t/06-ticket-show.t
+++ b/t/06-ticket-show.t
@@ -5,7 +5,6 @@ use strict;
use Prophet::Test tests => 6;
use App::SD::Test;
use File::Temp qw/tempdir/;
-use Path::Class;
use Term::ANSIColor;
no warnings 'once';
diff --git a/t/07-sort-group.t b/t/07-sort-group.t
index 952247e..3afa1a1 100644
--- a/t/07-sort-group.t
+++ b/t/07-sort-group.t
@@ -5,7 +5,6 @@ use strict;
use Prophet::Test tests => 11;
use App::SD::Test;
use File::Temp qw/tempdir/;
-use Path::Class;
no warnings 'once';
diff --git a/t/attachment-content.t b/t/attachment-content.t
index 9a7f85c..89f6664 100644
--- a/t/attachment-content.t
+++ b/t/attachment-content.t
@@ -5,11 +5,10 @@ use strict;
use Prophet::Test tests => 10;
use App::SD::Test;
use File::Temp qw/tempdir/;
-use Path::Class;
my $dir = tempdir(CLEANUP => 1);
-my $file= file($dir => 'paper_order.doc');
+my $file= File::Spec->catfile($dir, 'paper_order.doc');
open (my $fh, ">" , $file) || die "Could not create $file: $!";
print $fh "5 tonnes of hard white" || die "Could not write to file $file $!";
@@ -69,7 +68,7 @@ my $image_file = 't/data/bplogo.gif';
run_output_matches('sd', [qw/ticket attachment create --uuid/, $yatta_uuid, '--file', $image_file], [qr/Created attachment (\d+)(?{ $image_attach = $1})/], [], "Added a attachment");
-my $image_data = file($image_file)->slurp;
+my $image_data = Prophet::Util->slurp( $image_file );
my ($ret, $stdout, $stderr) = run_script('sd', [qw/attachment content --id/, $image_attach]);
ok($ret, "Ran the script ok");
is($stdout, $image_data, "We roundtripped some binary");
diff --git a/t/sd-gcode/basic.t b/t/sd-gcode/basic.t
index 343906b..3d62073 100644
--- a/t/sd-gcode/basic.t
+++ b/t/sd-gcode/basic.t
@@ -3,7 +3,6 @@
use strict;
use warnings;
use Prophet::Test;
-use Path::Class;
plan tests => 10;
use App::SD::Test;
diff --git a/t/sd-github/basic.t b/t/sd-github/basic.t
index bd02716..a86ca32 100644
--- a/t/sd-github/basic.t
+++ b/t/sd-github/basic.t
@@ -3,7 +3,6 @@
use strict;
use warnings;
use Prophet::Test;
-use Path::Class;
plan tests => 8;
use App::SD::Test;
diff --git a/t/sd-rt/basic.t b/t/sd-rt/basic.t
index 610df82..61b0889 100644
--- a/t/sd-rt/basic.t
+++ b/t/sd-rt/basic.t
@@ -6,7 +6,6 @@
use strict;
use Prophet::Test;
-use Path::Class;
BEGIN {
unless ( eval 'use RT::Test; 1' ) {
@@ -175,7 +174,7 @@ diag(
"Check to see if YATTA's attachment is binary-identical to the original one"
);
-my $image_data = file($IMAGE_FILE)->slurp;
+my $image_data = Prophet::Util->slurp( $IMAGE_FILE );
my ( $contentret, $stdout, $stderr )
= run_script( 'sd', [ qw/attachment content --id/, $rt_attach_id ] );
ok( $contentret, "Ran the script ok" );
@@ -184,7 +183,7 @@ is( $stderr, '' );
diag("Add an attachment to YATTA");
-my $MAKEFILE_CONTENT = file('Makefile.PL')->slurp;
+my $MAKEFILE_CONTENT = Prophet::Util->slurp('Makefile.PL');
chomp($MAKEFILE_CONTENT);
my $makefile_attach_uuid;
run_output_matches(
@@ -218,7 +217,7 @@ is( $makefile->content, $MAKEFILE_CONTENT,
" The makefile's content was roundtripped ot rt ok" );
is( $logo->content,
- file($IMAGE_FILE)->slurp,
+ scalar Prophet::Util->slurp( $IMAGE_FILE ),
" The image's content was roundtripped ot rt ok"
);
diff --git a/t/sd-rt/bogus-rt-data.t b/t/sd-rt/bogus-rt-data.t
index ac7763b..bf0cc07 100644
--- a/t/sd-rt/bogus-rt-data.t
+++ b/t/sd-rt/bogus-rt-data.t
@@ -6,7 +6,6 @@
use strict;
use Prophet::Test;
-use Path::Class;
BEGIN {
unless ( eval 'use RT::Test; 1' ) {
diff --git a/t/sd-rt/pull-owner.t b/t/sd-rt/pull-owner.t
index 7289908..4a3b40c 100644
--- a/t/sd-rt/pull-owner.t
+++ b/t/sd-rt/pull-owner.t
@@ -5,7 +5,6 @@ use strict;
use warnings;
use Prophet::Test;
-use Path::Class;
use File::Path qw(rmtree);
BEGIN {
diff --git a/t/sd-rt/pull-watchers.t b/t/sd-rt/pull-watchers.t
index a86e458..7d6d41a 100644
--- a/t/sd-rt/pull-watchers.t
+++ b/t/sd-rt/pull-watchers.t
@@ -7,7 +7,6 @@ use strict;
use warnings;
use Prophet::Test;
-use Path::Class;
use File::Path qw(rmtree);
BEGIN {
diff --git a/t/sd-rt/race-condition.t b/t/sd-rt/race-condition.t
index aaffa4b..cc82d8a 100644
--- a/t/sd-rt/race-condition.t
+++ b/t/sd-rt/race-condition.t
@@ -6,7 +6,6 @@
use strict;
use Prophet::Test;
-use Path::Class;
BEGIN {
unless ( eval 'use RT::Test; 1' ) {
diff --git a/t/sd-rt/rt-auto-open-conflict.t b/t/sd-rt/rt-auto-open-conflict.t
index d25fad5..fa5a494 100644
--- a/t/sd-rt/rt-auto-open-conflict.t
+++ b/t/sd-rt/rt-auto-open-conflict.t
@@ -6,7 +6,6 @@
use strict;
use Prophet::Test;
-use Path::Class;
BEGIN {
unless ( eval 'use RT::Test; 1' ) {
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list