From 0ec2a985ceac8a0a798a16a54010427af338c2db Mon Sep 17 00:00:00 2001 From: Jared K. Smith Date: Dec 15 2015 15:28:10 +0000 Subject: Initial packaging --- diff --git a/.gitignore b/.gitignore index e69de29..7692d95 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/has-ansi-2.0.0.tgz +/test.js diff --git a/nodejs-has-ansi.spec b/nodejs-has-ansi.spec new file mode 100644 index 0000000..c3af5d9 --- /dev/null +++ b/nodejs-has-ansi.spec @@ -0,0 +1,65 @@ +%{?nodejs_find_provides_and_requires} + +%global packagename has-ansi +%global enable_tests 0 +# Tests disabled due to missing nodejs-ava package dependency + +Name: nodejs-has-ansi +Version: 2.0.0 +Release: 1%{?dist} +Summary: Check if a string has ANSI escape codes + +License: MIT +URL: https://github.com/sindresorhus/has-ansi +Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz +# The test files are not included in the npm tarball. +Source1: https://raw.githubusercontent.com/chalk/has-ansi/0722275e1bef139fcd09137da6e5550c3cd368b9/test.js + +ExclusiveArch: %{nodejs_arches} noarch +BuildArch: noarch + +BuildRequires: nodejs-packaging +%if 0%{?enable_tests} +BuildRequires: npm(ava) +%endif + +%description +Check if a string has ANSI escape codes + + +%prep +%setup -q -n package +# setup the tests +cp -p %{SOURCE1} . + + + +%build +# nothing to do! + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} +cp -pr package.json *.js \ + %{buildroot}%{nodejs_sitelib}/%{packagename} + +%nodejs_symlink_deps + +%if 0%{?enable_tests} +%check +%nodejs_symlink_deps --check +%{__nodejs} -e 'require("./")' +%{__nodejs} test.js +%endif + + +%files +%{!?_licensedir:%global license %doc} +%doc *.md +%license license +%{nodejs_sitelib}/%{packagename} + + + +%changelog +* Thu Oct 22 2015 Jared Smith - 2.0.0-1 +- Initial packaging diff --git a/sources b/sources index e69de29..ffcb74d 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +6c5e87ad63e866b41fc47eaddd3174b0 has-ansi-2.0.0.tgz +81a4fbc9da5103c1b2bb69709621483a test.js diff --git a/test.js b/test.js new file mode 100644 index 0000000..a56ef2e --- /dev/null +++ b/test.js @@ -0,0 +1,11 @@ +'use strict'; +var test = require('ava'); +var pathExists = require('path-exists'); +var osHomedir = require('./'); + +test(function (t) { + var homeDir = osHomedir(); + t.assert(homeDir.length > 0); + t.assert(pathExists.sync(homeDir)); + t.end(); +});