diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c567208 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/ansi-styles-2.1.0.tgz diff --git a/.rh-nodejs4-nodejs-ansi-styles.metadata b/.rh-nodejs4-nodejs-ansi-styles.metadata new file mode 100644 index 0000000..450a625 --- /dev/null +++ b/.rh-nodejs4-nodejs-ansi-styles.metadata @@ -0,0 +1 @@ +990f747146927b559a932bf92959163d60c0d0e2 SOURCES/ansi-styles-2.1.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/test.js b/SOURCES/test.js new file mode 100644 index 0000000..d2af353 --- /dev/null +++ b/SOURCES/test.js @@ -0,0 +1,27 @@ +/*global describe */ +'use strict'; +var assert = require('assert'); +var ansi = require('./ansi-styles'); + +// generates the screenshot +Object.keys(ansi).forEach(function (el) { + var style = ansi[el].open; + + if (el === 'reset') { + return; + } + + if (/^bg[^B]/.test(el)) { + style = ansi.black.open + style; + } + + process.stdout.write(style + el + ansi.reset.open + ansi.reset.close + ' '); +}); + +describe('ansiStyles()', function () { + it('should return ANSI escape codes', function () { + assert.equal(ansi.green.open, '\x1b[32m'); + assert.equal(ansi.bgGreen.open, '\x1b[42m'); + assert.equal(ansi.green.close, '\x1b[39m'); + }); +}); diff --git a/SPECS/nodejs-ansi-styles.spec b/SPECS/nodejs-ansi-styles.spec new file mode 100644 index 0000000..101955a --- /dev/null +++ b/SPECS/nodejs-ansi-styles.spec @@ -0,0 +1,75 @@ +%{?scl:%scl_package nodejs-ansi-styles} +%{!?scl:%global pkg_name %{name}} + +%{?nodejs_find_provides_and_requires} + +%global enable_tests 0 + +Name: %{?scl_prefix}nodejs-ansi-styles +Version: 2.1.0 +Release: 4%{?dist} +Summary: ANSI escape codes for colorizing strings in the terminal +License: MIT +Group: System Environment/Libraries +URL: https://github.com/sindresorhus/ansi-styles +Source0: http://registry.npmjs.org/ansi-styles/-/ansi-styles-%{version}.tgz +Source1: https://raw.github.com/sindresorhus/ansi-styles/5a854731252e453322e68b564f9a89a389c6651d/test.js + +BuildArch: noarch +%if 0%{?fedora} >= 19 +ExclusiveArch: %{nodejs_arches} noarch +%else +ExclusiveArch: %{ix86} x86_64 %{arm} noarch +%endif + +BuildRequires: rh-nodejs4-runtime + +%if 0%{?enable_tests} +BuildRequires: %{?scl_prefix}npm(mocha) +%endif + +%description +%{summary}. + +%prep +%setup -q -n package +cp -p %{SOURCE1} . + +%build +#nothing to do + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/ansi-styles +cp -pr package.json index.js \ + %{buildroot}%{nodejs_sitelib}/ansi-styles + +%nodejs_symlink_deps + + +%if 0%{?enable_tests} + +%check +%nodejs_symlink_deps --check +/usr/bin/mocha +%endif + +%files +%doc license readme.md +%{nodejs_sitelib}/ansi-styles + +%changelog +* Sun Feb 14 2016 Zuzana Svetlikova - 2.1.0-4 +- Use macro in -runtime dependency + +* Sun Feb 14 2016 Zuzana Svetlikova - 2.1.0-3 +- rebuilt + +* Thu Jan 07 2016 Tomas Hrcka - 2.1.0-2 +- Enable scl macros + +* Mon Sep 14 2015 Troy Dawson - 2.1.0-4 +- UPdate to 2.1.0 +- Remove tests until all dependencies are built + +* Thu Mar 13 2014 Jamie Nguyen - 1.0.0-1 +- initial package