diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d1b36b8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/ansi-bggreen-0.1.1.tgz diff --git a/README.md b/README.md deleted file mode 100644 index 68bfe28..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# nodejs-ansi-bggreen - -'The color bggreen, in ansi' \ No newline at end of file diff --git a/nodejs-ansi-bggreen.spec b/nodejs-ansi-bggreen.spec new file mode 100644 index 0000000..21f1dfe --- /dev/null +++ b/nodejs-ansi-bggreen.spec @@ -0,0 +1,62 @@ +%{?nodejs_find_provides_and_requires} + +%global packagename ansi-bggreen +%global enable_tests 1 + +Name: nodejs-ansi-bggreen +Version: 0.1.1 +Release: 1%{?dist} +Summary: The color bggreen, in ansi + +License: MIT +URL: https://github.com/jonschlinkert/ansi-bggreen +Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz +# The test files are not included in the npm tarball. +Source1: https://raw.githubusercontent.com/jonschlinkert/ansi-bggreen/master/test.js + + +ExclusiveArch: %{nodejs_arches} noarch +BuildArch: noarch + +BuildRequires: nodejs-packaging +BuildRequires: npm(ansi-wrap) +%if 0%{?enable_tests} +BuildRequires: mocha +%endif + +%description +The color bggreen, in ansi. + + +%prep +%autosetup -n package +# setup the tests +cp -p %{SOURCE1} . + +%build +# nothing to do! + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} +cp -pr package.json index.js \ + %{buildroot}%{nodejs_sitelib}/%{packagename} + +%nodejs_symlink_deps + +%check +%nodejs_symlink_deps --check +%{__nodejs} -e 'require("./")' +%if 0%{?enable_tests} +%{_bindir}/mocha -R spec +%else +%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" +%endif + +%files +%doc *.md +%license LICENSE +%{nodejs_sitelib}/%{packagename} + +%changelog +* Fri Apr 14 2017 Jared Smith - 0.1.1-1 +- Initial packaging diff --git a/sources b/sources new file mode 100644 index 0000000..389c5b0 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (ansi-bggreen-0.1.1.tgz) = f1346d38a9883cebb18e9925ae48546ea0f636755be16650b888d7ad3f9318a14ace5ecdacbef0b8dbc46a9de578cb769106829e020dd59cdacd26c937317e03 diff --git a/test.js b/test.js new file mode 100644 index 0000000..bb9c37e --- /dev/null +++ b/test.js @@ -0,0 +1,11 @@ +'use strict'; + +/* deps: mocha */ +var assert = require('assert'); +var bggreen = require('./'); + +describe('bggreen', function () { + it('should wrap a string with ansi styling:', function () { + assert.equal(bggreen('string'), '\u001b[42mstring\u001b[49m'); + }); +});