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

Fix incorrect namespace conversion. #15

Conversation

iliabylich
Copy link
Contributor

Fix for issue #3

Btw, what do you expect from method namespace for classes with same name defined in different modules?

For example:

require 'snapi'

module A
  class ClassName
    include Snapi::Capability
  end
end

p A::ClassName.namespace
p Snapi.capabilities

module B
  class ClassName
    include Snapi::Capability
  end
end

p B::ClassName.namespace
p Snapi.capabilities

Output:

:class_name
{:class_name=>A::ClassName}
:class_name
{:class_name=>B::ClassName}

Looks like a bug.

@granolocks
Copy link
Contributor

Wow, that is a great point about the redundant namespace thing... I hadn't considered multiple modules with overlapping names.

Any suggestion on what a prefered fix would be? I wanted to avoid long namespaces in the event of deeply nested modules...

granolocks added a commit that referenced this pull request Apr 2, 2014
…sion

Fix incorrect namespace conversion.
@granolocks granolocks merged commit c99eabe into pwnieexpress:develop Apr 2, 2014
@granolocks
Copy link
Contributor

I have merged this PR but it hasn't been released into a new gem version.

Thank you @iliabylich !

@iliabylich iliabylich deleted the fix-incorrect-namespace-conversion branch April 2, 2014 14:33
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.

2 participants