diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..19ab35b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/strip-ansi-0.2.0.tgz diff --git a/.nodejs010-nodejs-strip-ansi.metadata b/.nodejs010-nodejs-strip-ansi.metadata new file mode 100644 index 0000000..3ee676c --- /dev/null +++ b/.nodejs010-nodejs-strip-ansi.metadata @@ -0,0 +1 @@ +e987d2c9128aadd85b9b9bfda7d09d9751e5e53a SOURCES/strip-ansi-0.2.0.tgz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/LICENSE b/SOURCES/LICENSE new file mode 100644 index 0000000..daedfcd --- /dev/null +++ b/SOURCES/LICENSE @@ -0,0 +1,17 @@ +The MIT License (MIT) +Copyright (c) Sindre Sorhus (sindresorhus.com) +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/SOURCES/test.js b/SOURCES/test.js new file mode 100644 index 0000000..8168adf --- /dev/null +++ b/SOURCES/test.js @@ -0,0 +1,19 @@ +'use strict'; +var assert = require('assert'); +var exec = require('child_process').exec; +var strip = require('./index'); + +it('should strip color from string', function () { + assert.equal(strip('\x1b[0m\x1b[4m\x1b[42m\x1b[31mfoo\x1b[39m\x1b[49m\x1b[24mfoo\x1b[0m'), 'foofoo'); +}); + +it('should strip reset;setfg;setbg;italics;strike;underline sequence from string', function () { + assert.equal(strip('\x1b[0;33;49;3;9;4mbar\x1b[0m'), 'bar'); +}); + +it('should strip color with CLI', function (done) { + exec('echo "\x1b[0m\x1b[4m\x1b[42m\x1b[31mfoo\x1b[39m\x1b[49m\x1b[24mfoo\x1b[0m" | ./cli.js', function (err, stdout) { + assert.equal(stdout, 'foofoo\n'); + done(); + }); +}); diff --git a/SPECS/nodejs-strip-ansi.spec b/SPECS/nodejs-strip-ansi.spec new file mode 100644 index 0000000..66b05f6 --- /dev/null +++ b/SPECS/nodejs-strip-ansi.spec @@ -0,0 +1,80 @@ +%{?scl:%scl_package nodejs-strip-ansi} +%{!?scl:%global pkg_name %{name}} + +%{?nodejs_find_provides_and_requires} + +%global enable_tests 0 + +Name: %{?scl_prefix}nodejs-strip-ansi +Version: 0.2.0 +Release: 1%{?dist} +Summary: Strip ANSI escape codes (used for colorizing strings in the terminal) +License: MIT +Group: System Environment/Libraries +URL: https://github.com/sindresorhus/strip-ansi +Source0: http://registry.npmjs.org/strip-ansi/-/strip-ansi-%{version}.tgz +Source1: https://raw.githubusercontent.com/sindresorhus/strip-ansi/3c9b37e5381603925ba16b27a05ccbfd338906b8/test.js +# https://github.com/sindresorhus/strip-ansi/pull/1 +Source2: LICENSE + +BuildArch: noarch +%if 0%{?fedora} >= 19 +ExclusiveArch: %{nodejs_arches} noarch +%else +ExclusiveArch: %{ix86} x86_64 %{arm} noarch +%endif + +BuildRequires: nodejs010 + +%if 0%{?enable_tests} +BuildRequires: %{?scl_prefix}npm(mocha) +%endif + +%description +%{summary}. + +%prep +%setup -q -n package +cp -p %{SOURCE1} . +cp -p %{SOURCE2} . + +%build +#nothing to do + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/strip-ansi +cp -pr package.json cli.js index.js \ + %{buildroot}%{nodejs_sitelib}/strip-ansi + +# `strip-ansi` is used as the command. +mkdir -p %{buildroot}%{_bindir} +ln -sf %{nodejs_sitelib}/strip-ansi/cli.js \ + %{buildroot}%{_bindir}/strip-ansi + +%nodejs_symlink_deps + + +%if 0%{?enable_tests} + +%check +%nodejs_symlink_deps --check +/usr/bin/mocha +%endif + +%files +%doc LICENSE readme.md +%{nodejs_sitelib}/strip-ansi +%{_bindir}/strip-ansi + +%changelog +* Fri Jan 09 2015 Tomas Hrcka - 0.2.0-1 +- Enable software collections support + +* Sat Jun 07 2014 Fedora Release Engineering - 0.2.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sun Apr 20 2014 Jamie Nguyen - 0.2.0-1 +- update to upstream release 0.2.0 + +* Thu Mar 13 2014 Jamie Nguyen - 0.1.1-1 +- initial package