From 2894cc859a56756886fcb1ee0bdcb9cf5fe19fd6 Mon Sep 17 00:00:00 2001 From: Jared K. Smith Date: May 05 2017 11:13:29 +0000 Subject: Initial packaging --- diff --git a/.gitignore b/.gitignore index e69de29..ecba793 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/arr-exclude-1.0.0.tgz diff --git a/nodejs-arr-exclude.spec b/nodejs-arr-exclude.spec new file mode 100644 index 0000000..c3ed6ad --- /dev/null +++ b/nodejs-arr-exclude.spec @@ -0,0 +1,62 @@ +%{?nodejs_find_provides_and_requires} + +%global packagename arr-exclude + +# tests missing due to missing npm(ava) +%global enable_tests 0 + +Name: nodejs-arr-exclude +Version: 1.0.0 +Release: 1%{?dist} +Summary: Exclude certain items from an array + +License: MIT +URL: https://github.com/sindresorhus/arr-exclude +Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz +# The test files are not included in the npm tarball. +Source1: https://raw.githubusercontent.com/sindresorhus/arr-exclude/v%{version}/test.js + +ExclusiveArch: %{nodejs_arches} noarch +BuildArch: noarch + +BuildRequires: nodejs-packaging +%if 0%{?enable_tests} +BuildRequires: npm(ava) +%endif + +%description +Exclude certain items from an array + + +%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}/ava +%else +%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" +%endif + +%files +%doc readme.md +%license license +%{nodejs_sitelib}/%{packagename} + +%changelog +* Thu Apr 20 2017 Jared Smith - 1.0.0-1 +- Initial packaging diff --git a/sources b/sources index e69de29..88bb14a 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +SHA512 (arr-exclude-1.0.0.tgz) = 4e25db30c90f40d7e81dc562ea3794e887a3180165727d216205557bbb428aa2ff66dc5b36484348c6ab5108e0fcf01ef4d40dbd177a60254dbadce8dc5c5dba diff --git a/test.js b/test.js new file mode 100644 index 0000000..3af67c9 --- /dev/null +++ b/test.js @@ -0,0 +1,9 @@ +'use strict'; +var test = require('ava'); +var fn = require('./'); + +test(function (t) { + t.same(fn(['a', 'b', 'c'], ['b']), ['a', 'c']); + t.same(fn(null, ['a']), []); + t.end(); +});