Skip to content

Commit

Permalink
Merge pull request #33 from assemble/develop
Browse files Browse the repository at this point in the history
v0.4.6
  • Loading branch information
hariadi committed Jan 12, 2014
2 parents 163d13c + fb8703c commit 2f9f76a
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 28 deletions.
11 changes: 2 additions & 9 deletions app/USAGE
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
Description:
Creates a default Assemble app

Options:
--skip-install: Skips the automatic execution of `bower` and `npm`
after scaffolding has finished.
--s: alias --skip-install

Example:
yo assemble [--skip-install] [--silent]
yo assemble --init --skip-install --skip-welcome-message
yo assemble -i -s -w (alias)
24 changes: 23 additions & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ var AssembleGenerator = module.exports = function AssembleGenerator(args, option

yeoman.generators.Base.apply(this, arguments);

this.description = 'Creates a default Assemble boilerplate';

// Not required but need to show when user command `yo assemble -h`
this.option('init', {
alias: 'i',
desc: 'Force to prompt question and re-initialize of .yo-rc.json',
type: String,
defaults: false,
required: false
});

this.init = options['init'] || options['i'] || false;

this.on('end', function () {
this.installDependencies({
skipInstall: options['skip-install'] || options['s'],
Expand Down Expand Up @@ -56,7 +69,8 @@ AssembleGenerator.prototype.askFor = function askFor() {
var done = this.async();

var force = false;
if (!this.config.existed) {

if (!this.config.existed || this.init) {
force = true;
}

Expand All @@ -73,6 +87,13 @@ AssembleGenerator.prototype.askFor = function askFor() {
default : this.appname
});

(!this.config.get("projectDesc") || force) && questions.push({
type : "input",
name : "projectDesc",
message : "Your project description",
default : this.config.get("projectDesc")
});

(!this.config.get("githubUser") || force) && questions.push({
type : "input",
name : "githubUser",
Expand Down Expand Up @@ -107,6 +128,7 @@ AssembleGenerator.prototype.askFor = function askFor() {
this.prompt(questions, function (answers) {

this.projectName = answers.projectName || this.config.get("projectName");
this.projectDesc = answers.projectDesc || this.config.get("projectDesc");
this.authorLogin = answers.githubUser || this.config.get("githubUser");
this.plugin = answers.plugin;
this.authorName = this.config.get("author").name;
Expand Down
16 changes: 12 additions & 4 deletions app/templates/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# assemble
# <%= _.slugify(projectName) %>

> Assemble a website from templates and data.
> <%= _.capitalize(projectDesc) %>.
## [Assemble](http://assemble.io/)

Assemble is a component and static site generator that makes it dead simple to build modular sites, documentation and components from reusable templates and data.

* Documentation
* Plugins - Plugins extend the core functionality of Assemble.
* Helpers - Documentation for the helpers in the [handlebars-helpers](http://github.com/assemble/handlebars-helpers) library.

## Contributing
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][http://gruntjs.com/].
All contributions are welcome! The simplest way to show your support for this project is to **"star" it**. Please see [Contributing to Assemble](http://assemble.io/contributing) for more information.

## Release History
_(Nothing yet)_
* <%= (new Date).toISOString().split('T')[0] %>   v0.1.0   Generated by the [Yeoman Generator](https://github.com/assemble/generator-assemble) for [Assemble](http://assemble.io)
14 changes: 7 additions & 7 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "<%= _.slugify(projectName) %>",
"description": "Assemble a website from templates and data.",
"description": "<%= _.capitalize(projectDesc) %>.",
"version": "0.1.0",
"homepage": "http://assemble.io",
"homepage": "https://github.com/<%= authorLogin %>/<%= _.slugify(projectName) %>",
"author": {
"name": "<%= authorName %>",
"url": "http://github.com/<%= authorLogin %>/"
Expand All @@ -21,13 +21,13 @@
"test": "grunt assemble"
},
"devDependencies": {
"assemble": "~0.4.22",
"grunt": "~0.4.1",
"assemble": "~0.4.33",
"grunt": "~0.4.2",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-connect": "~0.5.0",
"grunt-contrib-connect": "~0.6.0",
"grunt-contrib-watch": "~0.5.3",
"load-grunt-tasks": "~0.1.3",
"time-grunt": "~0.1.1"<% if(plugin && plugin.length > 0){ %>,
"load-grunt-tasks": "~0.2.1",
"time-grunt": "~0.2.7"<% if(plugin && plugin.length > 0){ %>,
<% if(typeof plugin === 'object'){ _.each(plugin, function(name, i) { %>
"<%= name %>": "*"<% if(i < (plugin.length - 1)) { %>,<% } %>
<% }); } else { %>
Expand Down
6 changes: 3 additions & 3 deletions app/templates/src/templates/layouts/default.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</head>
<body>

<!-- Navbar
<!-- Navbar
================================================== -->
{{> navbar-fixed-top }}

Expand All @@ -31,6 +31,6 @@
{{> body }}
</div>

<script src="{{assets}}/js/highlight.js"></script>
<script src="{{assets}}/highlight.js"></script>
</body>
</html>
</html>
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-assemble",
"version": "0.4.5",
"version": "0.4.6",
"description": "The scaffolding for Assemble",
"keywords": [
"yeoman-generator",
Expand All @@ -23,10 +23,10 @@
"test": "mocha --reporter spec"
},
"dependencies": {
"yeoman-generator": "~0.15.0"
"yeoman-generator": "~0.16.0"
},
"devDependencies": {
"mocha": "~1.16.2"
"mocha": "*"
},
"peerDependencies": {
"yo": ">=1.0.4"
Expand Down
2 changes: 1 addition & 1 deletion test/test-creation.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Assemble generator', function () {
});

this.app.run({}, function () {
helpers.assertFiles(expected);
helpers.assertFile(expected);
done();
});
});
Expand Down

0 comments on commit 2f9f76a

Please sign in to comment.