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

Redefining Array#dup breaks lots of other things #35

Closed
cpence opened this issue Jun 16, 2020 · 5 comments
Closed

Redefining Array#dup breaks lots of other things #35

cpence opened this issue Jun 16, 2020 · 5 comments
Assignees
Labels

Comments

@cpence
Copy link

cpence commented Jun 16, 2020

After a half-day of debugging, I realized that your redefinition of Array#dup, introduced in 84f36c2, causes all kinds of things to go haywire in a Rails application. (I was inexplicably no longer able to log in.)

I'm not even a conscious user of your gem, pulling it in via rdf-n3, but could you perhaps roll back that change? I suspect my case isn't the only weird interaction it will produce.

(EDIT: Just to be clear, I've confirmed that all the weird behavior I saw was a result of sparql 3.1.1, and could be fixed by commenting out that one function.)

@gkellogg
Copy link
Member

Yes, I can see that this is over broad. Better to create a #deep_dup Method, or something more on point to the general purpose.

I’ll get a patch out shortly.

@gkellogg
Copy link
Member

Released 3.1.2 and yanked 3.1.1.

@cpence
Copy link
Author

cpence commented Jun 16, 2020

Fantastic, thanks so much!

@no-reply
Copy link
Member

should we consider reworking all the standard library monkey patches to use Refinements?
this seems like a good use case for them.

no-reply pushed a commit to samvera/hyrax that referenced this issue Jun 16, 2020
this is a temporary measure to fix the `sparql` gem. we need to force CircleCI
to rebuild without the now yanked `3.1.1` release.

see: ruby-rdf/sparql#35
@gkellogg
Copy link
Member

I thought about that, but have never used them before, but we do patch a number of core classes, and the recent problem was really just my tunnel vision.

If you have some time, perhaps give it a go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants