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

Hide Kiba classes from the ETL evaluation scope #46

Merged
merged 2 commits into from
Dec 27, 2017

Conversation

thbar
Copy link
Owner

@thbar thbar commented Dec 26, 2017

While testing Kiba 2.0.0.rc1 on a client codebase, I met a situation where a client-declared module named DSLExtensions was shadowed by the new Kiba::DSLExtensions containing the new Config.

Before this PR, the Parser (calling instance_eval) was declared like this:

module Kiba
  module Parser
  end
end

As I discovered, just changing the declaration to this instead:

module Kiba::Parser
end

seems to hide the Kiba classes further enough to avoid the conflict mentioned above.

I expect that a better blank-slate approach will likely be needed at some point in the future, but this seem to be good enough for the upcoming v2, and will at least make sure that clients using the DSLExtensions module to group DSL extensions (very commonly used by my clients) won't see a conflict due to the introduction of Kiba::DSLExtensions::Config.

This commit shows that ETL job evaluation occurs in a way where the top level namespace is set to "Kiba" rather than nothing. This means that one can get conflicts if a non namespaced class of their own work has the same name as a class provided under the Kiba namespace.
@thbar thbar self-assigned this Dec 26, 2017
@thbar thbar changed the title Reproduce namespace conflict Hide Kiba classes from the ETL evaluation scope Dec 27, 2017
@thbar thbar merged commit c4a21b1 into master Dec 27, 2017
@thbar thbar deleted the fix-namespace-conflict branch December 27, 2017 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant