Skip to content

Commit

Permalink
optimistic version ranges, doc updates for gulp-util upcoming changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Feb 23, 2014
1 parent 0f5fb7f commit d96b6f0
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 264 deletions.
2 changes: 1 addition & 1 deletion docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Probably. Ask yourself:

## How should newlines be represented in plugin output?

Always use gulp-util.newline (which is \n) to prevent diff issues between operating systems.
Always use `\n` to prevent diff issues between operating systems.

## Where can I get updates on gulp?

Expand Down
5 changes: 2 additions & 3 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
npm install -g gulp
```

### 2. Install gulp and gulp-util in your project devDependencies:
### 2. Install gulp in your project devDependencies:

```
npm install --save-dev gulp gulp-util
npm install --save-dev gulp
```

### 3. Create a `gulpfile.js` at the root of your project:

```javascript
var gulp = require('gulp');
var gutil = require('gulp-util');

gulp.task('default', function(){
// place code for your default task here
Expand Down
6 changes: 3 additions & 3 deletions docs/recipes/pass-params-from-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
`gulpfile.js`

```js
// npm install gulp gulp-util gulp-if gulp-uglify
// npm install gulp optimist gulp-if gulp-uglify
var args = require('optimist').argv;
var gulp = require('gulp');
var gutil = require('gulp-util');
var gulpif = require('gulp-if');
var uglify = require('gulp-uglify');

var isProduction = gutil.env.type === 'production';
var isProduction = args.type === 'production';

gulp.task('scripts', function () {
return gulp.src('**/*.js')
Expand Down
14 changes: 0 additions & 14 deletions docs/recipes/specifying-a-cwd.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,6 @@ From the `project/` directory
gulp --cwd ./layer1/
```

Another option is to use `process.chdir` which is just vanilla node.

`gulpfile.js`

```js
var gulp = require('gulp');

try {
process.chdir(gulp.env.cwd);
} catch (err) {
console.error('Unable to chdir to %s', gulp.env.cwd);
}
```

If you only need to specify a cwd for a certain glob, you can use the `cwd` option on a [glob-stream](https://github.com/wearefractal/glob-stream)

```js
Expand Down
1 change: 0 additions & 1 deletion docs/writing-a-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ If you plan to create your own Gulp plugin, you will save time by reading the fu
* [Using buffers](using-buffers.md)
* [Dealing with streams](dealing-with-streams.md)
* [Testing](testing.md)
* [README conventions](readme-conventions.md)

## What it does

Expand Down
2 changes: 1 addition & 1 deletion docs/writing-a-plugin/guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
- Do not buffer a stream to shoehorn your plugin to work with streams. This will cause horrible things to happen.
1. Do not pass the `file` object downstream until you are done with it
1. Make use of the [gulp-util](https://github.com/gulpjs/gulp-util) library
- It provides templating, CLI colors, logging, changing file extensions
- It provides templating, logging, changing file extensions
- Try looking for common things there first and add it if it doesn't exist
1. Do NOT require `gulp` as a dependency or peerDependency
- There is no reason you should have to do this and it will cause problems if you do
Expand Down
218 changes: 0 additions & 218 deletions docs/writing-a-plugin/readme-conventions.md

This file was deleted.

8 changes: 4 additions & 4 deletions docs/writing-a-plugin/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Most plugins use [mocha](https://github.com/visionmedia/mocha) and [event-stream
```js
var assert = require('assert');
var es = require('event-stream');
var gutil = require('gulp-util');
var File = require('vinyl');
var prefixer = require('../index');

describe('gulp-prefixer', function () {
Expand All @@ -22,7 +22,7 @@ describe('gulp-prefixer', function () {
it('should prepend text', function (done) {

// create the fake file
var fakeFile = new gutil.File({
var fakeFile = new File({
contents: es.readArray(['stream', 'with', 'those', 'contents'])
});

Expand Down Expand Up @@ -56,7 +56,7 @@ describe('gulp-prefixer', function () {
```js
var assert = require('assert');
var es = require('event-stream');
var gutil = require('gulp-util');
var File = require('vinyl');
var prefixer = require('../index');

describe('gulp-prefixer', function () {
Expand All @@ -65,7 +65,7 @@ describe('gulp-prefixer', function () {
it('should prepend text', function (done) {

// create the fake file
var fakeFile = new gutil.File({
var fakeFile = new File({
contents: new Buffer('abufferwiththiscontent')
});

Expand Down
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@
"gulp": "./bin/gulp.js"
},
"dependencies": {
"gulp-util": "~2.2.0",
"orchestrator": "~0.3.0",
"pretty-hrtime": "~0.2.0",
"vinyl-fs": "~0.0.2",
"semver": "~2.2.1",
"archy": "~0.0.2",
"deprecated": "~0.0.1",
"liftoff": "~0.8.3"
"gulp-util": "^2.2.0",
"orchestrator": "^0.3.0",
"pretty-hrtime": "^0.2.0",
"vinyl-fs": "^0.0.2",
"semver": "^2.2.1",
"archy": "^0.0.2",
"deprecated": "^0.0.1",
"liftoff": "^0.8.3"
},
"devDependencies": {
"mocha": "~1.17.0",
"mocha-lcov-reporter": "~0.0.1",
"coveralls": "~2.7.0",
"istanbul": "~0.2.3",
"should": "~3.1.0",
"rimraf": "~2.2.5",
"q": "~1.0.0",
"jshint": "~2.4.1",
"graceful-fs": "~2.0.1",
"gulp-jshint": "~1.4.0",
"mkdirp": "~0.3.5"
"mocha": "^1.17.0",
"mocha-lcov-reporter": "^0.0.1",
"coveralls": "^2.7.0",
"istanbul": "^0.2.3",
"should": "^3.1.0",
"rimraf": "^2.2.5",
"q": "^1.0.0",
"jshint": "^2.4.1",
"graceful-fs": "^2.0.1",
"gulp-jshint": "^1.4.0",
"mkdirp": "^0.3.5"
},
"scripts": {
"test": "node gulpfile.js && mocha --reporter spec",
Expand Down

0 comments on commit d96b6f0

Please sign in to comment.