Skip to content
This repository was archived by the owner on Jan 23, 2021. It is now read-only.

Commit 15c5d49

Browse files
committed
tweaks
1 parent 9cb474f commit 15c5d49

File tree

5 files changed

+73
-75
lines changed

5 files changed

+73
-75
lines changed

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,3 @@ insert_final_newline = true
1010
[{package.json,*.yml}]
1111
indent_style = space
1212
indent_size = 2
13-
14-
[*.md]
15-
trim_trailing_whitespace = false

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
sudo: false
22
language: node_js
33
node_js:
4+
- '5'
45
- '4'
56
- '0.12'
67
- '0.10'

package.json

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@
2222
"scripts": {
2323
"test": "xo && cd test && mocha test.js"
2424
},
25-
"xo": {
26-
"rules": {
27-
"brace-style": [
28-
2,
29-
"stroustrup",
30-
{
31-
"allowSingleLine": false
32-
}
33-
]
34-
}
35-
},
3625
"files": [
3726
"index.js",
3827
"lib"
@@ -57,21 +46,31 @@
5746
"dargs": "^2.0.3",
5847
"each-async": "^1.0.0",
5948
"escape-string-regexp": "^1.0.3",
60-
"glob": "^5.0.5",
49+
"glob": "^7.0.3",
6150
"glob2base": "0.0.12",
6251
"gulp-util": "^3.0.4",
6352
"md5-hex": "^1.0.2",
6453
"object-assign": "^4.0.1",
6554
"os-tmpdir": "^1.0.0",
6655
"path-exists": "^2.0.0",
67-
"rimraf": "^2.2.8",
68-
"vinyl-fs": "^1.0.0"
56+
"rimraf": "^2.2.8"
6957
},
7058
"devDependencies": {
7159
"gulp": "^3.8.11",
7260
"gulp-sourcemaps": "^1.2.7",
7361
"mocha": "*",
74-
"vinyl-file": "^1.2.1",
62+
"vinyl-file": "^2.0.0",
7563
"xo": "*"
64+
},
65+
"xo": {
66+
"rules": {
67+
"brace-style": [
68+
"error",
69+
"stroustrup",
70+
{
71+
"allowSingleLine": false
72+
}
73+
]
74+
}
7675
}
7776
}

readme.md

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# gulp-ruby-sass [![Build Status](https://travis-ci.org/sindresorhus/gulp-ruby-sass.svg?branch=master)](https://travis-ci.org/sindresorhus/gulp-ruby-sass)
22

