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

Move global methods into Kernel module. #6367

Merged
merged 1 commit into from Aug 15, 2019

Conversation

reitermarkus
Copy link
Member

Extracted from #6366.

Globally defined methods are not available from within subclasses of DelegateClass.

Example:

module Kernel
  def global_works; end
end

def global_fails; end

class D < DelegateClass(Hash)
  def works
    global_works
  end

  def fails
    global_fails
  end
end

D.new({}).works
D.new({}).fails

Otherwise they are not defined inside of subclasses of `DelegateClass`.
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Would be nice to make this in Library/Homebrew/extend/kernel/utils or something or making them in a new module which is included in Kernel for backwards compatibility?

@reitermarkus
Copy link
Member Author

for backwards compatibility

This is already backwards compatible. Everything inside Kernel is also included in Object.

@reitermarkus reitermarkus merged commit 0054dd3 into Homebrew:master Aug 15, 2019
@reitermarkus reitermarkus deleted the kernel branch August 15, 2019 22:37
@MikeMcQuaid
Copy link
Member

This is already backwards compatible. Everything inside Kernel is also included in Object.

Sorry, I mean backwards compatibility after moving to another module.

@lock lock bot added the outdated PR was locked due to age label Jan 1, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants