├── .editorconfig ├── .eslintrc.json ├── .gitattributes ├── .gitignore ├── .travis.yml ├── .verb.md ├── LICENSE ├── README.md ├── docs └── demo.gif ├── generator.js ├── index.js ├── package.json ├── templates └── _editorconfig └── test.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | end_of_line = lf 6 | charset = utf-8 7 | indent_size = 2 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [{**/{actual,fixtures,expected,templates}/**,*.md}] 12 | trim_trailing_whitespace = false 13 | insert_final_newline = false -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "ecmaFeatures": { 3 | "modules": true, 4 | "experimentalObjectRestSpread": true 5 | }, 6 | 7 | "env": { 8 | "browser": false, 9 | "es6": true, 10 | "node": true, 11 | "mocha": true 12 | }, 13 | 14 | "globals": { 15 | "document": false, 16 | "navigator": false, 17 | "window": false 18 | }, 19 | 20 | "rules": { 21 | "accessor-pairs": 2, 22 | "arrow-spacing": [2, { "before": true, "after": true }], 23 | "block-spacing": [2, "always"], 24 | "brace-style": [2, "1tbs", { "allowSingleLine": true }], 25 | "comma-dangle": [2, "never"], 26 | "comma-spacing": [2, { "before": false, "after": true }], 27 | "comma-style": [2, "last"], 28 | "constructor-super": 2, 29 | "curly": [2, "multi-line"], 30 | "dot-location": [2, "property"], 31 | "eol-last": 2, 32 | "eqeqeq": [2, "allow-null"], 33 | "generator-star-spacing": [2, { "before": true, "after": true }], 34 | "handle-callback-err": [2, "^(err|error)$" ], 35 | "indent": [2, 2, { "SwitchCase": 1 }], 36 | "key-spacing": [2, { "beforeColon": false, "afterColon": true }], 37 | "keyword-spacing": [2, { "before": true, "after": true }], 38 | "new-cap": [2, { "newIsCap": true, "capIsNew": false }], 39 | "new-parens": 2, 40 | "no-array-constructor": 2, 41 | "no-caller": 2, 42 | "no-class-assign": 2, 43 | "no-cond-assign": 2, 44 | "no-const-assign": 2, 45 | "no-control-regex": 2, 46 | "no-debugger": 2, 47 | "no-delete-var": 2, 48 | "no-dupe-args": 2, 49 | "no-dupe-class-members": 2, 50 | "no-dupe-keys": 2, 51 | "no-duplicate-case": 2, 52 | "no-empty-character-class": 2, 53 | "no-eval": 2, 54 | "no-ex-assign": 2, 55 | "no-extend-native": 2, 56 | "no-extra-bind": 2, 57 | "no-extra-boolean-cast": 2, 58 | "no-extra-parens": [2, "functions"], 59 | "no-fallthrough": 2, 60 | "no-floating-decimal": 2, 61 | "no-func-assign": 2, 62 | "no-implied-eval": 2, 63 | "no-inner-declarations": [2, "functions"], 64 | "no-invalid-regexp": 2, 65 | "no-irregular-whitespace": 2, 66 | "no-iterator": 2, 67 | "no-label-var": 2, 68 | "no-labels": 2, 69 | "no-lone-blocks": 2, 70 | "no-mixed-spaces-and-tabs": 2, 71 | "no-multi-spaces": 2, 72 | "no-multi-str": 2, 73 | "no-multiple-empty-lines": [2, { "max": 1 }], 74 | "no-native-reassign": 0, 75 | "no-negated-in-lhs": 2, 76 | "no-new": 2, 77 | "no-new-func": 2, 78 | "no-new-object": 2, 79 | "no-new-require": 2, 80 | "no-new-wrappers": 2, 81 | "no-obj-calls": 2, 82 | "no-octal": 2, 83 | "no-octal-escape": 2, 84 | "no-proto": 0, 85 | "no-redeclare": 2, 86 | "no-regex-spaces": 2, 87 | "no-return-assign": 2, 88 | "no-self-compare": 2, 89 | "no-sequences": 2, 90 | "no-shadow-restricted-names": 2, 91 | "no-spaced-func": 2, 92 | "no-sparse-arrays": 2, 93 | "no-this-before-super": 2, 94 | "no-throw-literal": 2, 95 | "no-trailing-spaces": 0, 96 | "no-undef": 2, 97 | "no-undef-init": 2, 98 | "no-unexpected-multiline": 2, 99 | "no-unneeded-ternary": [2, { "defaultAssignment": false }], 100 | "no-unreachable": 2, 101 | "no-unused-vars": [2, { "vars": "all", "args": "none" }], 102 | "no-useless-call": 0, 103 | "no-with": 2, 104 | "one-var": [0, { "initialized": "never" }], 105 | "operator-linebreak": [0, "after", { "overrides": { "?": "before", ":": "before" } }], 106 | "padded-blocks": [0, "never"], 107 | "quotes": [2, "single", "avoid-escape"], 108 | "radix": 2, 109 | "semi": [2, "always"], 110 | "semi-spacing": [2, { "before": false, "after": true }], 111 | "space-before-blocks": [2, "always"], 112 | "space-before-function-paren": [2, "never"], 113 | "space-in-parens": [2, "never"], 114 | "space-infix-ops": 2, 115 | "space-unary-ops": [2, { "words": true, "nonwords": false }], 116 | "spaced-comment": [0, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!", ","] }], 117 | "use-isnan": 2, 118 | "valid-typeof": 2, 119 | "wrap-iife": [2, "any"], 120 | "yoda": [2, "never"] 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Enforce Unix newlines 2 | * text eol=lf 3 | 4 | # binaries 5 | *.ai binary 6 | *.psd binary 7 | *.jpg binary 8 | *.gif binary 9 | *.png binary 10 | *.jpeg binary 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # always ignore files 2 | *.DS_Store 3 | *.sublime-* 4 | 5 | # test related, or directories generated by tests 6 | test/actual 7 | actual 8 | coverage 9 | 10 | # npm 11 | node_modules 12 | npm-debug.log 13 | 14 | # misc 15 | _gh_pages 16 | benchmark 17 | bower_components 18 | vendor 19 | temp 20 | tmp 21 | TODO.md 22 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - '6' 5 | - '5' 6 | - '4' 7 | - '0.12' 8 | - '0.10' 9 | matrix: 10 | fast_finish: true 11 | allow_failures: 12 | - node_js: '4' 13 | - node_js: '0.10' 14 | - node_js: '0.12' 15 | -------------------------------------------------------------------------------- /.verb.md: -------------------------------------------------------------------------------- 1 | ## History 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016, Jon Schlinkert. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 | 5 | 6 |

7 | 8 | The generator creates a `.editorconfig` file in the current working directory. Run from the command line or register as a sub-generator or plugin in your own generator. 9 | 10 | # generate-editorconfig 11 | 12 | [![NPM version](https://img.shields.io/npm/v/generate-editorconfig.svg?style=flat)](https://www.npmjs.com/package/generate-editorconfig) [![NPM downloads](https://img.shields.io/npm/dm/generate-editorconfig.svg?style=flat)](https://npmjs.org/package/generate-editorconfig) [![Build Status](https://img.shields.io/travis/generate/generate-editorconfig.svg?style=flat)](https://travis-ci.org/generate/generate-editorconfig) 13 | 14 | ![generate-editorconfig demo](https://raw.githubusercontent.com/generate/generate-editorconfig/master/docs/demo.gif) 15 | 16 | ## What is "Generate"? 17 | 18 | Generate is a command line tool and developer framework for scaffolding out new GitHub projects using [generators](https://github.com/generate/generate/blob/master/docs/generators.md) and [tasks](https://github.com/generate/generate/blob/master/docs/tasks.md). 19 | 20 | Answers to prompts and the user's environment can be used to determine the templates, directories, files and contents to build. Support for [gulp](http://gulpjs.com), [base](https://github.com/node-base/base) and [assemble](https://github.com/assemble/assemble) plugins, and much more. 21 | 22 | **For more information**: 23 | 24 | * Visit the [generate project](https://github.com/generate/generate/) 25 | * Visit the [generate documentation](https://github.com/generate/generate/blob/master/docs/) 26 | * Find [generators on npm](https://www.npmjs.com/browse/keyword/generate-generator) (help us [author generators](https://github.com/generate/generate/blob/master/docs/micro-generators.md)) 27 | 28 | ## Getting started 29 | 30 | ### Install 31 | 32 | **Installing the CLI** 33 | 34 | To run the `editorconfig` generator from the command line, you'll need to install [Generate](https://github.com/generate/generate) globally first. You can do that now with the following command: 35 | 36 | ```sh 37 | $ npm install --global generate 38 | ``` 39 | 40 | This adds the `gen` command to your system path, allowing it to be run from any directory. 41 | 42 | **Install generate-editorconfig** 43 | 44 | Install this module with the following command: 45 | 46 | ```sh 47 | $ npm install --global generate-editorconfig 48 | ``` 49 | 50 | ### Usage 51 | 52 | Run this generator's `default` [task](https://github.com/generate/generate/blob/master/docs/tasks.md#default) with the following command: 53 | 54 | ```sh 55 | $ gen editorconfig 56 | ``` 57 | 58 | **What you should see in the terminal** 59 | 60 | If completed successfully, you should see both `starting` and `finished` events in the terminal, like the following: 61 | 62 | ```sh 63 | [00:44:21] starting ... 64 | ... 65 | [00:44:22] finished ✔ 66 | ``` 67 | 68 | If you do not see one or both of those events, please [let us know about it](../../issues). 69 | 70 | ### Help 71 | 72 | To see a general help menu and available commands for Generate's CLI, run: 73 | 74 | ```sh 75 | $ gen help 76 | ``` 77 | 78 | ## Tasks 79 | 80 | All available tasks. 81 | 82 | ### [editorconfig](generator.js#L21) 83 | 84 | Generates a `.editorconfig` file to the current working directory. You can override the default template by adding a custom template to the `templates` directory in user home, at the following path: `~/templates/_editorconfig` 85 | 86 | **Example** 87 | 88 | ```sh 89 | $ gen editorconfig 90 | ``` 91 | 92 | Visit Generate's [documentation for tasks](https://github.com/generate/generate/blob/master/docs/tasks.md). 93 | 94 | ## About 95 | 96 | ### Related projects 97 | 98 | * [generate-license](https://www.npmjs.com/package/generate-license): Generate a license file for a GitHub project. | [homepage](https://github.com/generate/generate-license "Generate a license file for a GitHub project.") 99 | * [generate-package](https://www.npmjs.com/package/generate-package): Generate a package.json from a pre-defined or user-defined template. This generator can be used from… [more](https://github.com/generate/generate-package) | [homepage](https://github.com/generate/generate-package "Generate a package.json from a pre-defined or user-defined template. This generator can be used from the command line when globally installed, or as a plugin or sub-generator in your own generator.") 100 | * [generate-readme](https://www.npmjs.com/package/generate-readme): Generate a README.md using answers to prompts and data from the environment, like `package.json`, `.git… [more](https://github.com/generate/generate-readme) | [homepage](https://github.com/generate/generate-readme "Generate a README.md using answers to prompts and data from the environment, like`package.json`,`.git` config, etc. This generator can be run by command line if Generate is installed globally, or you can use this as a plugin or sub-generator in your own") 101 | * [generate-travis](https://www.npmjs.com/package/generate-travis): Generate a .travis.yml file to the cwd or specified directory. Install globally and run with… [more](https://github.com/generate/generate-travis) | [homepage](https://github.com/generate/generate-travis "Generate a .travis.yml file to the cwd or specified directory. Install globally and run with generate's CLI, or use as a component in your own generator.") 102 | 103 | ### Community 104 | 105 | Are you using [Generate](https://github.com/generate/generate) in your project? Have you published a [generator](https://github.com/generate/generate/blob/master/docs/generators.md) and want to share your project with the world? 106 | 107 | Here are some suggestions! 108 | 109 | * If you get like Generate and want to tweet about it, please feel free to mention `@generatejs` or use the `#generatejs` hashtag 110 | * Show your love by starring [Generate](https://github.com/generate/generate) and `generate-editorconfig` 111 | * Get implementation help on [StackOverflow](http://stackoverflow.com/questions/tagged/generate) (please use the `generatejs` tag in questions) 112 | * **Gitter** Discuss Generate with us on [Gitter](https://gitter.im/generate/generate) 113 | * If you publish an generator, thank you! To make your project as discoverable as possible, please add the keyword `generategenerator` to package.json. 114 | 115 | ### Contributing 116 | 117 | Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). 118 | 119 | ### Running tests 120 | 121 | Install dev dependencies: 122 | 123 | ```sh 124 | $ npm install -d && npm test 125 | ``` 126 | 127 | ### Author 128 | 129 | **Jon Schlinkert** 130 | 131 | * [github/jonschlinkert](https://github.com/jonschlinkert) 132 | * [twitter/jonschlinkert](http://twitter.com/jonschlinkert) 133 | 134 | ### License 135 | 136 | Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). 137 | Released under the [MIT license](https://github.com/generate/generate-editorconfig/blob/master/LICENSE). 138 | 139 | *** 140 | 141 | _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on August 17, 2016._ -------------------------------------------------------------------------------- /docs/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/generate/generate-editorconfig/2ac0859a321c53ce2a5f6de1991b11766d9e7a51/docs/demo.gif -------------------------------------------------------------------------------- /generator.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var isValid = require('is-valid-app'); 4 | 5 | module.exports = function(app) { 6 | // return if the generator is already registered 7 | if (!isValid(app, 'generate-editorconfig')) return; 8 | 9 | /** 10 | * Generates a `.editorconfig` file to the current working directory. You can override 11 | * the default template by adding a custom template to the `templates` directory in 12 | * user home, at the following path: `~/templates/_editorconfig` 13 | * 14 | * ```sh 15 | * $ gen editorconfig 16 | * ``` 17 | * @name editorconfig 18 | * @api public 19 | */ 20 | 21 | app.task('default', ['editorconfig']); 22 | app.task('editorconfig', function(cb) { 23 | return app.src('templates/_editorconfig', { cwd: __dirname }) 24 | .pipe(app.conflicts(app.cwd)) 25 | .pipe(app.dest(function(file) { 26 | file.basename = '.editorconfig'; 27 | return app.cwd; 28 | })) 29 | }); 30 | }; 31 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./generator'); 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "generate-editorconfig", 3 | "description": "The generator creates a `.editorconfig` file in the current working directory. Run from the command line or register as a sub-generator or plugin in your own generator.", 4 | "version": "0.2.1", 5 | "homepage": "https://github.com/generate/generate-editorconfig", 6 | "author": "Jon Schlinkert (https://github.com/jonschlinkert)", 7 | "repository": "generate/generate-editorconfig", 8 | "bugs": { 9 | "url": "https://github.com/generate/generate-editorconfig/issues" 10 | }, 11 | "license": "MIT", 12 | "files": [ 13 | "generator.js", 14 | "index.js", 15 | "LICENSE", 16 | "README.md", 17 | "templates" 18 | ], 19 | "main": "index.js", 20 | "engines": { 21 | "node": ">=5.0" 22 | }, 23 | "scripts": { 24 | "test": "mocha" 25 | }, 26 | "dependencies": { 27 | "is-valid-app": "^0.2.0" 28 | }, 29 | "devDependencies": { 30 | "delete": "^0.3.2", 31 | "generate": "^0.10.0", 32 | "global-modules": "^0.2.3", 33 | "gulp-format-md": "^0.1.10", 34 | "mocha": "^3.0.2", 35 | "npm-install-global": "^0.1.2" 36 | }, 37 | "keywords": [ 38 | "app", 39 | "boilerplate", 40 | "build", 41 | "cli", 42 | "cli-app", 43 | "command-line", 44 | "create", 45 | "dev", 46 | "development", 47 | "editorconfig", 48 | "framework", 49 | "front", 50 | "frontend", 51 | "generate", 52 | "generate-generator", 53 | "generate-plugin", 54 | "generategenerator", 55 | "generateplugin", 56 | "generator", 57 | "init", 58 | "initialize", 59 | "new", 60 | "plugin", 61 | "project", 62 | "projects", 63 | "scaffold", 64 | "scaffolder", 65 | "scaffolding", 66 | "template", 67 | "templates", 68 | "tool", 69 | "web", 70 | "webapp", 71 | "yeoman", 72 | "yo" 73 | ], 74 | "verb": { 75 | "toc": false, 76 | "layout": "generator", 77 | "tasks": [ 78 | "readme" 79 | ], 80 | "plugins": [ 81 | "gulp-format-md" 82 | ], 83 | "related": { 84 | "list": [ 85 | "generate-license", 86 | "generate-package", 87 | "generate-readme", 88 | "generate-travis" 89 | ] 90 | }, 91 | "reflinks": [ 92 | "assemble", 93 | "base", 94 | "generate", 95 | "generate-dest", 96 | "gulp", 97 | "verb", 98 | "verb-readme-generator" 99 | ], 100 | "lint": { 101 | "reflinks": true 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /templates/_editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.md] 11 | trim_trailing_whitespace = false 12 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('mocha'); 4 | var fs = require('fs'); 5 | var path = require('path'); 6 | var assert = require('assert'); 7 | var generate = require('generate'); 8 | var npm = require('npm-install-global'); 9 | var gm = require('global-modules'); 10 | var del = require('delete'); 11 | var generator = require('./'); 12 | var app; 13 | 14 | var actual = path.resolve.bind(path, __dirname, 'actual'); 15 | function symlink(dir, cb) { 16 | var src = path.resolve(dir); 17 | var name = path.basename(src); 18 | var dest = path.resolve(gm, name); 19 | fs.stat(dest, function(err, stat) { 20 | if (err) { 21 | fs.symlink(src, dest, cb); 22 | } else { 23 | cb(); 24 | } 25 | }); 26 | } 27 | 28 | function exists(name, cb) { 29 | return function(err) { 30 | if (err) return cb(err); 31 | var filepath = actual(name); 32 | fs.stat(filepath, function(err, stat) { 33 | if (err) return cb(err); 34 | assert(stat); 35 | cb(); 36 | }); 37 | }; 38 | } 39 | 40 | describe('generate-editorconfig', function() { 41 | if (!process.env.CI && !process.env.TRAVIS) { 42 | before(function(cb) { 43 | npm.maybeInstall('generate', cb); 44 | }); 45 | } 46 | 47 | beforeEach(function() { 48 | app = generate({silent: true}); 49 | app.option('dest', actual()); 50 | app.cwd = actual(); 51 | }); 52 | 53 | afterEach(function(cb) { 54 | del(actual(), cb); 55 | }); 56 | 57 | describe('plugin', function() { 58 | it('should only register the plugin once', function(cb) { 59 | var count = 0; 60 | app.on('plugin', function(name) { 61 | if (name === 'generate-editorconfig') { 62 | count++; 63 | } 64 | }); 65 | app.use(generator); 66 | app.use(generator); 67 | app.use(generator); 68 | assert.equal(count, 1); 69 | cb(); 70 | }); 71 | 72 | it('should extend tasks onto the instance', function() { 73 | app.use(generator); 74 | assert(app.tasks.hasOwnProperty('default')); 75 | assert(app.tasks.hasOwnProperty('editorconfig')); 76 | }); 77 | 78 | it('should run the `default` task with .build', function(cb) { 79 | app.use(generator); 80 | app.build('default', exists('.editorconfig', cb)); 81 | }); 82 | 83 | it('should run the `default` task with .generate', function(cb) { 84 | app.use(generator); 85 | app.generate('default', exists('.editorconfig', cb)); 86 | }); 87 | 88 | it('should run the `editorconfig` task with .build', function(cb) { 89 | app.use(generator); 90 | app.build('editorconfig', exists('.editorconfig', cb)); 91 | }); 92 | 93 | it('should run the `editorconfig` task with .generate', function(cb) { 94 | app.use(generator); 95 | app.generate('editorconfig', exists('.editorconfig', cb)); 96 | }); 97 | }); 98 | 99 | if (!process.env.CI && !process.env.TRAVIS) { 100 | describe('generator (CLI)', function() { 101 | before(function(cb) { 102 | symlink(__dirname, cb); 103 | }); 104 | 105 | it('should run the default task using the `generate-editorconfig` name', function(cb) { 106 | app.use(generator); 107 | app.generate('generate-editorconfig', exists('.editorconfig', cb)); 108 | }); 109 | 110 | it('should run the default task using the `editorconfig` generator alias', function(cb) { 111 | app.use(generator); 112 | app.generate('editorconfig', exists('.editorconfig', cb)); 113 | }); 114 | }); 115 | } 116 | 117 | describe('generator (API)', function() { 118 | it('should run the default task on the generator', function(cb) { 119 | app.register('editorconfig', generator); 120 | app.generate('editorconfig', exists('.editorconfig', cb)); 121 | }); 122 | 123 | it('should run the `editorconfig` task', function(cb) { 124 | app.register('editorconfig', generator); 125 | app.generate('editorconfig:editorconfig', exists('.editorconfig', cb)); 126 | }); 127 | 128 | it('should run the `default` task when defined explicitly', function(cb) { 129 | app.register('editorconfig', generator); 130 | app.generate('editorconfig:default', exists('.editorconfig', cb)); 131 | }); 132 | }); 133 | 134 | describe('sub-generator', function() { 135 | it('should work as a sub-generator', function(cb) { 136 | app.register('foo', function(foo) { 137 | foo.register('editorconfig', generator); 138 | }); 139 | app.generate('foo.editorconfig', exists('.editorconfig', cb)); 140 | }); 141 | 142 | it('should run the `default` task by default', function(cb) { 143 | app.register('foo', function(foo) { 144 | foo.register('editorconfig', generator); 145 | }); 146 | app.generate('foo.editorconfig', exists('.editorconfig', cb)); 147 | }); 148 | 149 | it('should run the `editorconfig:default` task when defined explicitly', function(cb) { 150 | app.register('foo', function(foo) { 151 | foo.register('editorconfig', generator); 152 | }); 153 | app.generate('foo.editorconfig:default', exists('.editorconfig', cb)); 154 | }); 155 | 156 | it('should run the `editorconfig:editorconfig` task', function(cb) { 157 | app.register('foo', function(foo) { 158 | foo.register('editorconfig', generator); 159 | }); 160 | app.generate('foo.editorconfig:editorconfig', exists('.editorconfig', cb)); 161 | }); 162 | 163 | it('should work with nested sub-generators', function(cb) { 164 | app 165 | .register('foo', generator) 166 | .register('bar', generator) 167 | .register('baz', generator) 168 | 169 | app.generate('foo.bar.baz', exists('.editorconfig', cb)); 170 | }); 171 | }); 172 | }); 173 | --------------------------------------------------------------------------------