Esempio n. 1
0
 /**
  * Parses specified directories for KSS Comments and adds any valid KSS Sections
  * found.
  *
  * @param string|array $paths A string or array of the paths to scan for KSS
  *                            Comments
  */
 public function __construct($paths)
 {
     $finder = new Finder();
     // Only accept css, sass, scss, less, and stylus files.
     $finder->files()->name('/\\.(css|sass|scss|less|styl(?:us)?)$/')->in($paths);
     foreach ($finder as $fileInfo) {
         $file = new \splFileObject($fileInfo);
         $commentParser = new CommentParser($file);
         foreach ($commentParser->getBlocks() as $commentBlock) {
             if (self::isKssBlock($commentBlock)) {
                 $this->addSection($commentBlock, $file);
             }
         }
     }
 }
Esempio n. 2
0
 /**
  * @test
  */
 public function parseMultiLineComment()
 {
     $this->assertEquals(' yes', \Kss\CommentParser::parseMultiLineComment('/* yes */'));
 }