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: Add support for rendering multiple scopes by passing string as names #253

Open
wants to merge 1 commit into
base: 2.1.x
Choose a base branch
from

Conversation

swilgosz
Copy link
Sponsor Member

@swilgosz swilgosz commented Dec 7, 2023

Background

Resolves: #252

Bug 1.

When scope name is passed as string (either scope class name, or the path to the file), the name resolving goes through the cache, with a hardcoded key scope_class, not allowing mutliple scopes to be stored and fetched.

Bug 2.

If namespace is not defined (nil), const_defined? is called on nil, causing Undefined method error to be risen.

Design

  • Add spec covering both issues detected.
  • Change the hardcoded cache key to the one taking passed name into the consideration
  • Add support to nil namespace, falling back to the Object, so we can use const_get and const_defined? methods.

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