From 5c09bafb9b5de98db7a0d48d6ac2a825002cb67b Mon Sep 17 00:00:00 2001 From: Jared K. Smith Date: Feb 18 2016 14:33:23 +0000 Subject: Initial packaging --- diff --git a/.gitignore b/.gitignore index e69de29..00a700e 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/is-observable-0.1.0.tgz diff --git a/nodejs-is-observable.spec b/nodejs-is-observable.spec new file mode 100644 index 0000000..96a17aa --- /dev/null +++ b/nodejs-is-observable.spec @@ -0,0 +1,73 @@ +%{?nodejs_find_provides_and_requires} + +%global packagename is-observable +%global enable_tests 0 +# tests disabled due to missing npm(ava) test suite + +Name: nodejs-is-observable +Version: 0.1.0 +Release: 1%{?dist} +Summary: Check if a value is an Observable + +License: MIT +URL: https://github.com/sindresorhus/is-observable +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/is-observable/v0.1.0/test.js + + + +BuildArch: noarch +%if 0%{?fedora} >= 19 +ExclusiveArch: %{nodejs_arches} noarch +%else +ExclusiveArch: %{ix86} x86_64 %{arm} noarch +%endif + +BuildRequires: nodejs-packaging +BuildRequires: npm(symbol-observable) +%if 0%{?enable_tests} +BuildRequires: npm(ava) +%endif + +%description +Check if a value is an Observable + + +%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 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 +%{!?_licensedir:%global license %doc} +%doc *.md +%license license +%{nodejs_sitelib}/%{packagename} + + +%changelog +* Mon Feb 15 2016 Jared Smith - 0.1.0-1 +- Initial packaging diff --git a/sources b/sources index e69de29..71c36eb 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +0ac6e847855eb705117798575c6b0ce8 is-observable-0.1.0.tgz diff --git a/test.js b/test.js new file mode 100644 index 0000000..c330301 --- /dev/null +++ b/test.js @@ -0,0 +1,14 @@ +import test from 'ava'; +import zenObservable from 'zen-observable'; +import fn from './'; + +// for `zen-observable` on Node.js 0.10 +global.Promise = Promise; + +test(t => { + t.true(fn(zenObservable.of(1, 2))); + t.false(fn(null)); + t.false(fn({foo: true})); + t.false(fn(function () {})); + t.end(); +});