diff --git a/.gitignore b/.gitignore index e69de29..76a4243 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/multimatch-0.1.0.tgz diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c9b44cb --- /dev/null +++ b/LICENSE @@ -0,0 +1,18 @@ +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/nodejs-multimatch.spec b/nodejs-multimatch.spec new file mode 100644 index 0000000..beba245 --- /dev/null +++ b/nodejs-multimatch.spec @@ -0,0 +1,71 @@ +%{?nodejs_find_provides_and_requires} + +%global enable_tests 1 + +Name: nodejs-multimatch +Version: 0.1.0 +Release: 1%{?dist} +Summary: Adds multiple patterns support to minimatch.match() +License: MIT +Group: System Environment/Libraries +URL: https://github.com/sindresorhus/multimatch +Source0: http://registry.npmjs.org/multimatch/-/multimatch-%{version}.tgz +# https://raw.githubusercontent.com/sindresorhus/multimatch/187e210076239ee6b5dcecca65adc0074f1e8e53/test.js +Source1: test-%{version}.js +# Include a copy of the MIT license to comply with license requirements. +Source2: LICENSE + +BuildArch: 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(lodash) +BuildRequires: npm(minimatch) +BuildRequires: npm(mocha) +%endif + +%description +%{summary}. + + +%prep +%setup -q -n package +cp -p %{SOURCE1} test.js +cp -p %{SOURCE2} . + +%nodejs_fixdep minimatch '~0.2.12' + + +%build +#nothing to do + + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/multimatch +cp -pr package.json index.js \ + %{buildroot}%{nodejs_sitelib}/multimatch + +%nodejs_symlink_deps + + +%if 0%{?enable_tests} +%check +%nodejs_symlink_deps --check +/usr/bin/mocha --reporter spec +%endif + + +%files +%doc LICENSE readme.md +%{nodejs_sitelib}/multimatch + + +%changelog +* Sat Mar 29 2014 Jamie Nguyen - 0.1.0-1 +- initial package diff --git a/sources b/sources index e69de29..30b2c6a 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +3f31e4b3595567774017a1ff93fd84d2 multimatch-0.1.0.tgz diff --git a/test-0.1.0.js b/test-0.1.0.js new file mode 100644 index 0000000..54912f0 --- /dev/null +++ b/test-0.1.0.js @@ -0,0 +1,16 @@ +'use strict'; +var assert = require('assert') +var mm = require('./index'); +var f = ['foo', 'bar', 'baz']; + +describe('multimatch', function () { + it('should match on multiple patterns', function () { + assert.deepEqual(mm(f, 'foo'), ['foo']); + assert.deepEqual(mm(f, '!foo'), ['bar', 'baz']); + assert.deepEqual(mm(f, ['foo', 'bar']), ['foo', 'bar']); + assert.deepEqual(mm(f, ['foo', '!bar']), ['foo']); + assert.deepEqual(mm(f, ['!foo', 'bar']), ['bar', 'baz']); + assert.deepEqual(mm(f, ['!foo', '!bar']), ['baz']); + assert.deepEqual(mm(f, ['!*{o,r}', 'foo']), ['baz', 'foo']); + }); +});