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

Handle invalid or separator characters when making local names for dependencies #34

Closed
timriley opened this issue Nov 29, 2016 · 1 comment

Comments

@timriley
Copy link
Member

Right now we expect dependency names to use dots as delimiter characters, e.g. "my_app.foo.bar". We split the name up by the dots and use the last portion as the local name for the dependency (its instance variable and accessor method name).

We should expand on this so dependencies with other separator characters or otherwise invalid characters are handled appropriately.

We've had some discussion on this over in #23 (comment). My feeling is that something like this would be a reasonable approach:

I think it'd might be better if we just had a regex of invalid variable-name characters, split the container identifier on that regex, and then just use the last segment as the local variable name. What do you think? This seems fair to me, especially now that people can explicitly provide their own aliases for their injected dependencies too.

@timriley
Copy link
Member Author

Resolved in #39

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

No branches or pull requests

1 participant