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

fix an issue that rdoc fails when running on Windows with RUBYOPT=-U #430

Merged
merged 2 commits into from Jan 18, 2017

Conversation

dogatana
Copy link
Contributor

@dogatana dogatana commented Dec 3, 2016

rdoc sometimes failes when it runs on Windows with RUBYOPT=-U environment variable setting.

I confirmed this issue in following environment and process.

  • Windows 10 Pro, Japanese
  • ruby 2.3.1p112 (2016-04-26 revision 54768) [i386-mingw32]
  • rdoc 4.2.1 (pre-installed) and 5.0.0
  • installing rroonga gem (6.1.0 x86-mingw32)

"rdoc --debug" showed encoding errors, so I tried to fix this by

  • add rescue Encoding::InvalidByteSequenceError in Rdoc::Parser.check_modeline
  • specify encoding when reading a file in Rdoc::Parser.binary?
  • specify encoding when reading a file in RDoc::Generator::JsonIndex#generate_gzipped

Regarding the first one, a change of open-mode to "rb" works fine too.
But this method has rescue line including a relevant comment, so I chose the above modification.

After this changes, rdoc works fine so far.

- add rescue Encoding::InvalidByteSequenceError in Rdoc::Parser.check_modeline
- specify encoding when reading a file in Rdoc::Parser.binary?
- specify encoding when reading a file in RDoc::Generator::JsonIndex#generate_gzipped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants