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

Using this gem messes with core classes? #200

Open
scsmith opened this issue Oct 1, 2021 · 1 comment
Open

Using this gem messes with core classes? #200

scsmith opened this issue Oct 1, 2021 · 1 comment

Comments

@scsmith
Copy link

scsmith commented Oct 1, 2021

Hey folks, I'm not sure it's great practice to modify functionality of Ruby core or stdlib inside a Gem that gets included into projects.

The root of my issue was:

uninitialized constant IPAddr::PRIVATE_RANGES

Admittedly, it looks like I can update the gem and this problem will be resolved but what I was doing with IPAddr has nothing to do with Azure. IMO changing the behaviour of parts of a user's app just by including a Gem seems like it's going to cause all sorts of issues.

What are your thoughts on finding a different approach to this?

@scsmith
Copy link
Author

scsmith commented Oct 2, 2021

In addition to the above it seems like the utility class is defined 3 times from a single gem require (in my case gem azure-storage-blob -> azure-storage-common (twice) -> azure-core (once)):

The first one has an MIT license, a bunch of rubocop changes and doesn't have the private ranges list. In addition I can't find anywhere that this code is actually used (specifically the IPAddr part) within the storage component? Is there a reason it's not safe to remove IPAddr (and maybe some of the other modified core classes) from all but the canonical core (Assuming that's azure-core) and then patch the canonical to prevent this code from being loaded in Ruby >= 2.5 (where private? is already now defined).

I'm happy to do this but it's work that doesn't make sense if the core team isn't going to accept it?

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

No branches or pull requests

1 participant