Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] error when trailing slash present in argument to generator #1184

Merged

Conversation

rondale-sc
Copy link
Contributor

This PR provides a hook inside the Blueprint install function that by default throws and error when there is a trailing slash in the argument to ember generate. This can be overridden within each individual blueprint by overriding the normalizeEntityName function inside the constructor for that blueprint.

Let me know what you think.

resolves #1164

@param {String} entityName
@return {null}
*/
Blueprint.prototype.normalizeEntityName = function(ui, entityName) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that ui is not needed, it is set as a prop on the blueprint instance when instantiated, so even if a downstream blueprint wanted it, it would just use this.ui.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, as is, the params listed in the docs are incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely. I added the ui param before I realized that there is a catch that prints errors through ui in red. Fixed!

Good catch! :)

@stefanpenner
Copy link
Contributor

LGTM

@jgwhite
Copy link
Contributor

jgwhite commented Jun 28, 2014

This is awesome. Great work!

rwjblue added a commit that referenced this pull request Jun 28, 2014
…error

[BUGFIX] error when trailing slash present in argument to generator
@rwjblue rwjblue merged commit 833b1c6 into ember-cli:master Jun 28, 2014
@rwjblue
Copy link
Member

rwjblue commented Jun 28, 2014

Awesome, thanks!

@rondale-sc
Copy link
Contributor Author

😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Api stub generation: wrong file name.
4 participants