prawn icon indicating copy to clipboard operation
prawn copied to clipboard

Fixes circular require warning

Open kbrock opened this issue 1 year ago • 4 comments

fixes:

warning: lib/prawn/fonts.rb:9: warning: loading in progress, circular require considered harmful - lib/prawn/font.rb

Aah.

Fixes: https://github.com/prawnpdf/prawn/issues/1349

kbrock avatar Sep 27 '24 18:09 kbrock

Hey team!

Any idea if this is going to be merge?

radwo avatar Mar 07 '25 10:03 radwo

update:

  • rebased to ensure an easy merge.

Thanks for the ping @radwo I too hope this can be merged

kbrock avatar Mar 07 '25 20:03 kbrock

I was curious about why this was happening to begin with and it looks like it's due to the compatibility shim that sets constants on Font::* to point to the Fonts::** namespace.

Fonts::AFM and Fonts::TTF do inherit from Font so it does need to be loaded first. However, because this happens in font.rb and the fonts.rb file is not loaded from anywhere else, it does seem safe to simply remove that line.

Did not attempt to run the code, just dropping a note based on what I found reading things.

practicingdev avatar Apr 23 '25 14:04 practicingdev

This failure is unrelated. It only fails on ruby head and no other version. The failure is based upon a change in encoding.

kbrock avatar Apr 25 '25 16:04 kbrock