Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Commit

Permalink
Fixed Less @import and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawka committed Dec 30, 2013
1 parent ce9b883 commit cdf85cf
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 37 deletions.
17 changes: 0 additions & 17 deletions Phrozn/Processor/Less.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ class Less
*/
protected $lessc;

/**
* The path where the LESS compiler will search for @import directives
*
* @var string
*/
protected $lessImportDir;

/**
* If configuration options are passes then twig environment
* is initialized right away
Expand All @@ -61,16 +54,6 @@ public function __construct($options = array())
}
}

/**
* Store the input file if given
*
* @param $options
*/
public function setLessImportDir($lessImportDir)
{
$this->lessImportDir = $lessImportDir;
}

/**
* Parse the incoming template
*
Expand Down
16 changes: 0 additions & 16 deletions Phrozn/Site/View/Less.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,6 @@ public function setInputFile($path)
return $this;
}

/**
* Set the input file into processors configuration
*
* @param $inputFile
*/
public function setInputFile($inputFile)
{
if (null !== $processors = $this->getProcessors()) {
foreach ($processors as $processor) {
$processor->setLessImportDir(dirname($inputFile));
}
}

return parent::setInputFile($inputFile);
}

/**
* Get output file path
*
Expand Down
2 changes: 1 addition & 1 deletion configs/phrozn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
---
name: Phrozn
summary: Static web-site generator for PHP.
description: &desc Phrozn is extremely flexible static site generator for PHP.
description: &desc Phrozn is an extremely flexible static site generator for PHP.
version: &ver "0.5.6DEV"
stability: beta
author: Victor Farazdagi
Expand Down
6 changes: 4 additions & 2 deletions tests/Phrozn/Processor/LessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ public function testRenderImportLessDirective()
$expectedResult = file_get_contents($this->path . 'tpl1.css');

$processor = new Processor();
$processor->setLessImportDir($this->path);
$processor->setConfig(array(
'phr_template_dir' => $this->path
));

$rendered = $processor->render($tpl);
$this->assertSame($rendered, $expectedResult);
$this->assertSame(trim($rendered), trim($expectedResult));
}

}
1 change: 0 additions & 1 deletion tests/Phrozn/Processor/templates/tpl1.less
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ h2 {
background: @color3;
}
}

0 comments on commit cdf85cf

Please sign in to comment.