From de3b249a2bd286ad5d722cd38a6ab809ba1b7552 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 18 May 2009 17:57:20 +0000 Subject: [PATCH] Fill out FilePump macro tests and fix bugs. --- lib/WebGUI/Macro/FilePump.pm | 39 ++++++++++++++----- t/Macro/FilePump.t | 73 +++++++++++++++++++++++++++++++++++- 2 files changed, 102 insertions(+), 10 deletions(-) diff --git a/lib/WebGUI/Macro/FilePump.pm b/lib/WebGUI/Macro/FilePump.pm index 6e3fc584c..cbeb50d58 100644 --- a/lib/WebGUI/Macro/FilePump.pm +++ b/lib/WebGUI/Macro/FilePump.pm @@ -12,6 +12,7 @@ package WebGUI::Macro::FilePump; use strict; use WebGUI::FilePump::Bundle; +use Path::Class; =head1 NAME @@ -59,39 +60,59 @@ sub process { }); return '' unless $bundleId and $bundleId->[0]; - my $bundle = WebGUI::FilePump::Bundle->new($session, $bundleId); + my $bundle = WebGUI::FilePump::Bundle->new($session, $bundleId->[0]); return '' unless $bundle; + my $uploadsDir = Path::Class::Dir->new($session->config->get('uploadsPath')); + my $uploadsUrl = Path::Class::Dir->new($session->config->get('uploadsURL')); + ##Normal mode if (! $session->var->isAdminOn) { - my $dir = $bundle->getPathClassDir; + my $dir = $bundle->getPathClassDir->relative($uploadsDir); if ($type eq 'js' || $type eq 'javascript') { - my $file = $dir->file($bundle->bundleUrl . '.js'); - return sprintf qq|