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

Ruby 1.8.7 で //list を含む --target=html がコケる #181

Merged
merged 2 commits into from Aug 16, 2013

Conversation

vvakame
Copy link
Sponsor Contributor

@vvakame vvakame commented Aug 14, 2013

NameError: uninitialized constant ReVIEW::HTMLUtils::MentosError
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in const_missing' /Users/vvakame/Dropbox/work/review/test/../lib/review/htmlutils.rb:50:inhighlight'

みたいなエラーが出て、原因がよくわからないのでとりあえず再現だけさせてみました。

@muojp
Copy link

muojp commented Aug 14, 2013

1eea405

対象コードが取り込まれたコミット(今年3月のもの)を眺めてると、コードハイライトに Pygments( http://pygments.org/ ) を使うように変更された模様。

で、関連するかもしれないものは Pygments の issue にあがってました。
-> pygments/pygments.rb#45

しかしこの issue とあまり関係なく、require pygments で Ruby にバンドルされてる Pygments を読み込んでいる部分で、Ruby 1.8.7にバンドルされてる(古い) Pygments には MentosError とか定義されてなくて、結果Ruby側のバインディングも無いんじゃないかなー、という気持ちで見ていました(夏休みReVIEW読書感想文)。

@muojp
Copy link

muojp commented Aug 14, 2013

require pygmentsが失敗した際にrescueでLoadErrorが先に評価されるか、MentosErrorまで先に解釈しようとして詰むのかがRuby 1.8系と1.9系の実装差なのではという推測

@muojp
Copy link

muojp commented Aug 14, 2013

https://gist.github.com/muojp/6227796 つまりこういう話だと思います!

@vvakame
Copy link
Sponsor Contributor Author

vvakame commented Aug 14, 2013

muo変更で1.8.7でテスト通ったし1.9.0でも特になんもなさそうなので追加してpushしてみた!

@kdmsnr kdmsnr merged commit 4a3d440 into kmuto:master Aug 16, 2013
@vvakame vvakame deleted the reproduction-code-1.8.7-issue branch August 19, 2013 02:07
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.

None yet

3 participants