public function getEnvironmentPaths($project)
{
$baseDir = $this->getEnvironmentDir() . '/' . $project;
$paths = array();
if (!file_exists($baseDir)) {
throw new Exception('Environment directory ' . $baseDir . ' doesn\'t exist. Create it first.');
}
// Search the directory for config files.
foreach (scandir($baseDir) as $environmentFile) {
if (preg_match('/\\.rb$/', $environmentFile)) {
// Config found, wrap it into an object.
$paths[] = "{$baseDir}/{$environmentFile}";
}
}
sort($paths);
return array_values($paths);
}