Пример #1
0
 protected function filter()
 {
     try {
         return Process::coffee(['-cs'], parent::filter());
     } catch (Exceptions\ProcessFailure $e) {
         throw new Exceptions\SyntaxError($this, $e->error);
     }
 }
Пример #2
0
 protected function filter()
 {
     try {
         return preg_replace('`^@charset\\b.*?[\\r\\n]+`', '', Process::lessc(['--line-numbers=comments', '-'], parent::filter()));
     } catch (Exceptions\ProcessFailure $e) {
         throw new Exceptions\SyntaxError($this, $e->error);
     }
 }
Пример #3
0
 protected function compress()
 {
     try {
         return Process::uglifyjs(['-mc', 'warnings=false'], parent::compress());
     } catch (Exceptions\ProcessFailure $e) {
         throw new Exceptions\SyntaxError($this, $e->error);
     }
 }
Пример #4
0
 protected function compress()
 {
     try {
         try {
             return Process::cleancss([], parent::compress());
         } catch (Exceptions\BadInterpreter $e) {
             $args = ['-s', '-f', '-t', '--unix-newlines', '-t', 'compressed', '--scss'];
             return Process::sass($args, parent::compress());
         }
     } catch (Exceptions\ProcessFailure $e) {
         throw new Exceptions\SyntaxError($this, $e->error);
     }
 }
Пример #5
0
 protected function filter()
 {
     $args = ['-fl', '--unix-newlines', '-t', 'expanded', '-E', 'UTF-8'];
     if ($this->extension() === 'scss') {
         $args[] = '--scss';
     }
     $args[] = $this->absolutePath();
     try {
         return preg_replace('`^@charset\\b.*?[\\r\\n]+`', '', Process::sass($args));
     } catch (Exceptions\ProcessFailure $e) {
         throw new Exceptions\SyntaxError($this, $e->error);
     }
 }
Пример #6
0
 public function setUp()
 {
     parent::setUp();
     Fusion\Process::$paths = [];
     Fusion::clearPool();
 }
Пример #7
0
 /**
  * @dataProvider processors
  */
 public function testBadProcessors($bin)
 {
     Fusion\Process::$paths = [$bin => './asdfghjkl'];
     $this->setExpectedException('Hx\\Fusion\\Exceptions\\BadInterpreter');
     Fusion::file(__DIR__ . "/fixtures/bad/bad.{$bin}")->filtered();
 }