From fdd08a5f6288f4f39d655ae3e242b7ca37fb5858 Mon Sep 17 00:00:00 2001 From: Jared K. Smith Date: Jul 16 2016 05:48:32 +0000 Subject: Update to upstream 2.0.0 release --- diff --git a/.gitignore b/.gitignore index 7694edc..c526652 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /strip-indent-addcf90.tar.gz +/strip-indent-2.0.0.tgz diff --git a/nodejs-strip-indent.spec b/nodejs-strip-indent.spec index 8d8d696..5bc84df 100644 --- a/nodejs-strip-indent.spec +++ b/nodejs-strip-indent.spec @@ -1,33 +1,37 @@ -%global enable_tests 1 %global srcname strip-indent - -%global commit0 addcf90a56001ea122e9f1254987016bc87e5b5f -%global gittag0 v1.0.1 -%global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) +# tests disabled due to missing npm(ava) +%global enable_tests 0 Name: nodejs-%{srcname} -Version: 1.0.1 -Release: 3%{?dist} +Version: 2.0.0 +Release: 1%{?dist} Summary: Strip leading whitespace from every line in a string License: MIT URL: https://github.com/sindresorhus/strip-indent -Source0: https://github.com/sindresorhus/%{srcname}/archive/%{commit0}.tar.gz#/%{srcname}-%{shortcommit0}.tar.gz +Source0: https://registry.npmjs.com/%{srcname}/-/%{srcname}-%{version}.tgz +# tests are not included in the tarball +Source1: https://raw.githubusercontent.com/sindresorhus/%{srcname}/v%{version}/test.js BuildArch: noarch -ExclusiveArch: %{nodejs_arches} noarch +%if 0%{?fedora} >= 19 +ExclusiveArch: %{nodejs_arches} noarch +%else +ExclusiveArch: %{ix86} x86_64 %{arm} noarch +%endif BuildRequires: nodejs-packaging %if 0%{?enable_tests} -BuildRequires: npm(mocha) +BuildRequires: npm(ava) %endif %description %{summary}. %prep -%setup -qn %{srcname}-%{commit0} +%setup -n package rm -rf node_modules + %nodejs_fixdep get-stdin '5.x' %build @@ -35,7 +39,7 @@ rm -rf node_modules %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{srcname} -cp -pr package.json index.js cli.js \ +cp -pr package.json index.js \ %{buildroot}%{nodejs_sitelib}/%{srcname} mkdir -p %{buildroot}%{_bindir} @@ -47,16 +51,22 @@ ln -s %{nodejs_sitelib}/%{srcname}/cli.js %{buildroot}%{_bindir}/strip-indent %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} -mocha +%{_bindir}/ava +%else +%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files +%{!?_licensedir:%global license %doc} %doc readme.md %license license %{nodejs_sitelib}/%{srcname} %{_bindir}/%{srcname} %changelog +* Sat Jul 16 2016 Jared Smith - 2.0.0-1 +- Update to upstream 2.0.0 release + * Thu Feb 04 2016 Fedora Release Engineering - 1.0.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/sources b/sources index bc186a6..53d9e5e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b6b2b7bc4ae07d4375ca5bcbcd1348bd strip-indent-addcf90.tar.gz +30525df21ec48303b67241723d693781 strip-indent-2.0.0.tgz diff --git a/test.js b/test.js new file mode 100644 index 0000000..40cbc04 --- /dev/null +++ b/test.js @@ -0,0 +1,9 @@ +import test from 'ava'; +import m from './'; + +test(t => { + t.is(m('\nunicorn\n'), '\nunicorn\n'); + t.is(m('\n unicorn\n'), '\nunicorn\n'); + t.is(m('\t\t\n\t\t\n\t\t\t\n\n\n\n\t\t\t\t

Hello world!

\n\t\t\t\n\t\t'), '\n\n\t\n\n\n\n\t\t

Hello world!

\n\t\n'); + t.is(m('\n\t\n\t\tunicorn\n\n\n\n\t\t\tunicorn'), '\n\t\nunicorn\n\n\n\n\tunicorn', 'ignore whitespace only lines'); +});