Skip to content

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants