commit
c88bce3af9
13
difflib-0.2.4-fix-test-keywords.patch
Normal file
13
difflib-0.2.4-fix-test-keywords.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/test/global.coffee b/test/global.coffee
|
||||||
|
index a5bb19c..07954f5 100644
|
||||||
|
--- a/test/global.coffee
|
||||||
|
+++ b/test/global.coffee
|
||||||
|
@@ -28,7 +28,7 @@ test '.getCloseMatches', ->
|
||||||
|
getCloseMatches('appel', ['ape', 'apple', 'peach', 'puppy'])
|
||||||
|
.should.eql ['apple', 'ape']
|
||||||
|
|
||||||
|
- KEYWORDS = require('coffee-script').RESERVED
|
||||||
|
+ KEYWORDS = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'yield', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super', 'undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when', 'arguments', 'eval', 'yield*']
|
||||||
|
getCloseMatches('wheel', KEYWORDS).should.eql ['when', 'while']
|
||||||
|
getCloseMatches('accost', KEYWORDS).should.eql ['const']
|
||||||
|
|
||||||
BIN
difflib-0.2.4.tgz
Normal file
BIN
difflib-0.2.4.tgz
Normal file
Binary file not shown.
56
nodejs-difflib.spec
Normal file
56
nodejs-difflib.spec
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
%{?nodejs_find_provides_and_requires}
|
||||||
|
%global packagename difflib
|
||||||
|
%global enable_tests 1
|
||||||
|
Name: nodejs-difflib
|
||||||
|
Version: 0.2.4
|
||||||
|
Release: 1
|
||||||
|
Summary: Text diff library ported from Python's difflib module
|
||||||
|
License: Python
|
||||||
|
URL: https://github.com/qiao/difflib.js.git
|
||||||
|
Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
|
||||||
|
Patch0: difflib-0.2.4-fix-test-keywords.patch
|
||||||
|
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: coffee-script mocha npm(heap) npm(should)
|
||||||
|
%endif
|
||||||
|
%description
|
||||||
|
Text diff library ported from Python's difflib module
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n package
|
||||||
|
%patch0 -p1
|
||||||
|
rm lib/difflib.js
|
||||||
|
%nodejs_fixdep heap '^0.2.0'
|
||||||
|
|
||||||
|
%build
|
||||||
|
%{_bindir}/coffee -c -b -o lib/ src/difflib.coffee
|
||||||
|
|
||||||
|
%install
|
||||||
|
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
|
||||||
|
cp -pr package.json *.js lib/ \
|
||||||
|
%{buildroot}%{nodejs_sitelib}/%{packagename}
|
||||||
|
%nodejs_symlink_deps
|
||||||
|
%if 0%{?enable_tests}
|
||||||
|
|
||||||
|
%check
|
||||||
|
%nodejs_symlink_deps --check
|
||||||
|
%{__nodejs} -e 'require("./")'
|
||||||
|
%{_bindir}/coffee -c -b test/*.coffee
|
||||||
|
%{_bindir}/mocha --require should -R spec --ui qunit
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%files
|
||||||
|
%{!?_licensedir:%global license %doc}
|
||||||
|
%doc *.md
|
||||||
|
%license README.md
|
||||||
|
%{nodejs_sitelib}/%{packagename}
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Tue Aug 18 2020 Anan Fu <fuanan3@huawei.com> - 0.2.4-1
|
||||||
|
- package init
|
||||||
4
nodejs-difflib.yaml
Normal file
4
nodejs-difflib.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
version_control: github
|
||||||
|
src_repo: qiao/difflib.js.git
|
||||||
|
tag_prefix: "^"
|
||||||
|
seperator: "."
|
||||||
Loading…
x
Reference in New Issue
Block a user