-
Notifications
You must be signed in to change notification settings - Fork 686
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
Move all requires to top level and use require instead of require_relative #1026
Conversation
@pointlessone Could you please review this pull request? |
I'm on the fence about |
@pointlessone Is there an other solution? This is affecting everyone that is using Capistrano or another set up that uses symbolic links. |
Having just dug into this, there's a very simple 'fix': simply replace the call to The question I have is: why are things inside If this is the case, then another fix (an actual fix) would be to not The main use for If someone would like, I can prepare a PR tomorrow that removes or alters the requires to |
@fidothe This is actually a reasonable proposal. PDF/Core is supposed to be stand-alone. The problem is that it was extracted from Prawn and the extraction wasn't quite finished. You may still find that PDF/Core actually depends on Prawn. It's also is not used by any other piece of code other than Prawn itself, as far as I know. Now, while it's true that Regarding the whole problem. I'm convinced it's an environment (read "bundler") issue. There's some piece of code that adds both symlinked and real paths to Prawn doesn't do much crazy metaprogramming/init-run stuff. What happens is mostly just consts/methods overwrite. But in Ruby there are definitely much worse things that can go awry with double load. Anyway, what I'm trying to say is while we can fix the warnings in Prawn it won't fix the root cause. |
@fidothe that pull request sounds awesome! Thank you. @pointlessone I would inform the bundler team what's wrong, but unfortunately this is a bit beyond my knowledge of how ruby includes work. |
I'm working up a minimal-test-case to check this out. I don't think (at this point) that there's a bug in Bundler. What I think is happening is that the first thing that requires into |
@fidothe I agree with @pointlessone that this is primarily not Prawn's problem but probably some invalid behaviour on part of bundler or require or require_relative; see this example:
The last two lines of the output should be the same (in my opinion) but differ. |
This is definitely the result of |
I am really interested to see what the response from Ruby is on this. Thanks for creating a bug report for Ruby. |
Shyouhey (Ruby Core Team) acknowledges this is a bug in Ruby:
More info on Ruby issue tracker: issue 10222 |
Oh wow, that is a three year old bug. It would be great though if @fidothe's change could fix the warnings. At the moment Prawn is the only gem that I'm using that is causing these warnings. I'm all for placing a crown, but an emergency filling for now sounds great too :) |
We merged a fix for #1024 that avoids the underlying problem. I'm going to close this PR as a result. |
This fixes #1024.