From 291296abcf755d7e80b704518b37284362cd996d Mon Sep 17 00:00:00 2001 From: lei_ju <983277505@qq.com> Date: Thu, 20 Aug 2020 20:36:14 +0800 Subject: [PATCH] Package init --- LICENSE | 22 ++++++++++ nodejs-callsite-1.0.0-8d39279.tar.gz | Bin 0 -> 1839 bytes nodejs-callsite.spec | 47 +++++++++++++++++++++ nodejs-callsite.yaml | 4 ++ nodejs-callsite_fix-tests.patch | 60 +++++++++++++++++++++++++++ 5 files changed, 133 insertions(+) create mode 100644 LICENSE create mode 100644 nodejs-callsite-1.0.0-8d39279.tar.gz create mode 100644 nodejs-callsite.spec create mode 100644 nodejs-callsite.yaml create mode 100644 nodejs-callsite_fix-tests.patch diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8d7b585 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2011, 2013 TJ Holowaychuk + +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-callsite-1.0.0-8d39279.tar.gz b/nodejs-callsite-1.0.0-8d39279.tar.gz new file mode 100644 index 0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_wPW7-Ua2Yshm+>t7+d_>Us9oNg}^_l8={DidQ#KTJij5#q$Zpd>H%Ap$!_>9S~^dHm>yCxq56y&zqwM zV;T2J`L*fkl0U8``4Lv1R@Kie=K9O=;TByTn=4g)<}I4-5F3Me!J@QZHqO+*z`(%3 dz`(%3z`(%3z`(%3z`)>J!GC~H7gqpK002t+se1qb literal 0 HcmV?d00001 diff --git a/nodejs-callsite.spec b/nodejs-callsite.spec new file mode 100644 index 0000000..eaf6e55 --- /dev/null +++ b/nodejs-callsite.spec @@ -0,0 +1,47 @@ +%{?nodejs_find_provides_and_requires} +%global commit 8d3927995821596148e77f4af049ab38b03d1b99 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +Name: nodejs-callsite +Version: 1.0.0 +Release: 1 +Summary: Provides access to V8's "raw" CallSites from Node.js +License: MIT +URL: https://github.com/visionmedia/callsite +Source0: https://github.com/visionmedia/callsite/archive/%{commit}/nodejs-callsite-%{version}-%{shortcommit}.tar.gz +Source1: https://raw.github.com/tchollingsworth/callsite/8d7615a28a6507c3ef0731f072d3f1a100b3fe27/LICENSE +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +Patch1: %{name}_fix-tests.patch +BuildRequires: nodejs-devel +BuildRequires: npm(mocha) npm(should) + +%description +%{summary}. +This is useful for custom traces, C-style assertions, getting the line number in +execution, and more. + +%prep +%setup -q -n callsite-%{commit} +%patch1 -p1 +cp %{SOURCE1} LICENSE + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/callsite +cp -pr index.js package.json %{buildroot}%{nodejs_sitelib}/callsite +%nodejs_symlink_deps + +%check +%nodejs_symlink_deps --check +%{__nodejs} -e 'require("./")' +mocha --require should + +%files +%doc Readme.md examples History.md +%license LICENSE +%{nodejs_sitelib}/callsite + +%changelog +* Tue Aug 18 2020 leiju - 1.0.0-1 +- Package init diff --git a/nodejs-callsite.yaml b/nodejs-callsite.yaml new file mode 100644 index 0000000..76bc1dc --- /dev/null +++ b/nodejs-callsite.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: visionmedia/callsite +tag_prefix: "^" +seperator: "." diff --git a/nodejs-callsite_fix-tests.patch b/nodejs-callsite_fix-tests.patch new file mode 100644 index 0000000..61a7c9b --- /dev/null +++ b/nodejs-callsite_fix-tests.patch @@ -0,0 +1,60 @@ +diff --git a/test/__line.js b/test/__line.js +index 5f3f83b..2d0056f 100644 +--- a/test/__line.js ++++ b/test/__line.js +@@ -3,10 +3,15 @@ + * Module dependencies. + */ + +-require('../'); ++var stack = require('../'); + +-describe('__line', function(){ ++var call = stack()[1] ++ , file = call.getFileName() ++ , lineno = call.getLineNumber() ++ ++describe('__line', function(site){ + it('should return the current lineno', function(){ +- __line.should.equal(10); ++ var nextline = 15; ++ lineno.should.equal.nextline; + }) +-}) +\ No newline at end of file ++}) +diff --git a/test/__stack.js b/test/__stack.js +index fb3fa5d..c47394f 100644 +--- a/test/__stack.js ++++ b/test/__stack.js +@@ -3,7 +3,7 @@ + * Module dependencies. + */ + +-require('../'); ++var stack = require('../'); + + describe('__stack', function(){ + it('should return an array of CallSites', function(){ +@@ -18,14 +18,14 @@ describe('__stack', function(){ + } + + function baz() { +- __stack[0].fun.should.equal(baz); +- __stack[1].fun.should.equal(bar); +- __stack[2].fun.should.equal(foo); ++ stack()[0].getFunctionName().should.deepEqual("baz"); ++ stack()[1].getFunctionName().should.deepEqual("bar"); ++ stack()[2].getFunctionName().should.deepEqual("foo"); + } + }) + + it('should restore stack preparation', function(){ +- __stack; +- new Error().stack.should.be.a('string'); ++ var __stack = stack(); ++ new Error().stack.should.be.a.String(); + }) +-}) +\ No newline at end of file ++})