Skip to content

Commit

Permalink
chore(gen): update yeoman-generator to ~0.20.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kingcody committed Sep 9, 2015
1 parent 4511e7c commit 2c98c91
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 28 deletions.
1 change: 0 additions & 1 deletion app/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export default class Generator extends Base {
return {

init: function () {
this.pkg = require('../package.json');
this.filters = {};

// init shared generator properies and methods
Expand Down
2 changes: 1 addition & 1 deletion app/templates/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %>
// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= rootGeneratorName() %> <%= rootGeneratorVersion() %>
'use strict';

module.exports = function (grunt) {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# <%= lodash.slugify(lodash.humanize(appname)) %>

This project was generated with the [Angular Full-Stack Generator](https://github.com/DaftMonk/generator-angular-fullstack) version <%= pkg.version %>.
This project was generated with the [Angular Full-Stack Generator](https://github.com/DaftMonk/generator-angular-fullstack) version <%= rootGeneratorVersion() %>.

## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion app/templates/client/app/app(coffee).coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

angular.module '<%= scriptAppName %>', [<%= angularModules %>]
angular.module '<%= scriptAppName %>', [<%- angularModules %>]
<% if (filters.ngroute) { %>.config ($routeProvider, $locationProvider<% if (filters.auth) { %>, $httpProvider<% } %>) ->
$routeProvider
.otherwise
Expand Down
2 changes: 1 addition & 1 deletion app/templates/client/app/app(js).js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

angular.module('<%= scriptAppName %>', [<%= angularModules %>])
angular.module('<%= scriptAppName %>', [<%- angularModules %>])
<% if (filters.ngroute) { %>.config(function($routeProvider, $locationProvider<% if (filters.auth) { %>, $httpProvider<% } %>) {
$routeProvider
.otherwise({
Expand Down
2 changes: 1 addition & 1 deletion app/templates/client/components/footer/footer(html).html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="container">
<p>Angular Fullstack v<%= pkg.version %> |
<p>Angular Fullstack v<%= rootGeneratorVersion() %> |
<a href="https://twitter.com/tyhenkel">@tyhenkel</a> |
<a href="https://github.com/DaftMonk/generator-angular-fullstack/issues?state=open">Issues</a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/client/components/footer/footer(jade).jade
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.container
p
| Angular Fullstack v<%= pkg.version %>
| Angular Fullstack v<%= rootGeneratorVersion() %>
= ' | '
a(href='https://twitter.com/tyhenkel') @tyhenkel
= ' | '
Expand Down
9 changes: 3 additions & 6 deletions generator-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ export function genBase(self) {
self.lodash = lodash;
self.yoWelcome = yoWelcome;

try {
self.appname = require(path.join(process.cwd(), 'bower.json')).name;
} catch (e) {
self.appname = self.name || path.basename(process.cwd());
}
self.appname = lodash.camelize(lodash.slugify(lodash.humanize(self.appname)));
self.appname = lodash.camelize(lodash.slugify(
lodash.humanize(self.determineAppname())
));
self.scriptAppName = self.appname + genUtils.appSuffix(self);

self.filters = self.filters || self.config.get('filters');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"glob": "^5.0.14",
"lodash": "^3.10.1",
"underscore.string": "^3.1.1",
"yeoman-generator": "~0.19.2",
"yeoman-generator": "~0.20.3",
"yeoman-welcome": "^1.0.1"
},
"devDependencies": {
Expand Down
18 changes: 4 additions & 14 deletions util.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,9 @@ export function appSuffix(self) {
return (typeof suffix === 'string') ? self.lodash.classify(suffix) : '';
}

function destinationPath(self, filepath) {
filepath = path.normalize(filepath);
if (!path.isAbsolute(filepath)) {
filepath = path.join(self.destinationRoot(), filepath);
}

return filepath;
}

export function relativeRequire(to, fr) {
var self = this;
fr = destinationPath(self, fr || self.filePath);
to = destinationPath(self, to);
fr = this.destinationPath(fr || this.filePath);
to = this.destinationPath(to);
return path.relative(path.dirname(fr), to)
.replace(/\\/g, '/') // convert win32 separator to posix
.replace(/^(?!\.\.)(.*)/, './$1') // prefix non parent path with ./
Expand Down Expand Up @@ -148,10 +138,10 @@ export function processDirectory(source, destination) {

if(templateIsUsable(self, filteredFile)) {
if(copy) {
self.copy(src, dest);
self.fs.copy(src, dest);
} else {
self.filePath = dest;
self.template(src, dest);
self.fs.copyTpl(src, dest, self);
delete self.filePath;
}
}
Expand Down

0 comments on commit 2c98c91

Please sign in to comment.