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

Change behaviour of standardLocals in blueprints for slashes #1278

Merged
merged 1 commit into from
Jul 16, 2014

Conversation

kimroen
Copy link
Contributor

@kimroen kimroen commented Jul 5, 2014

This PR strips the slash from some of the standard locals in blueprints.

An example of before and after with the command ember generate view foo-bar/baz-qux:

Variable Before After
dasherizedModuleName foo-bar/baz-qux foo-bar/baz-qux
classifiedModuleName FooBar/bazQux FooBarBazQux
camelizedModuleName fooBar/bazQux fooBarBazQuix

dasherizedModuleName is left alone, as that is used for the generation of the files themselves.
See the new tests for details on how this affects all the different included generators. (It is most obvious in the generated tests).

classifiedPackageName should probably also be changed, but I don't know any usecases for it right now.

@jgwhite
Copy link
Contributor

jgwhite commented Jul 5, 2014

Looks good to me. The test coverage for generators/blueprints is certainly thorough 😄

assertFile('tests/unit/models/foo/bar-test.js', {
contains: [
"import { test, moduleForModel } from 'ember-qunit';",
"moduleForModel('foo/bar', 'FooBar'"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just use the dasherization full name here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test is testing for what the actual output is - are you suggesting changing the output from the command or the test? (I'm assuming you're talking about the description here)

Copy link
Contributor

Choose a reason for hiding this comment

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

yes

@kimroen
Copy link
Contributor Author

kimroen commented Jul 8, 2014

Are we waiting for something on this, or just not gotten around to it yet?

I realize not all the tests necessarily reflect the desired outcome from generate commands for directories, they only show what this change does.

Would it be better if I removed the tests that don't reflect what we want in the end?

We should do more work on directories in generators, but changing these variables is a pretty good first step.

@stefanpenner
Copy link
Contributor

havent had a chance to review.

@rwjblue
Copy link
Member

rwjblue commented Jul 16, 2014

Can you add a changelog entry, squash, and rebase?

@kimroen
Copy link
Contributor Author

kimroen commented Jul 16, 2014

Done

rwjblue added a commit that referenced this pull request Jul 16, 2014
Change behaviour of standardLocals in blueprints for slashes
@rwjblue rwjblue merged commit 46c3693 into ember-cli:master Jul 16, 2014
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.

None yet

4 participants