grunt-yaml
Advanced tools
Comparing version 0.4.0 to 0.4.1
{ | ||
"name": "grunt-yaml", | ||
"description": "Compiles YAML to JSON.", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"homepage": "https://github.com/shiwano/grunt-yaml", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -121,2 +121,14 @@ # grunt-yaml [![Build Status](https://secure.travis-ci.org/shiwano/grunt-yaml.png?branch=master)](http://travis-ci.org/shiwano/grunt-yaml) | ||
#### options.readEncoding | ||
Type: `String` | ||
Default value: `grunt.file.defaultEncoding` | ||
An override to the default buffer encoding used to read in the YAML file (`grunt.file.read`). | ||
#### options.writeEncoding | ||
Type: `String` | ||
Default value: `grunt.file.defaultEncoding` | ||
An override to the default buffer encoding used to write out the JSON file (`grunt.file.write`). | ||
### Usage Examples | ||
@@ -130,2 +142,3 @@ | ||
## Release History | ||
* 2014-07-12 v0.4.1 Add `writeEncoding` and `readEncoding` options. | ||
* 2014-01-23 v0.4.0 Change yamlLoader behavior for showing the file name on js-yaml error, and add `strict` option. | ||
@@ -132,0 +145,0 @@ * 2014-01-18 v0.3.1 Use grunt.warn on js-yaml error. |
@@ -67,4 +67,12 @@ /* | ||
disableDest: false, | ||
strict: false | ||
strict: false, | ||
readEncoding: grunt.file.defaultEncoding, | ||
writeEncoding: grunt.file.defaultEncoding | ||
}); | ||
var readOptions = { | ||
encoding: options.readEncoding | ||
} | ||
var writeOptions = { | ||
encoding: options.writeEncoding | ||
} | ||
@@ -81,3 +89,3 @@ yamlSchema = createYamlSchema(options.customTypes); | ||
var dest = filePair.dest.replace(/\.ya?ml$/, '.json'); | ||
var result = loadYaml(src); | ||
var result = loadYaml(src, readOptions); | ||
var json = JSON.stringify(result, null, options.space); | ||
@@ -90,3 +98,3 @@ | ||
if (!options.disableDest) { | ||
grunt.file.write(dest, json); | ||
grunt.file.write(dest, json, writeOptions); | ||
grunt.log.writeln('Compiled ' + src.cyan + ' -> ' + dest.cyan); | ||
@@ -93,0 +101,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17848
313
155