From 8b602a455d6c95598536b7eff1694f73c85007cd Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Dec 15 2015 09:16:09 +0000 Subject: Update npm(lodash) dependency and enable tests --- diff --git a/nodejs-globule-lodash3.patch b/nodejs-globule-lodash3.patch new file mode 100644 index 0000000..be6364d --- /dev/null +++ b/nodejs-globule-lodash3.patch @@ -0,0 +1,54 @@ +From eb00aa591172c473835ff73285680e7422956257 Mon Sep 17 00:00:00 2001 +From: Anton Harniakou +Date: Wed, 25 Nov 2015 18:25:17 +0300 +Subject: [PATCH] Use lodash v3 + +There are some breaking changes in lodash v3, +such as flatten has become shallow. +This commit takes that into account and replaces _.flatten with +_.flattenDeep. +--- + lib/globule.js | 8 ++++---- + package.json | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/lib/globule.js b/lib/globule.js +index 5a3eeac..7c6328e 100644 +--- a/lib/globule.js ++++ b/lib/globule.js +@@ -46,8 +46,8 @@ globule.match = function(patterns, filepaths, options) { + // Return empty set if either patterns or filepaths was omitted. + if (patterns == null || filepaths == null) { return []; } + // Normalize patterns and filepaths to flattened arrays. +- patterns = _.isArray(patterns) ? _.flatten(patterns) : [patterns]; +- filepaths = _.isArray(filepaths) ? _.flatten(filepaths) : [filepaths]; ++ patterns = _.isArray(patterns) ? _.flattenDeep(patterns) : [patterns]; ++ filepaths = _.isArray(filepaths) ? _.flattenDeep(filepaths) : [filepaths]; + // Return empty set if there are no patterns or filepaths. + if (patterns.length === 0 || filepaths.length === 0) { return []; } + // Return all matching filepaths. +@@ -71,9 +71,9 @@ globule.find = function() { + // arguments. Flatten nested arrays. + var patterns; + if (options.src) { +- patterns = _.isArray(options.src) ? _.flatten(options.src) : [options.src]; ++ patterns = _.isArray(options.src) ? _.flattenDeep(options.src) : [options.src]; + } else { +- patterns = _.flatten(args); ++ patterns = _.flattenDeep(args); + } + // Return empty set if there are no patterns. + if (patterns.length === 0) { return []; } +diff --git a/package.json b/package.json +index e040dc3..cfdfb57 100644 +--- a/package.json ++++ b/package.json +@@ -45,7 +45,7 @@ + "awesome" + ], + "dependencies": { +- "lodash": "~2.4.1", ++ "lodash": "~3.10.1", + "glob": "~3.2.7", + "minimatch": "~0.2.11" + } diff --git a/nodejs-globule.spec b/nodejs-globule.spec index b8093c4..5898987 100644 --- a/nodejs-globule.spec +++ b/nodejs-globule.spec @@ -1,15 +1,17 @@ %{?nodejs_find_provides_and_requires} -%global enable_tests 0 +%global enable_tests 1 Name: nodejs-globule Version: 0.2.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: An easy-to-use wildcard globbing library for Node.js License: MIT Group: System Environment/Libraries URL: https://github.com/cowboy/node-globule -Source0: http://registry.npmjs.org/globule/-/globule-%{version}.tgz +Source0: https://registry.npmjs.org/globule/-/globule-%{version}.tgz +# https://github.com/cowboy/node-globule/pull/22 +Patch0: nodejs-globule-lodash3.patch BuildArch: noarch %if 0%{?fedora} >= 19 @@ -21,12 +23,9 @@ ExclusiveArch: %{ix86} x86_64 %{arm} noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} -BuildRequires: npm(grunt-cli) -BuildRequires: npm(grunt-contrib-nodeunit) -BuildRequires: npm(grunt-contrib-watch) +BuildRequires: npm(nodeunit) BuildRequires: npm(glob) BuildRequires: npm(lodash) -BuildRequires: npm(nodeunit) %endif %description @@ -34,9 +33,8 @@ BuildRequires: npm(nodeunit) %prep -%setup -q -n package -%nodejs_fixdep lodash '~2.4.1' -%nodejs_fixdep glob '~3.2.6' +%autosetup -p 1 -n package +%nodejs_fixdep glob "^3.2.6" %build @@ -59,11 +57,16 @@ cp -pr package.json lib/ \ %files -%doc LICENSE-MIT README.md +%doc README.md +%license LICENSE-MIT %{nodejs_sitelib}/globule %changelog +* Tue Dec 15 2015 Tom Hughes - 0.2.0-4 +- Update npm(lodash) dependency +- Enable tests + * Wed Jun 17 2015 Fedora Release Engineering - 0.2.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild