diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a56e9e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/has-color-0.1.7.tgz diff --git a/.rh-nodejs4-nodejs-has-color.metadata b/.rh-nodejs4-nodejs-has-color.metadata new file mode 100644 index 0000000..8a1e0f4 --- /dev/null +++ b/.rh-nodejs4-nodejs-has-color.metadata @@ -0,0 +1 @@ +67144a5260c34fc3cca677d041daf52fe7b78b2f SOURCES/has-color-0.1.7.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..c9b44cb --- /dev/null +++ b/SOURCES/LICENSE @@ -0,0 +1,18 @@ +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..d0934a5 --- /dev/null +++ b/SOURCES/test.js @@ -0,0 +1,31 @@ +'use strict'; +var assert = require('assert'); + +beforeEach(function () { + // clear the cache of the tested module + delete require.cache[require.resolve('./index')]; + process.stdout.isTTY = true; + process.argv = []; + process.env = {}; +}); + +it('should return false if not TTY', function () { + process.stdout.isTTY = false; + assert.equal(require('./index'), false); +}); + +it('should return false if --no-color flag is used', function () { + process.argv = ['--no-color']; + assert.equal(require('./index'), false); +}); + +it('should return true if --color flag is used', function () { + process.argv = ['--color']; + assert.equal(require('./index'), true); +}); + +it('should return true if `COLORTERM` is in env', function () { + process.env.COLORTERM = true; + assert.equal(require('./index'), true); +}); + diff --git a/SPECS/nodejs-has-color.spec b/SPECS/nodejs-has-color.spec new file mode 100644 index 0000000..b1c2904 --- /dev/null +++ b/SPECS/nodejs-has-color.spec @@ -0,0 +1,80 @@ +%{?scl:%scl_package nodejs-has-color} +%{!?scl:%global pkg_name %{name}} + +%{?nodejs_find_provides_and_requires} + +%global enable_tests 0 + +Name: %{?scl_prefix}nodejs-has-color +Version: 0.1.7 +Release: 5%{?dist} +Summary: Detects whether a terminal supports color +License: MIT +Group: System Environment/Libraries +URL: https://github.com/sindresorhus/has-color +Source0: http://registry.npmjs.org/has-color/-/has-color-%{version}.tgz +Source1: https://raw.githubusercontent.com/sindresorhus/has-color/ab671b1f74846d9fb9caea8dc302603a865be3cc/test.js +# https://github.com/sindresorhus/has-color/pull/4 +Source2: LICENSE + +BuildArch: noarch +%if 0%{?fedora} >= 19 +ExclusiveArch: %{nodejs_arches} noarch +%else +ExclusiveArch: %{ix86} x86_64 %{arm} noarch +%endif + +BuildRequires: %{?scl_prefix}runtime + +%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}/has-color +cp -pr package.json index.js \ + %{buildroot}%{nodejs_sitelib}/has-color + +%nodejs_symlink_deps + + +%if 0%{?enable_tests} + +%check +%nodejs_symlink_deps --check +/usr/bin/mocha +%endif + +%files +%doc LICENSE readme.md +%{nodejs_sitelib}/has-color + +%changelog +* Tue Feb 16 2016 Zuzana Svetlikova - 0.1.7-5 +- Use macro in -runtime dependency + +* Sun Feb 14 2016 Zuzana Svetlikova - 0.1.7-4 +- Rebuilt with updated metapackage + +* Thu Jan 07 2016 Tomas Hrcka - 0.1.7-3 +- Enable scl macros + +* Mon Sep 14 2015 Troy Dawson - 0.1.7-2 +- Disable tests until all dependencies are built + +* Sun Apr 20 2014 Jamie Nguyen - 0.1.7-1 +- update to upstream release 0.1.7 + +* Thu Mar 13 2014 Jamie Nguyen - 0.1.4-1 +- initial package \ No newline at end of file