-
Notifications
You must be signed in to change notification settings - Fork 208
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
Remove instantiating Device as BW::Device #355
base: master
Are you sure you want to change the base?
Conversation
I don't have a strong opinion either way, so pretty open to hear others thoughts (@markrickert @colinta etc) but two thoughts:
|
I use @Dexterv Can you provide an example of a gem that has a namespacing problem with the |
I think this is a sensible request, but we'll need an easy way to include the existing shorthands, so people can migrate easily. For instance a I'm of the opinion that BubbleWrap should try and remain non-polluting, I always liked that it wrapped APIs and did not change the objects directly (like SugarCube does). I see this as a smart step in that direction. |
@clayallsopp I feel the same for the @markrickert I ran into the namespacing problem with @colinta I'm definitely on board. I think giving the users the ability to namespace these classes themselves is a more friendly approach. It will also help prevent any management of loading paths in case there is a conflict. Thank you everyone for taking the time to consider this suggestion. |
Not the same, of course, but it's definitely not considered good practice to add a class to the global namespace without a prefix, that's Obj-C 101... we get away with it because it's Ruby. 😃 |
This will prevent namespace conflicts.
@clayallsopp I've made the update to the spec files. All is well on Travis CI build. Thank you. |
I'd like to suggest that we remove the convenience of instantiating Device as BW::Device if it is not defined.
The reason why is that this causes a name spacing problem that forces you to handle your load paths, which can cause a lot of headaches. Since BubbleWrap has already been shorten to BW, typing BW::Device isn't too far from typing Device.
It will also prevent other gems that rely on BW to explicitly call BW::Device instead of assuming that Device is BW::Device.
What do you think? I'd love to hear your thoughts on it.
Thank you!