Synchronizes JSON fixtures with CouchDB
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-couch-data --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-couch-data');
In your project's Gruntfile, add a section named couch_data
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
couch_data: {
options: {
dbHost: 'http://localhost:5984/',
verbose: true
},
dev: {
src: 'fixtures/dev/*.json'
},
},
});
Type: String
Default value: None
Specifies the Couch DB server. It must end with a slash.
Type: Boolean
Default value: false
Enables or disables verbose output.
You must specify the .json fixture files, either by providing a files
array or by providing a files src
array within
a particular target.
For a simple setup, just list out your fixture files in the files
property.
grunt.initConfig({
couch_data: {
options: {
dbHost: 'http://localhost:5984/',
},
files: [ 'fixtures/*.json' ]
}
});
You can have different fixtures loaded based on your target.
grunt.initConfig({
couch_data: {
options: {
dbHost: 'http://localhost:5984/',
},
dev: {
src: [ 'fixtures/dev/*.json' ]
},
prod: {
src: [ 'fixtures/prod/*.json' ]
}
}
});
This currently only works without authentication, so your sever must be in Admin Party mode. This will be changed in a later release to allow for authentication.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
(Nothing yet)