-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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 Cask::Decorator #5769
Remove Cask::Decorator #5769
Conversation
@federicobond, it is indeed a fun bug. For those who weren't on IRC, there is an unexpected namespace collision between a Cask The reason that So, Interestingly, the bug is affected by #5365, though not exactly caused by it. I don't have the minimal fix worked out, but both
is sufficient to run
(The second parameter to const_get looked promising, but is apparently not what we need here.) |
Aha! Reverting #5365 is not needed. That was only helpful because that code also uses |
Hey peeps - @rolandwalker filled me in here. What an interesting bit of Ruby OO arcana! After getting caught up, I agree that we should change the
http://www.ruby-doc.org/core-1.9.3/Module.html#method-i-const_get I think it might be a little more idiomatic to use Here's an example to illustrate: # Simple class in top-level namespace
class Booger; end
# With const_get's inherit parameter at it's default of true
Kernel.const_get('Booger') # => Booger
Object.const_get('Booger') # => Booger
Booger.const_get('Booger') # => Booger
# Setting it to false illustrates that Object is really where the constant lies
Kernel.const_get('Booger', false) # => NameError: uninitialized constant Kernel::Booger
Object.const_get('Booger', false) # => Booger
Booger.const_get('Booger', false) # => NameError: uninitialized constant Booger::Booger You get similar results by examining the Great work digging into this, folks! 🚧 👷 |
That's great! Thanks for all the helpful answers. I'll submit another pull request with just the fix for the loading behavior, which is a different issue from removing the decorator. |
Branch is mergeable now. I think this is a better approach to the mini-dsl problem and more consistent with the rest of the codebase. |
Great, merging. We need to remember to track the new functionality as part of DSL 1.1. |
@rolandwalker this is the piece of code I was talking about in IRC.