rubymotion-community / BubbleWrap

Cocoa wrappers and helpers for RubyMotion (Ruby for iOS and OS X) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull requests
Other
1.18k stars 208 forks source link

BubbleWrap::Location overriding ::Location #464

Closed awernick closed 9 years ago

awernick commented 9 years ago

Having a Location class defined in a RubyMotion project, I noticed that BubbleWrap::Location overrides the local class. After digging around the source, I found the culprit: https://github.com/rubymotion/BubbleWrap/blob/aabbcd30c5bf841bffb623e15322d452b7e313c7/motion/location/location.rb#L237

Even tough BubbleWrap checks if the constant is defined, at runtime (or compile time?), the local constant has not been defined yet, so BubbleWrap overrides the constant.

markrickert commented 9 years ago

Yeah, I'm not sure why they did that... seems like defining a Location class without a namespace would cause collisions for a lot of people. It would be difficult for me to depreciate it anytime soon, so unfortunately you'll have to use a different class name for yours. Sorry :cry:

awernick commented 9 years ago

:sweat: alright. I was able to keep my class name by namespacing my model, but its kinda tedious having to write the whole namespace + class name sometimes. I guess I'll just have to modify my local of copy of the gem to solve my needs. @markrickert Thanks anyway!

markrickert commented 9 years ago

Sorry, bud.