protected function filter() { try { return Process::coffee(['-cs'], parent::filter()); } catch (Exceptions\ProcessFailure $e) { throw new Exceptions\SyntaxError($this, $e->error); } }
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); } }
protected function compress() { try { return Process::uglifyjs(['-mc', 'warnings=false'], parent::compress()); } catch (Exceptions\ProcessFailure $e) { throw new Exceptions\SyntaxError($this, $e->error); } }
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); } }
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); } }
public function setUp() { parent::setUp(); Fusion\Process::$paths = []; Fusion::clearPool(); }
/** * @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(); }