3-
Compiles Sass with the [Sass gem](http://sass-lang.com/install) and pipes the results into a gulp stream.
3+
Compiles Sass with the [Sass gem](http://sass-lang.com/install) and pipes the results into a gulp stream.<br>
44
To compile Sass with [libsass](http://libsass.org/), use [gulp-sass](https://github.com/dlmanning/gulp-sass)
55

6+
67
## Install
78

89
```
@@ -11,131 +12,131 @@ $ npm install --save-dev gulp-ruby-sass
1112

1213
Requires [Sass >=3.4](http://sass-lang.com/install).
1314

15+
1416
## Usage
1517

16-
### sass(source, options)
18+
### sass(source, [options])
1719

1820
Use gulp-ruby-sass *instead of `gulp.src`* to compile Sass files.
1921

2022
```js
21-
var gulp = require('gulp');
22-
var sass = require('gulp-ruby-sass');
23-
24-
gulp.task('sass', function () {
25-
return sass('source/file.scss')
26-
.on('error', sass.logError)
27-
.pipe(gulp.dest('result'));
28-
});
23+
const gulp = require('gulp');
24+
const sass = require('gulp-ruby-sass');
25+
26+
gulp.task('sass', () =>
27+
sass('source/file.scss')
28+
.on('error', sass.logError)
29+
.pipe(gulp.dest('result'))
30+
);
2931
```
3032

3133
#### source
3234

33-
Type: `String` or `Array`
35+
Type: `string`, `array`
3436

35-
A file or glob pattern (`source/**/*.scss`) to compile. Ignores files prefixed with an underscore. **Directory sources are not supported.**
37+
File or glob pattern (`source/**/*.scss`) to compile. Ignores files prefixed with an underscore. **Directory sources are not supported.**
3638

3739
#### options
3840

39-
Type: `Object`
41+
Type: `object`
4042

41-
An object containing plugin and Sass options. Available options include:
43+
Object containing plugin and Sass options.
4244

4345
##### bundleExec
4446

45-
Type: `Boolean`
47+
Type: `boolean`<br>
4648
Default: `false`
4749

4850
Run Sass with [bundle exec](http://gembundler.com/man/bundle-exec.1.html).
4951

5052
##### sourcemap
5153

52-
Type: `Boolean`
54+
Type: `boolean`<br>
5355
Default: `false`
5456

5557
Initialize and pass Sass sourcemaps to [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps). Note this option replaces Sass's `sourcemap` option.
5658

5759
```js
58-
var gulp = require('gulp');
59-
var sass = require('gulp-ruby-sass');
60-
var sourcemaps = require('gulp-sourcemaps');
61-
62-
gulp.task('sass', function () {
63-
return sass('source/file.scss', { sourcemap: true })
64-
.on('error', sass.logError)
65-
66-
// For inline sourcemaps
67-
.pipe(sourcemaps.write())
68-
69-
// For file sourcemaps
70-
.pipe(sourcemaps.write('maps', {
71-
includeContent: false,
72-
sourceRoot: 'source'
73-
}))
74-
75-
.pipe(gulp.dest('result'));
76-
});
60+
const gulp = require('gulp');
61+
const sass = require('gulp-ruby-sass');
62+
const sourcemaps = require('gulp-sourcemaps');
63+
64+
gulp.task('sass', () =>
65+
sass('source/file.scss', {sourcemap: true})
66+
.on('error', sass.logError)
67+
// for inline sourcemaps
68+
.pipe(sourcemaps.write())
69+
// for file sourcemaps
70+
.pipe(sourcemaps.write('maps', {
71+
includeContent: false,
72+
sourceRoot: 'source'
73+
}))
74+
.pipe(gulp.dest('result'))
75+
);
7776
```
7877

7978
##### base
8079

81-
Type: `String`
80+
Type: `string`
8281

8382
Identical to `gulp.src`'s [`base` option](https://github.com/gulpjs/gulp/blob/master/docs/API.md#optionsbase).
8483

8584
##### tempDir
8685

87-
Type: `String`
88-
Default: the system temp directory as reported by [os-tempDir](https://github.com/sindresorhus/os-tmpdir)
86+
Type: `string`<br>
87+
Default: System temp directory
8988

9089
This plugin compiles Sass files to a temporary directory before pushing them through the stream. Use `tempDir` to choose an alternate directory if you aren't able to use the default OS temporary directory.
9190

9291
##### emitCompileError
9392

94-
Type: `Boolean`
93+
Type: `boolean`<br>
9594
Default: `false`
9695

9796
Emit a gulp error when Sass compilation fails.
9897

9998
##### verbose
10099

101-
Type: `Boolean`
100+
Type: `boolean`<br>
102101
Default: `false`
103102

104103
Log the spawned Sass or Bundler command. Useful for debugging.
105104

106105
##### Sass options
107106

108-
Any additional options are passed directly to the Sass executable. The options are camelCase versions of Sass's options parsed by [dargs](https://github.com/sindresorhus/dargs).
107+
Any additional options are passed directly to the Sass executable. The options are camelCase versions of Sass's options parsed by [`dargs`](https://github.com/sindresorhus/dargs).
109108

110109
Run `sass -h` for a complete list of Sass options.
111110

112111
```js
113-
gulp.task('sass', function () {
114-
return sass('source/file.scss', {
115-
precision: 6,
116-
stopOnError: true,
117-
cacheLocation: './',
118-
loadPath: [ 'library', '../../shared-components' ]
119-
})
120-
.on('error', sass.logError)
121-
.pipe(gulp.dest('result'));
122-
});
112+
gulp.task('sass', () =>
113+
sass('source/file.scss', {
114+
precision: 6,
115+
stopOnError: true,
116+
cacheLocation: './',
117+
loadPath: [ 'library', '../../shared-components' ]
118+
})
119+
.on('error', sass.logError)
120+
.pipe(gulp.dest('result'))
121+
);
123122
```
124123

125124
### sass.logError(err)
126125

127-
A convenience function for pretty error logging.
126+
Convenience function for pretty error logging.
128127

129128
### sass.clearCache([tempDir])
130129

131130
In rare cases you may need to clear gulp-ruby-sass's cache. This sync function deletes all files used for Sass caching. If you've set a custom temporary directory in your task you must pass it to `clearCache`.
132131

132+
133133
## Issues
134134

135135
This plugin wraps the Sass gem for the gulp build system. It does not alter Sass's output in any way. Any issues with Sass output should be reported to the [Sass issue tracker](https://github.com/sass/sass/issues).
136136

137137
Before submitting an issue please read the [contributing guidelines](https://github.com/sindresorhus/gulp-ruby-sass/blob/master/contributing.md).
138138

139+
139140
## License
140141

141-
MIT © [Sindre Sorhus](http://sindresorhus.com)
142+
MIT © [Sindre Sorhus](https://sindresorhus.com)

test/gulpfile.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
'use strict';
22
var gulp = require('gulp');
3-
var sass = require('../');
43
var sourcemaps = require('gulp-sourcemaps');
4+
var sass = require('../');
55

66
gulp.task('sass', function () {
77
return sass('source/**/*.scss', {verbose: true})
8-
.on('error', sass.logError)
9-
.pipe(sourcemaps.write())
10-
.pipe(gulp.dest('result'));
8+
.on('error', sass.logError)
9+
.pipe(sourcemaps.write())
10+
.pipe(gulp.dest('result'));
1111
});

0 commit comments

Comments
 (0)