-
Notifications
You must be signed in to change notification settings - Fork 726
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
No implicit conversion of IO into String #487
Comments
@japj could you take a look at this please? |
(when you get a chance - if you don't have the time I'm happy to fix it of course) |
I'll have a look later today, not sure exactly atm how to have a reproduceable test for this to prevent regression in the future. My ruby is fairly rusty |
Ok, I am a bit lost on how to solve this issue due to not programming in ruby for a looong time and the unknowns of the IO subsystem. Should https://github.com/jneen/rouge/blob/master/lib/rouge/cli.rb#L16 return a different kind of object (this is what I am assuming should happen as the 'correct' fix, but I'm not sure what object it should be exactly for L26 to also still work correctly). Or should https://github.com/jneen/rouge/blob/master/lib/rouge/cli.rb#L26 contain the old code in case of stdin, but then there is duplication on the case input/when part? |
I think you can embed the encoding into the File object with |
I guess this can be closed then? |
Yep! |
It seems like #417 was a little overzealous - the FileReader class had been introduced to distinguish between stdin (or
'-'
) and file names. When usingrougify
to highlight stdin, we now try to callFile.read($stdin, encoding: 'utf-8')
, which throws an error.The text was updated successfully, but these errors were encountered: