added tests_path constant and added tests to bundle publisher.

This commit is contained in:
Taylor Otwell 2012-01-18 09:33:41 -06:00
parent ba1d2a6238
commit 57925465fe
2 changed files with 14 additions and 6 deletions

View File

@ -14,20 +14,23 @@ class Publisher {
*/ */
public function publish($bundle) public function publish($bundle)
{ {
$this->move($bundle, $this->from($bundle), $this->to($bundle)); $path = Bundle::path($bundle);
echo "Assets published for bundle [$bundle].".PHP_EOL; $this->move($path.'public', PUBLIC_PATH.'bundles'.DS.$bundle);
$this->move($path.'tests', TESTS_PATH.'cases'.DS.'bundles'.DS.$bundle);
echo "Assets and tests published for bundle [$bundle].".PHP_EOL;
} }
/** /**
* Copy the contents of a bundle's assets to the public folder. * Copy the contents of a bundle's assets to the public folder.
* *
* @param string $bundle
* @param string $source * @param string $source
* @param string $destination * @param string $destination
* @return void * @return void
*/ */
protected function move($bundle, $source, $destination) protected function move($source, $destination)
{ {
File::copy_dir($source, $destination); File::copy_dir($source, $destination);
} }

View File

@ -23,6 +23,11 @@
// -------------------------------------------------------------- // --------------------------------------------------------------
$paths['APP_PATH'] = 'application'; $paths['APP_PATH'] = 'application';
// --------------------------------------------------------------
// The path to the Laravel directory.
// --------------------------------------------------------------
$paths['SYS_PATH'] = 'laravel';
// -------------------------------------------------------------- // --------------------------------------------------------------
// The path to the bundles directory. // The path to the bundles directory.
// -------------------------------------------------------------- // --------------------------------------------------------------
@ -34,9 +39,9 @@
$paths['STORAGE_PATH'] = 'storage'; $paths['STORAGE_PATH'] = 'storage';
// -------------------------------------------------------------- // --------------------------------------------------------------
// The path to the Laravel directory. // The path to the tests directory.
// -------------------------------------------------------------- // --------------------------------------------------------------
$paths['SYS_PATH'] = 'laravel'; $paths['TESTS_PATH'] = 'tests';
// -------------------------------------------------------------- // --------------------------------------------------------------
// The path to the public directory. // The path to the public directory.