Skip to content

Commit 67f7e05

Browse files
committed
Initial commit
0 parents  commit 67f7e05

File tree

11 files changed

+251
-0
lines changed

11 files changed

+251
-0
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
coverage

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: node_js
2+
node_js:
3+
- v7
4+
- v6
5+
- v5
6+
- v4
7+
- '0.12'

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 Ravindra Kumar <[email protected]> (https://github.com/ravidsrk)
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.

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# generator-android-tdd [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
2+
> [Yeoman Generator] Generate Android App using AndroidTDDBootStrap https://github.com/Piasy/AndroidTDDBootStrap
3+
4+
## Installation
5+
6+
First, install [Yeoman](http://yeoman.io) and generator-android-tdd using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).
7+
8+
```bash
9+
npm install -g yo
10+
npm install -g generator-android-tdd
11+
```
12+
13+
Then generate your new project:
14+
15+
```bash
16+
yo android-tdd
17+
```
18+
19+
## Getting To Know Yeoman
20+
21+
* Yeoman has a heart of gold.
22+
* Yeoman is a person with feelings and opinions, but is very easy to work with.
23+
* Yeoman can be too opinionated at times but is easily convinced not to be.
24+
* Feel free to [learn more about Yeoman](http://yeoman.io/).
25+
26+
## License
27+
28+
MIT © [Ravindra Kumar](https://github.com/ravidsrk)
29+
30+
31+
[npm-image]: https://badge.fury.io/js/generator-android-tdd.svg
32+
[npm-url]: https://npmjs.org/package/generator-android-tdd
33+
[travis-image]: https://travis-ci.org/ravidsrk/generator-android-tdd.svg?branch=master
34+
[travis-url]: https://travis-ci.org/ravidsrk/generator-android-tdd
35+
[daviddm-image]: https://david-dm.org/ravidsrk/generator-android-tdd.svg?theme=shields.io
36+
[daviddm-url]: https://david-dm.org/ravidsrk/generator-android-tdd
37+
[coveralls-image]: https://coveralls.io/repos/ravidsrk/generator-android-tdd/badge.svg
38+
[coveralls-url]: https://coveralls.io/r/ravidsrk/generator-android-tdd

generators/app/index.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
'use strict';
2+
var Generator = require('yeoman-generator');
3+
var chalk = require('chalk');
4+
var yosay = require('yosay');
5+
6+
module.exports = Generator.extend({
7+
prompting: function () {
8+
// Have Yeoman greet the user.
9+
this.log(yosay(
10+
'Welcome to the majestic ' + chalk.red('generator-android-tdd') + ' generator!'
11+
));
12+
13+
var prompts = [{
14+
type: 'confirm',
15+
name: 'someAnswer',
16+
message: 'Would you like to enable this option?',
17+
default: true
18+
}];
19+
20+
return this.prompt(prompts).then(function (props) {
21+
// To access props later use this.props.someAnswer;
22+
this.props = props;
23+
}.bind(this));
24+
},
25+
26+
writing: function () {
27+
this.fs.copy(
28+
this.templatePath('dummyfile.txt'),
29+
this.destinationPath('dummyfile.txt')
30+
);
31+
},
32+
33+
install: function () {
34+
this.installDependencies();
35+
}
36+
});

generators/app/templates/dummyfile.txt

Whitespace-only changes.

gulpfile.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
'use strict';
2+
var path = require('path');
3+
var gulp = require('gulp');
4+
var eslint = require('gulp-eslint');
5+
var excludeGitignore = require('gulp-exclude-gitignore');
6+
var mocha = require('gulp-mocha');
7+
var istanbul = require('gulp-istanbul');
8+
var nsp = require('gulp-nsp');
9+
var plumber = require('gulp-plumber');
10+
var coveralls = require('gulp-coveralls');
11+
12+
gulp.task('static', function () {
13+
return gulp.src('**/*.js')
14+
.pipe(excludeGitignore())
15+
.pipe(eslint())
16+
.pipe(eslint.format())
17+
.pipe(eslint.failAfterError());
18+
});
19+
20+
gulp.task('nsp', function (cb) {
21+
nsp({package: path.resolve('package.json')}, cb);
22+
});
23+
24+
gulp.task('pre-test', function () {
25+
return gulp.src('generators/**/*.js')
26+
.pipe(excludeGitignore())
27+
.pipe(istanbul({
28+
includeUntested: true
29+
}))
30+
.pipe(istanbul.hookRequire());
31+
});
32+
33+
gulp.task('test', ['pre-test'], function (cb) {
34+
var mochaErr;
35+
36+
gulp.src('test/**/*.js')
37+
.pipe(plumber())
38+
.pipe(mocha({reporter: 'spec'}))
39+
.on('error', function (err) {
40+
mochaErr = err;
41+
})
42+
.pipe(istanbul.writeReports())
43+
.on('end', function () {
44+
cb(mochaErr);
45+
});
46+
});
47+
48+
gulp.task('watch', function () {
49+
gulp.watch(['generators/**/*.js', 'test/**'], ['test']);
50+
});
51+
52+
gulp.task('coveralls', ['test'], function () {
53+
if (!process.env.CI) {
54+
return;
55+
}
56+
57+
return gulp.src(path.join(__dirname, 'coverage/lcov.info'))
58+
.pipe(coveralls());
59+
});
60+
61+
gulp.task('prepublish', ['nsp']);
62+
gulp.task('default', ['static', 'test', 'coveralls']);

package.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "generator-android-tdd",
3+
"version": "0.0.0",
4+
"description": "[Yeoman Generator] Generate Android App using AndroidTDDBootStrap https://github.com/Piasy/AndroidTDDBootStrap",
5+
"homepage": "https://github.com/ravidsrk/generator-android-tdd",
6+
"author": {
7+
"name": "Ravindra Kumar",
8+
"email": "[email protected]",
9+
"url": "https://github.com/ravidsrk"
10+
},
11+
"files": [
12+
"generators"
13+
],
14+
"main": "generators/index.js",
15+
"keywords": [
16+
"android",
17+
"tdd",
18+
"bootstrap",
19+
"mvp",
20+
"buck",
21+
"yeoman-generator"
22+
],
23+
"dependencies": {
24+
"yeoman-generator": "^1.0.0",
25+
"chalk": "^1.1.3",
26+
"yosay": "^1.2.1"
27+
},
28+
"devDependencies": {
29+
"yeoman-test": "^1.6.0",
30+
"yeoman-assert": "^2.2.1",
31+
"eslint": "^3.1.1",
32+
"eslint-config-xo-space": "^0.15.0",
33+
"gulp": "^3.9.0",
34+
"gulp-eslint": "^3.0.1",
35+
"gulp-exclude-gitignore": "^1.0.0",
36+
"gulp-line-ending-corrector": "^1.0.1",
37+
"gulp-istanbul": "^1.0.0",
38+
"gulp-mocha": "^3.0.1",
39+
"gulp-plumber": "^1.0.0",
40+
"gulp-nsp": "^2.1.0",
41+
"gulp-coveralls": "^0.1.0"
42+
},
43+
"eslintConfig": {
44+
"extends": "xo-space",
45+
"env": {
46+
"mocha": true
47+
}
48+
},
49+
"repository": "ravidsrk/generator-android-tdd",
50+
"scripts": {
51+
"prepublish": "gulp prepublish",
52+
"test": "gulp"
53+
},
54+
"license": "MIT"
55+
}

test/app.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict';
2+
var path = require('path');
3+
var assert = require('yeoman-assert');
4+
var helpers = require('yeoman-test');
5+
6+
describe('generator-android-tdd:app', function () {
7+
before(function () {
8+
return helpers.run(path.join(__dirname, '../generators/app'))
9+
.withPrompts({someAnswer: true})
10+
.toPromise();
11+
});
12+
13+
it('creates files', function () {
14+
assert.file([
15+
'dummyfile.txt'
16+
]);
17+
});
18+
});

0 commit comments

Comments
 (0)