From 6fbd028447cdbb0fd581bab5d6089a35ade8e17b Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 13 Jan 2015 17:18:51 +0100 Subject: php-PHP-CSS-Parser: 6.0.0 --- php-PHP-CSS-Parser-git.patch | 84 -------------------------------------------- php-PHP-CSS-Parser.spec | 18 +++++++--- 2 files changed, 13 insertions(+), 89 deletions(-) delete mode 100644 php-PHP-CSS-Parser-git.patch diff --git a/php-PHP-CSS-Parser-git.patch b/php-PHP-CSS-Parser-git.patch deleted file mode 100644 index ae6b02c..0000000 --- a/php-PHP-CSS-Parser-git.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 21ac4d9fb408f803aac180503c41f3e4648f575f Mon Sep 17 00:00:00 2001 -From: Paul Annekov -Date: Tue, 29 Oct 2013 23:44:25 +0200 -Subject: [PATCH] Fixed comments parsing and test added - ---- - lib/Sabberworm/CSS/Parser.php | 9 +++++---- - tests/Sabberworm/CSS/ParserTest.php | 8 ++++++++ - tests/files/comments.css | 16 ++++++++++++++++ - 3 files changed, 29 insertions(+), 4 deletions(-) - create mode 100644 tests/files/comments.css - -diff --git a/lib/Sabberworm/CSS/Parser.php b/lib/Sabberworm/CSS/Parser.php -index 7a64074..4445322 100644 ---- a/lib/Sabberworm/CSS/Parser.php -+++ b/lib/Sabberworm/CSS/Parser.php -@@ -546,10 +546,10 @@ private function consumeWhiteSpace() { - - private function consumeComment() { - if ($this->comes('/*')) { -- $this->consume(2); -- while ($this->consumeUntil('*', false, true)) { -- if ($this->comes('/')) { -- $this->consume(1); -+ $this->consume(1); -+ while ($this->consume(1) !== '') { -+ if ($this->comes('*/')) { -+ $this->consume(2); - return true; - } - } -@@ -567,6 +567,7 @@ private function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false) - $start = $this->iCurrentPosition; - - while (($char = $this->consume(1)) !== '') { -+ $this->consumeComment(); - if (in_array($char, $aEnd)) { - if ($bIncludeEnd) { - $out .= $char; -diff --git a/tests/Sabberworm/CSS/ParserTest.php b/tests/Sabberworm/CSS/ParserTest.php -index 3b38770..aaf11a6 100644 ---- a/tests/Sabberworm/CSS/ParserTest.php -+++ b/tests/Sabberworm/CSS/ParserTest.php -@@ -343,6 +343,14 @@ function testListValueRemoval() { - }#unrelated {other: yes;}' . "\n", $oDoc->__toString()); - } - -+ function testComments() { -+ $oDoc = $this->parsedStructureForFile('comments'); -+ $sExpected = '@import url("some/url.css") screen;.foo, #bar {background-color: #000;} -+@media screen {#foo.bar {position: absolute;} -+}'; -+ $this->assertSame($sExpected, $oDoc->__toString()); -+ } -+ - function parsedStructureForFile($sFileName) { - $sFile = dirname(__FILE__) . '/../../files' . DIRECTORY_SEPARATOR . "$sFileName.css"; - $oParser = new Parser(file_get_contents($sFile)); -diff --git a/tests/files/comments.css b/tests/files/comments.css -new file mode 100644 -index 0000000..d30bc53 ---- /dev/null -+++ b/tests/files/comments.css -@@ -0,0 +1,16 @@ -+/** -+ * Comments Hell. -+ */ -+@import /* Number 1 */"some/url.css"/* Number 2 */ screen/* Number 3 */; -+ -+.foo, /* Number 4 */ #bar/* Number 5 */ { -+ background-color/* Number 6 */: #000/* Number 7 */; -+} -+ -+@media /* Number 8 */screen /* Number 9 */{ -+ /** Number 10 **/ -+ #foo.bar { -+ position: absolute;/**/ -+ } -+} -+/** Number 11 **/ -\ No newline at end of file --- -1.8.5.1 - diff --git a/php-PHP-CSS-Parser.spec b/php-PHP-CSS-Parser.spec index a275ff5..abaec1c 100644 --- a/php-PHP-CSS-Parser.spec +++ b/php-PHP-CSS-Parser.spec @@ -6,31 +6,35 @@ # # Please, preserve the changelog entries # -%global gh_commit 4c4ab985e372113dbfd0a8192fbd8629bface9bb +# 6.0.0 + 5 commits, 1 for php 5.3 fix (needed in EPEL-6) +%global gh_commit eb29754d1f82288911ca38dc52d62e307275288d %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner sabberworm %global gh_project PHP-CSS-Parser Name: php-%{gh_project} Summary: A Parser for CSS Files -Version: 5.1.2 -Release: 1%{?dist} +Version: 6.0.0 +Release: 1.20141009git%{gh_short}%{?dist} License: MIT Group: Development/Libraries URL: https://github.com/%{gh_owner}/%{gh_project} -Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}.tar.gz +Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}%{?gh_short:-%{gh_short}}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch # For tests -BuildRequires: php-pear(pear.phpunit.de/PHPUnit) +BuildRequires: %{_bindir}/phpunit +# From phpcompatinfo for version 6.0.0 Requires: php-iconv Requires: php-mbstring Requires: php-pcre Requires: php-spl +Provides: php-composer(sabberworm/php-css-parser) = %{version} + %description PHP CSS Parser: a Parser for CSS Files written in PHP. @@ -64,6 +68,10 @@ phpunit --bootstrap bootstrap.php . %changelog +* Tue Jan 13 2015 Remi Collet - 6.0.0-1.20141009giteb29754 +- update to 6.0.0 + fix for PHP 5.3 +- add provides php-composer(sabberworm/php-css-parser) + * Mon Apr 28 2014 Remi Collet - 5.1.2-1 - update to 5.1.2 -- cgit