Permalink
Browse files

Initial Commit

  • Loading branch information...
0 parents commit f332c201e65e4c6f70e808277cbdf0ba1d7ea4bc @benmcginnis benmcginnis committed Oct 22, 2013
Showing with 297 additions and 0 deletions.
  1. +13 −0 .editorconfig
  2. +1 −0 .gitattributes
  3. +2 −0 .gitignore
  4. +21 −0 .jshintrc
  5. +4 −0 .travis.yml
  6. +20 −0 LICENSE
  7. +47 −0 README.md
  8. +50 −0 app/index.js
  9. +6 −0 app/templates/_bower.json
  10. +5 −0 app/templates/_package.json
  11. +13 −0 app/templates/editorconfig
  12. +21 −0 app/templates/jshintrc
  13. +4 −0 app/templates/travis.yml
  14. +41 −0 package.json
  15. +38 −0 test/test-creation.js
  16. +11 −0 test/test-load.js
@@ -0,0 +1,13 @@
+# http://editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 4
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+trim_trailing_whitespace = false
@@ -0,0 +1 @@
+* text=auto
@@ -0,0 +1,2 @@
+node_modules/
+temp/
@@ -0,0 +1,21 @@
+{
+ "node": true,
+ "esnext": true,
+ "bitwise": true,
+ "camelcase": true,
+ "curly": true,
+ "eqeqeq": true,
+ "immed": true,
+ "indent": 4,
+ "latedef": true,
+ "newcap": true,
+ "noarg": true,
+ "quotmark": "single",
+ "regexp": true,
+ "undef": true,
+ "unused": true,
+ "strict": true,
+ "trailing": true,
+ "smarttabs": true,
+ "white": true
+}
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - '0.8'
+ - '0.10'
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright 2013
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,47 @@
+# generator-drupal-bootstrap-theme [![Build Status](https://secure.travis-ci.org/benmcginnis/generator-drupal-bootstrap-theme.png?branch=master)](https://travis-ci.org/benmcginnis/generator-drupal-bootstrap-theme)
+
+A generator for [Yeoman](http://yeoman.io).
+
+
+## Getting Started
+
+### What is Yeoman?
+
+Trick question. It's not a thing. It's this guy:
+
+![](http://i.imgur.com/JHaAlBJ.png)
+
+Basically, he wears a top hat, lives in your computer, and waits for you to tell him what kind of application you wish to create.
+
+Not every new computer comes with a Yeoman pre-installed. He lives in the [npm](https://npmjs.org) package repository. You only have to ask for him once, then he packs up and moves into your hard drive. *Make sure you clean up, he likes new and shiny things.*
+
+```
+$ npm install -g yo
+```
+
+### Yeoman Generators
+
+Yeoman travels light. He didn't pack any generators when he moved in. You can think of a generator like a plug-in. You get to choose what type of application you wish to create, such as a Backbone application or even a Chrome extension.
+
+To install generator-drupal-bootstrap-theme from npm, run:
+
+```
+$ npm install -g generator-drupal-bootstrap-theme
+```
+
+Finally, initiate the generator:
+
+```
+$ yo drupal-bootstrap-theme
+```
+
+### Getting To Know Yeoman
+
+Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced.
+
+If you'd like to get to know Yeoman better and meet some of his friends, [Grunt](http://gruntjs.com) and [Bower](http://bower.io), check out the complete [Getting Started Guide](https://github.com/yeoman/yeoman/wiki/Getting-Started).
+
+
+## License
+
+[MIT License](http://en.wikipedia.org/wiki/MIT_License)
@@ -0,0 +1,50 @@
+'use strict';
+var util = require('util');
+var path = require('path');
+var yeoman = require('yeoman-generator');
+
+
+var DrupalBootstrapThemeGenerator = module.exports = function DrupalBootstrapThemeGenerator(args, options, config) {
+ yeoman.generators.Base.apply(this, arguments);
+
+ this.on('end', function () {
+ this.installDependencies({ skipInstall: options['skip-install'] });
+ });
+
+ this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
+};
+
+util.inherits(DrupalBootstrapThemeGenerator, yeoman.generators.Base);
+
+DrupalBootstrapThemeGenerator.prototype.askFor = function askFor() {
+ var cb = this.async();
+
+ // have Yeoman greet the user.
+ console.log(this.yeoman);
+
+ var prompts = [{
+ type: 'confirm',
+ name: 'someOption',
+ message: 'Would you like to enable this option?',
+ default: true
+ }];
+
+ this.prompt(prompts, function (props) {
+ this.someOption = props.someOption;
+
+ cb();
+ }.bind(this));
+};
+
+DrupalBootstrapThemeGenerator.prototype.app = function app() {
+ this.mkdir('app');
+ this.mkdir('app/templates');
+
+ this.copy('_package.json', 'package.json');
+ this.copy('_bower.json', 'bower.json');
+};
+
+DrupalBootstrapThemeGenerator.prototype.projectfiles = function projectfiles() {
+ this.copy('editorconfig', '.editorconfig');
+ this.copy('jshintrc', '.jshintrc');
+};
@@ -0,0 +1,6 @@
+{
+ "name": "package",
+ "version": "0.0.0",
+ "dependencies": {}
+}
+
@@ -0,0 +1,5 @@
+{
+ "name": "package",
+ "version": "0.0.0",
+ "dependencies": {}
+}
@@ -0,0 +1,13 @@
+# http://editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 4
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+trim_trailing_whitespace = false
@@ -0,0 +1,21 @@
+{
+ "node": true,
+ "esnext": true,
+ "bitwise": true,
+ "camelcase": true,
+ "curly": true,
+ "eqeqeq": true,
+ "immed": true,
+ "indent": 4,
+ "latedef": true,
+ "newcap": true,
+ "noarg": true,
+ "quotmark": "single",
+ "regexp": true,
+ "undef": true,
+ "unused": true,
+ "strict": true,
+ "trailing": true,
+ "smarttabs": true,
+ "white": true
+}
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - '0.8'
+ - '0.10'
@@ -0,0 +1,41 @@
+{
+ "name": "generator-drupal-bootstrap-theme",
+ "version": "0.0.0",
+ "description": "A generator for Yeoman",
+ "keywords": [
+ "yeoman-generator"
+ ],
+ "homepage": "https://github.com/benmcginnis/generator-drupal-bootstrap-theme",
+ "bugs": "https://github.com/benmcginnis/generator-drupal-bootstrap-theme/issues",
+ "author": {
+ "name": "",
+ "email": "",
+ "url": "https://github.com/benmcginnis"
+ },
+ "main": "app/index.js",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/benmcginnis/generator-drupal-bootstrap-theme.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "dependencies": {
+ "yeoman-generator": "~0.13.0"
+ },
+ "devDependencies": {
+ "mocha": "~1.12.0"
+ },
+ "peerDependencies": {
+ "yo": ">=1.0.0-rc.1"
+ },
+ "engines": {
+ "node": ">=0.8.0",
+ "npm": ">=1.2.10"
+ },
+ "licenses": [
+ {
+ "type": "MIT"
+ }
+ ]
+}
@@ -0,0 +1,38 @@
+/*global describe, beforeEach, it*/
+'use strict';
+
+var path = require('path');
+var helpers = require('yeoman-generator').test;
+
+
+describe('drupal-bootstrap-theme generator', function () {
+ beforeEach(function (done) {
+ helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
+ if (err) {
+ return done(err);
+ }
+
+ this.app = helpers.createGenerator('drupal-bootstrap-theme:app', [
+ '../../app'
+ ]);
+ done();
+ }.bind(this));
+ });
+
+ it('creates expected files', function (done) {
+ var expected = [
+ // add files you expect to exist here.
+ '.jshintrc',
+ '.editorconfig'
+ ];
+
+ helpers.mockPrompt(this.app, {
+ 'someOption': true
+ });
+ this.app.options['skip-install'] = true;
+ this.app.run({}, function () {
+ helpers.assertFiles(expected);
+ done();
+ });
+ });
+});
@@ -0,0 +1,11 @@
+/*global describe, beforeEach, it*/
+'use strict';
+
+var assert = require('assert');
+
+describe('drupal-bootstrap-theme generator', function () {
+ it('can be imported without blowing up', function () {
+ var app = require('../app');
+ assert(app !== undefined);
+ });
+});

0 comments on commit f332c20

Please sign in to comment.