[nodejs-maxmin] Initial import

Jamie Nguyen jamielinux at fedoraproject.org
Mon Mar 31 18:55:44 UTC 2014


commit 7b0f324375e9bf3a3e24d645d5271ee8021061d7
Author: Jamie Nguyen <j at jamielinux.com>
Date:   Mon Mar 31 19:54:12 2014 +0100

    Initial import

 .gitignore         |    1 +
 LICENSE            |   18 +++++++++++++
 nodejs-maxmin.spec |   69 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 sources            |    1 +
 test.js            |   12 +++++++++
 5 files changed, 101 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..2f5d9b5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/maxmin-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-maxmin.spec b/nodejs-maxmin.spec
new file mode 100644
index 0000000..665bda0
--- /dev/null
+++ b/nodejs-maxmin.spec
@@ -0,0 +1,69 @@
+%{?nodejs_find_provides_and_requires}
+
+%global enable_tests 0
+
+Name:       nodejs-maxmin
+Version:    0.1.0
+Release:    1%{?dist}
+Summary:    Get pretty output of the original, minified gzipped size of a string/buffer
+License:    MIT
+Group:      System Environment/Libraries
+URL:        https://github.com/sindresorhus/maxmin
+Source0:    http://registry.npmjs.org/maxmin/-/maxmin-%{version}.tgz
+Source1:    https://raw.github.com/sindresorhus/maxmin/8c64d250ce94dddb817b80f6ef06bb9a67c3db7c/test.js
+# https://github.com/sindresorhus/maxmin/pull/1
+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(chalk)
+BuildRequires:  npm(gzip-size)
+BuildRequires:  npm(pretty-bytes)
+BuildRequires:  npm(mocha)
+%endif
+
+%description
+%{summary}.
+
+
+%prep
+%setup -q -n package
+cp -p %{SOURCE1} .
+cp -p %{SOURCE2} .
+
+
+%build
+#nothing to do
+
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/maxmin
+cp -pr package.json index.js \
+    %{buildroot}%{nodejs_sitelib}/maxmin
+
+%nodejs_symlink_deps
+
+
+%if 0%{?enable_tests}
+%check
+%nodejs_symlink_deps --check
+/usr/bin/mocha
+%endif
+
+
+%files
+%doc LICENSE readme.md
+%{nodejs_sitelib}/maxmin
+
+
+%changelog
+* Thu Mar 13 2014 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.1.0-1
+- initial package
diff --git a/sources b/sources
index e69de29..df11ef2 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+a0fc6f81ad571bbd8d8c202481e49da8  maxmin-0.1.0.tgz
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..3b55070
--- /dev/null
+++ b/test.js
@@ -0,0 +1,12 @@
+'use strict';
+var assert = require('assert');
+var chalk = require('chalk');
+var maxmin = require('./index');
+
+var max = 'function smoothRangeRandom(min,max){var num=Math.floor(Math.random()*(max-min+1)+min);return this.prev=num===this.prev?++num:num};';
+var min = '(function(b,c){var a=Math.floor(Math.random()*(c-b+1)+b);return this.a=a===this.a?++a:a})()';
+
+it('should generate correct output', function () {
+	assert.strictEqual(chalk.stripColor(maxmin(max, min)), '130 B → 91 B');
+	assert.strictEqual(chalk.stripColor(maxmin(max, min, true)), '130 B → 91 B → 53 B (gzip)');
+});


More information about the scm-commits mailing list