Skip to content

Commit

Permalink
Release 0.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Feb 26, 2014
1 parent d6afd31 commit cba55b0
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 33 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
@@ -1,6 +1,7 @@
language: node_js
node_js:
- '0.10'
- 0.8
- 0.11
script: make test-coveralls
- '0.8'
- '0.11'
install: make install
script: make test-coveralls
6 changes: 6 additions & 0 deletions AUTHORS
@@ -0,0 +1,6 @@
# Ordered by date of first contribution.
# Auto-generated by 'contributors' on Wed, 26 Feb 2014 04:24:19 GMT.
# https://github.com/xingrz/node-contributors

fengmk2 <fengmk2@gmail.com> (https://github.com/fengmk2)
JacksonTian <shyvo1987@gmail.com> (https://github.com/JacksonTian)
8 changes: 8 additions & 0 deletions History.md
@@ -1,4 +1,12 @@

0.3.3 / 2014-02-26
==================

* Fix #5, when ejs refererences is differences, setting tag will fails (@JacksonTian)
* add npm image
* coveralls request fail should not let test error
* work with connect@2.8.x and @2.9.x

0.3.2 / 2013-10-11
==================

Expand Down
4 changes: 2 additions & 2 deletions LICENSE.txt
@@ -1,6 +1,6 @@
(The MIT License)

Copyright (c) 2012 - 2013 fengmk2 <fengmk2@gmail.com>
Copyright (c) 2012 - 2014 fengmk2 <fengmk2@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand All @@ -19,4 +19,4 @@ 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.
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7 changes: 5 additions & 2 deletions Makefile
Expand Up @@ -14,7 +14,7 @@ SUPPORT_VERSIONS := \
2.9.0

install:
@npm install
@npm install --registry=http://r.cnpmjs.org

test: install
@NODE_ENV=test ./node_modules/.bin/mocha -R $(REPORTER) --timeout $(TIMEOUT) \
Expand Down Expand Up @@ -42,4 +42,7 @@ test-coveralls:
@echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
-@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js

.PHONY: test test-cov test-all test-version test-all-version test-coveralls
contributors: install
@./node_modules/.bin/contributors -f plain -o AUTHORS

.PHONY: test
15 changes: 8 additions & 7 deletions README.md
Expand Up @@ -122,20 +122,21 @@ function render(view, options) {}
$ git summary

project : connect-render
repo age : 1 year, 8 months
active : 14 days
commits : 39
files : 43
repo age : 2 years
active : 17 days
commits : 45
files : 45
authors :
37 fengmk2 94.9%
2 tangyao 5.1%
42 fengmk2 93.3%
2 tangyao 4.4%
1 Jackson Tian 2.2%
```

## License

(The MIT License)

Copyright (c) 2012 - 2013 fengmk2 &lt;fengmk2@gmail.com&gt;
Copyright (c) 2012 - 2014 fengmk2 &lt;fengmk2@gmail.com&gt;

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
14 changes: 7 additions & 7 deletions lib/filters.js
@@ -1,6 +1,6 @@
/*!
* connect-render - lib/filters.js
* Copyright(c) 2012 fengmk2 <fengmk2@gmail.com>
* Copyright(c) 2012 - 2014 fengmk2 <fengmk2@gmail.com>
* MIT Licensed
*/

Expand All @@ -18,13 +18,13 @@ var TRUNCATE_PEDDING = '…';

/**
* truncatechars with max unicode length
* e.g.:
* e.g.:
*
* ```js
* truncatechars('你好吗?', 3); // => '你好…'
* truncatechars('hello', 2); // => 'he…'
* ```
*
*
* @param {String} text
* @param {Number} max, max string length.
* @return {String}
Expand Down Expand Up @@ -67,9 +67,9 @@ exports.truncatechars = function (text, max) {
* e.g.:
*
* ```js
* fmoney("12345.675910", 3); // => 12,345.676
* fmoney("12345.675910", 3); // => 12,345.676
* ```
*
*
* @param {String|Number} s
* @param {Number} n, decimal digits.
* @return {String}
Expand All @@ -80,9 +80,9 @@ exports.fmoney = function fmoney(s, n) {
return s;
}
var lr = (s.toFixed(n || 0) + '').split('.');
var l = lr[0].split('').reverse();
var l = lr[0].split('').reverse();
var t = [];
for (var i = 0, len = l.length, last = len - 1; i < len; i++) {
for (var i = 0, len = l.length, last = len - 1; i < len; i++) {
t.push(l[i]);
if ((i + 1) % 3 === 0 && i !== last) {
t.push(',');
Expand Down
20 changes: 10 additions & 10 deletions lib/render.js
@@ -1,6 +1,6 @@
/*!
* connect-render - lib/render.js
* Copyright(c) 2012 fengmk2 <fengmk2@gmail.com>
* Copyright(c) 2012 - 2014 fengmk2 <fengmk2@gmail.com>
* MIT Licensed
*/

Expand Down Expand Up @@ -46,7 +46,7 @@ var PARTIAL_PATTERN_RE;
/**
* add support for <%- partial('view') %> function
* rather than realtime compiling, this implemention simply statically 'include' the partial view file
*
*
* @param {String} data
* @param {String} [viewname] view name for partial loop check.
* @return {String}
Expand Down Expand Up @@ -114,7 +114,7 @@ function send(res, str) {

/**
* Render the view fill with options
*
*
* @param {String} view, view name.
* @param {Object} [options=null]
* - {Boolean} layout, use layout or not, default is `true`.
Expand Down Expand Up @@ -173,12 +173,12 @@ function render(view, options) {

/**
* connect-render: Template Render helper for connect
*
*
* Use case:
*
*
* var render = require('connect-render');
* var connect = require('connect');
*
*
* connect(
* render({
* root: __dirname + '/views',
Expand All @@ -193,12 +193,12 @@ function render(view, options) {
* }
* });
* );
*
*
* res.render('index.html', { title: 'Index Page', items: items });
*
* // no layout
*
* // no layout
* res.render('blue.html', { items: items, layout: false });
*
*
* @param {Object} [options={}] render options.
* - {String} layout, layout name, default is `'layout.html'`.
* Set `layout=''` or `layout=false` meaning no layout.
Expand Down
5 changes: 3 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "connect-render",
"version": "0.3.2",
"version": "0.3.3",
"description": "Template Render helper using `ejs` for `connect`: res.render(view, options). Support `connect` @1.8.x and @2.2.0+ .",
"keywords": ["connect", "render", "connect-render", "template", "ejs"],
"author": "fengmk2 <fengmk2@gmail.com> (http://github.com/fengmk2)",
Expand All @@ -27,6 +27,7 @@
"ejs": "0.8.x"
},
"devDependencies": {
"contributors": "*",
"should": "*",
"mocha": "*",
"blanket": "*",
Expand All @@ -38,7 +39,7 @@
"supertest": "*"
},
"license": "MIT",
"engines": {
"engines": {
"node": ">= 0.8.0"
}
}

0 comments on commit cba55b0

Please sign in to comment.