Skip to content

Commit

Permalink
Updating paths in ProjectTask and PluginTask to reflect changed dirs.
Browse files Browse the repository at this point in the history
Updating tests.
  • Loading branch information
markstory committed Jul 26, 2009
1 parent b4f4aee commit 478e902
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cake/console/libs/tasks/plugin.php
Expand Up @@ -60,8 +60,8 @@ function initialize() {
function execute() {
if (empty($this->params['skel'])) {
$this->params['skel'] = '';
if (is_dir(CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel') === true) {
$this->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel';
if (is_dir(CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel') === true) {
$this->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel';
}
}
$plugin = null;
Expand Down
8 changes: 4 additions & 4 deletions cake/console/libs/tasks/project.php
Expand Up @@ -57,8 +57,8 @@ function execute($project = null) {

if (empty($this->params['skel'])) {
$this->params['skel'] = '';
if (is_dir(CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'skel') === true) {
$this->params['skel'] = CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'skel';
if (is_dir(CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel') === true) {
$this->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel';
}
}

Expand Down Expand Up @@ -125,7 +125,6 @@ function bake($path, $skel = null, $skip = array('empty')) {
if (!$skel) {
$skel = $this->params['skel'];
}

while (!$skel) {
$skel = $this->in(sprintf(__("What is the path to the directory layout you wish to copy?\nExample: %s"), APP, null, ROOT . DS . 'myapp' . DS));
if ($skel == '') {
Expand Down Expand Up @@ -184,7 +183,8 @@ function bake($path, $skel = null, $skip = array('empty')) {
function createHome($dir) {
$app = basename($dir);
$path = $dir . 'views' . DS . 'pages' . DS;
include(CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'default'.DS.'views'.DS.'home.ctp');
$source = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS .'default' . DS . 'views' . DS . 'home.ctp';
include($source);
return $this->createFile($path.'home.ctp', $output);
}

Expand Down
3 changes: 3 additions & 0 deletions cake/tests/cases/console/libs/tasks/plugin.test.php
Expand Up @@ -211,6 +211,9 @@ function testExecuteWithNoArgs() {

$this->Task->args = array();
$this->Task->execute();

$Folder =& new Folder($path);
$Folder->delete();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions cake/tests/cases/console/libs/tasks/project.test.php
Expand Up @@ -87,7 +87,7 @@ function endTest() {
* @return void
**/
function _setupTestProject() {
$skel = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel';
$skel = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel';
$this->Task->setReturnValueAt(0, 'in', 'y');
$this->Task->setReturnValueAt(1, 'in', 'n');
$this->Task->bake($this->Task->path . 'bake_test_app', $skel);
Expand Down Expand Up @@ -156,7 +156,7 @@ function testGetAdmin() {
* @return void
**/
function testExecute() {
$this->Task->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel';
$this->Task->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CAKE . DS . 'console' . DS. 'templates' . DS . 'skel';
$this->Task->params['working'] = TMP . 'tests' . DS;

$path = $this->Task->path . 'bake_test_app';
Expand Down

0 comments on commit 478e902

Please sign in to comment.