From d87c23907a84477fe765b35827eb610dcb17f776 Mon Sep 17 00:00:00 2001 From: Miro HronĨok Date: Jan 04 2021 10:32:06 +0000 Subject: Orphaned for 6+ weeks --- diff --git a/.gitignore b/.gitignore deleted file mode 100644 index fda0028..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/regex-cache-0.4.3.tgz diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..5204a84 --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +Orphaned for 6+ weeks diff --git a/nodejs-regex-cache.spec b/nodejs-regex-cache.spec deleted file mode 100644 index efd19a0..0000000 --- a/nodejs-regex-cache.spec +++ /dev/null @@ -1,110 +0,0 @@ -%{?nodejs_find_provides_and_requires} - -%global packagename regex-cache -%global enable_tests 1 - -Name: nodejs-regex-cache -Version: 0.4.3 -Release: 11%{?dist} -Summary: Memoize the results of a call to the RegExp constructor - -License: MIT -URL: https://github.com/jonschlinkert/regex-cache.git -Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz -# The test files are not included in the npm tarball. -# The 0.4.2 release is not tagged in github, so pull from master for now -Source1: https://raw.githubusercontent.com/jonschlinkert/regex-cache/master/test.js -Source2: https://raw.githubusercontent.com/jonschlinkert/regex-cache/master/support.js - - -BuildArch: noarch -%if 0%{?fedora} >= 19 -ExclusiveArch: %{nodejs_arches} noarch -%else -ExclusiveArch: %{ix86} x86_64 %{arm} noarch -%endif - -BuildRequires: nodejs-packaging -BuildRequires: npm(is-equal-shallow) -BuildRequires: npm(is-primitive) -%if 0%{?enable_tests} -BuildRequires: mocha -BuildRequires: npm(should) -%endif - -%description -Memoize the results of a call to the RegExp constructor, avoiding repetitious -runtime compilation of the same string and options, resulting in dramatic speed -improvements. - - -%prep -%setup -q -n package -# setup the tests -cp -p %{SOURCE1} . -cp -p %{SOURCE2} . - -%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}/mocha -R spec -%else -%{_bindir}/echo "Tests disabled..." -%endif - - -%files -%{!?_licensedir:%global license %doc} -%doc *.md -%license LICENSE -%{nodejs_sitelib}/%{packagename} - - -%changelog -* Sat Aug 01 2020 Fedora Release Engineering - 0.4.3-11 -- Second attempt - Rebuilt for - https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Tue Jul 28 2020 Fedora Release Engineering - 0.4.3-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Wed Jan 29 2020 Fedora Release Engineering - 0.4.3-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Thu Jul 25 2019 Fedora Release Engineering - 0.4.3-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Fri Feb 01 2019 Fedora Release Engineering - 0.4.3-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Fri Jul 13 2018 Fedora Release Engineering - 0.4.3-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Thu Feb 08 2018 Fedora Release Engineering - 0.4.3-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Thu Jul 27 2017 Fedora Release Engineering - 0.4.3-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Fri Feb 10 2017 Fedora Release Engineering - 0.4.3-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Tue Jul 19 2016 Jared Smith - 0.4.3-2 -- Add missing BuildRequire line - -* Wed Jul 13 2016 Jared Smith - 0.4.3-1 -- Update to upstream 0.4.3 release - -* Tue Feb 9 2016 Jared Smith - 0.4.2-1 -- Initial packaging diff --git a/sources b/sources deleted file mode 100644 index 0678dc0..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -825244af2f117e489aeabddf8bd70f5c regex-cache-0.4.3.tgz diff --git a/support.js b/support.js deleted file mode 100644 index aa00d32..0000000 --- a/support.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -exports.toRegex = function toRegex(str, opts) { - if (typeof str !== 'string') { - opts = str; - str = ''; - } - opts = opts || {}; - var re = str || ''; - - if (opts.a) re += 'a'; - if (opts.b) re += 'b'; - if (opts.c) re += 'c'; - if (opts.d && opts.d.e) re += opts.d.e; - - if (opts.e) re += 'e'; - if (opts.f) re += 'f'; - if (opts.g) re += 'g'; - if (opts.h) re += 'h'; - if (opts.i) re += 'i'; - if (opts.j) re += 'j'; - if (opts.k) re += 'k'; - if (opts.l) re += 'l'; - if (opts.m) re += 'm'; - if (opts.n) re += 'n'; - if (opts.o) re += 'o'; - if (opts.p) re += 'p'; - if (opts.q) re += 'q'; - if (opts.r) re += 'r'; - if (opts.s) re += 's'; - if (opts.t) re += 't'; - - if (opts.x) re += 'x'; - if (opts.y) re += 'y'; - if (opts.z) re += 'z'; - - var f = opts.flags || ''; - re = re - ? '(' + re + ')' - : '([^\W]?)'; - - // filler for some other logic - if (re.indexOf('x') !== -1) { - re = re.replace(/x/g, ''); - } - if (re.indexOf('y') !== -1) { - re = re.replace(/y/g, ''); - } - if (re.indexOf('z') !== -1) { - re = re.replace(/z/g, ''); - } - - return new RegExp(re, f); -}; diff --git a/test.js b/test.js deleted file mode 100644 index ae5b599..0000000 --- a/test.js +++ /dev/null @@ -1,102 +0,0 @@ -/*! - * regex-cache - * - * Copyright (c) 2015 Jon Schlinkert. - * Licensed under the MIT license. - */ - -'use strict'; - -var assert = require('assert'); -var should = require('should'); -var cache = require('./'); -var fn = require('./support'); - -var str = 'a abc foo xyz fooabc'; - -describe('regex-cache:', function() { - describe('no cache:', function() { - it('should use the un-cached regex to match:', function() { - var matches = str.match(fn.toRegex()); - matches[1].should.equal('a'); - }); - }); - - describe('when a regex is passed:', function() { - it('should return it directly:', function() { - cache(fn.toRegex()).should.eql(/([^W]?)/); - }); - }); - - describe('when a function is passed:', function() { - it('should call the function when no other arguments are passed:', function() { - str.match(cache(fn.toRegex))[1].should.equal('a'); - }); - - it('should cache the results on the `_default_` key:', function() { - str.match(cache(fn.toRegex))[1].should.equal('a'); - cache.basic.should.have.property('_default_'); - }); - }); - - describe('with cache:', function() { - it('should use the cached regex to match:', function() { - var cached = cache(fn.toRegex); - var a = str.match(cached); - var b = str.match(cached); - var c = str.match(cached); - var d = str.match(cached); - var e = str.match(cached); - e[1].should.equal('a'); - cache.basic.should.have.property('_default_'); - }); - - it('should work when a regex is passed:', function() { - str.match(cache(fn.toRegex()))[1].should.equal('a'); - cache.basic.should.have.property('_default_'); - }); - - it('should work when a function is passed:', function() { - str.match(cache(fn.toRegex))[1].should.equal('a'); - cache.basic.should.have.property('_default_'); - }); - - it('should work when options are passed:', function() { - str.match(cache(fn.toRegex()))[1].should.equal('a'); - str.match(cache(fn.toRegex, 'foo'))[1].should.equal('foo'); - assert.equal(str.match(cache(fn.toRegex, 'bar')), null); - str.match(cache(fn.toRegex, 'foo', { a: true, b: true, c: true }))[1].should.equal('fooabc'); - str.match(cache(fn.toRegex, { a: true, b: true, c: true, flags: 'g'}))[0].should.equal('abc'); - }); - - it('should work when an option is an object:', function() { - str.match(cache(fn.toRegex, 'foo', { d: {e: 'abc'} }))[0].should.equal('fooabc'); - str.match(cache(fn.toRegex, 'foo', { d: {e: 'ab'} }))[0].should.equal('fooab'); - str.match(cache(fn.toRegex, 'foo', { d: {f: 'abc'} }))[0].should.equal('foo'); - }); - - it('should not use a cached regex when options have changed:', function() { - str.match(cache(fn.toRegex, { a: true, b: true, c: true }))[1].should.equal('abc'); - // change `a` to false - str.match(cache(fn.toRegex, { a: false, b: true, c: true }))[1].should.equal('bc'); - str.match(cache(fn.toRegex, { a: false, b: true, c: true }))[1].should.not.equal('abc'); - }); - }); - - describe('cache object:', function() { - it('should expose the cache:', function() { - cache(fn.toRegex, 'foo'); - cache.basic.should.have.property('foo'); - - cache(fn.toRegex, 'bar', { a: true, b: true, c: true }); - cache.cache.should.have.property('bar'); - - // cache(fn.toRegex, { a: true, b: true, c: true }); - // // cache.cache.should.have.property('atruebtruectrue'); - - // cache(fn.toRegex, { a: true, b: true, c: true, flags: 'g'}); - // cache.cache.should.have.property('atruebtruectrueflagsg'); - // cache.cache.should.have.property('foo'); - }); - }); -});