Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6d84a78

Browse files
committed
- version bump to 1.1.0
- updated README and package.json - removed Makefile: Use npm test instead - added node 0.9 to travis
1 parent 826b619 commit 6d84a78

File tree

5 files changed

+28
-20
lines changed

5 files changed

+28
-20
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: node_js
22
node_js:
33
- 0.8
4+
- 0.9
45

56
script:
67
- npm test

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
##Changelog
22

3+
###v1.1.0
4+
- Added Coffee-Script support
5+
- Removed Makefile: Use `npm test` instead.
6+
37
###v1.0.4
48
- Improved client-side rewire() with webpack
59

Makefile

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ rewire
44

55
rewire adds a special setter and getter to modules so you can modify their behaviour for better unit testing. You may
66

7-
- inject mocks for other modules
7+
- inject mocks for other modules or globals like `process`
88
- leak private variables
99
- override variables within the module.
1010

1111
rewire does **not** load the file and eval the contents to emulate node's require mechanism. In fact it uses node's own require to load the module. Thus your module behaves exactly the same in your test environment as under regular circumstances (except your modifications).
1212

13-
Furthermore rewire comes also with support for various client-side bundlers (see [below](#client-side-bundlers)).
13+
Good news to all caffeine-addicts: rewire works also with [Coffee-Script](http://coffeescript.org/). Note that in this case CS needs to be listed in your devDependencies.
1414

1515
[![Build Status](https://secure.travis-ci.org/jhnns/rewire.png?branch=master)](http://travis-ci.org/jhnns/rewire)
1616
[![Dependency Status](http://david-dm.org/jhnns/rewire/status.png)](http://david-dm.org/jhnns/rewire)
@@ -130,31 +130,31 @@ Returns the private variable.
130130
<br />
131131

132132
##Client-Side Bundlers
133-
Since rewire relies heavily on node's require mechanism it can't be used on the client-side without adding special middleware to the bundling process. Currently supported bundlers are:
134133

135-
- [browserify](https://github.com/substack/node-browserify)
136-
- [webpack](https://github.com/webpack/webpack) < 0.9.x
134+
rewire comes also with support for client-side bundlers. But since it relies heavily on node's require mechanism it can't be used on the client-side without adding special middleware to the bundling process. Currently supported bundlers are:
135+
136+
- [browserify](https://github.com/substack/node-browserify) @1.x
137+
- [webpack](https://github.com/webpack/webpack) @ 0.8.x
138+
139+
However, expect this feature to be extracted into own bundler-specific modules soon.
137140

138141
**Please note:** Unfortunately the line numbers in stack traces have an offset of +2 (browserify) / +1 (webpack).
139142
This is caused by generated code that is added during the bundling process.
140143

141144
###browserify
142145

146+
rewire currently only supports [email protected]. I'm not planing to continue development, but if you're relying on this feature [please let me know](https://github.com/jhnns/rewire/issues/13).
147+
143148
```javascript
144-
var b = browserify(),
145-
bundleSrc;
149+
var b = browserify();
146150

147151
// Add rewire as browserify middleware
148-
// @see https://github.com/substack/node-browserify/blob/master/doc/methods.markdown#busefn
149152
b.use(require("rewire").bundlers.browserify);
150-
151-
b.addEntry("entry.js");
152-
bundleSrc = b.bundle();
153153
```
154154

155155
###webpack
156156

157-
rewire doesn't run with webpack 0.9 because of various breaking api changes. I'm working on that.
157+
rewire doesn't run with webpack@0.9.x because of various breaking api changes. I'm [working on that](https://github.com/jhnns/rewire/issues/10).
158158

159159
```javascript
160160
var webpackOptions = {
@@ -168,3 +168,9 @@ require("rewire").bundlers.webpack(webpackOptions);
168168

169169
webpack("entry.js", webpackOptions, function () {});
170170
```
171+
172+
<br />
173+
174+
##License
175+
176+
MIT

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
{
22
"name" : "rewire",
3-
"version" : "1.0.4",
3+
"version" : "1.1.0",
44
"description" : "Dependency injection for node.js applications",
55
"keywords" : [
66
"dependency",
77
"injection",
88
"mock",
9+
"shim",
10+
"module",
911
"unit",
1012
"test",
1113
"leak",
1214
"inspect"
1315
],
1416
"author" : {
1517
"name" : "Johannes Ewald",
16-
"email" : "[email protected]",
17-
"web" : "http://johannesewald.de"
18+
"email" : "[email protected]"
1819
},
1920
"main" : "lib/index.js",
2021
"homepage": "https://github.com/jhnns/rewire",
@@ -27,7 +28,7 @@
2728
"url": "git://github.com/jhnns/rewire.git"
2829
},
2930
"engines" : {
30-
"node" : "<0.9.x"
31+
"node" : "<0.10.x"
3132
},
3233
"devDependencies": {
3334
"mocha": "1.x",

0 commit comments

Comments
 (0)