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

PDF::PDF constant causes conflicts #4

Open
yob opened this issue Dec 21, 2010 · 3 comments
Open

PDF::PDF constant causes conflicts #4

yob opened this issue Dec 21, 2010 · 3 comments

Comments

@yob
Copy link

yob commented Dec 21, 2010

htmldoc defines the PDF::PDF constant to be a string that equals 'pdf'.

Unfortunately that means any code inside the root PDF module (like my pdf-reader) that uses the PDF constant gets the string instead of the root module we expect. Can the PDF::PDF constant be renamed to something else?

@mattsears
Copy link

I just ran into this issue. Is there a workaround that you know of?

@craigw
Copy link
Owner

craigw commented Nov 24, 2014

Thanks for bringing this to my attention. Can you provide a test case for this to explain what the problem is? Could you maybe do ::PDF as a work-around?

@mattsears
Copy link

Hey Craig, it appears the htmldoc renders yob's pdf-reader (and possibly Prawn) useless - and vice versa if they're include in the same project.

require 'htmldoc'
require 'pdf-reader'

PDF::Reader.new("somepdf.pdf") #=> TypeError: ”pdf“ is not a class/module

Same issue reported on Stackoverflow:

http://stackoverflow.com/questions/22437151/rails-using-prawn-result-in-typeerror-pdf-is-not-a-class-module

I forked htmldoc and changed the constant name PDF::PDF and all seems well now.

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

3 participants