timonwong / OmniMarkupPreviewer

Sublime Text 2&3 plugin to live preview markup files, supported (not limited to) markup formats are markdown, reStructuredText, WikiCreole and textile.
MIT License
500 stars 74 forks source link

Rendering RDoc with Ruby 2.3 #95

Open kdiogenes opened 8 years ago

kdiogenes commented 8 years ago

I have ruby 2.3 in my path. While trying to use this package I get the following error:

/usr/lib/ruby/2.3.0/rdoc/markup/to_html.rb:45:in `initialize': wrong number of arguments (given 0, expected 1..2) (ArgumentError)
  from /home/kadu/.config/sublime-text-3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/bin/rdoc.rb:13:in `new'
  from /home/kadu/.config/sublime-text-3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/bin/rdoc.rb:13:in `<main>'

It's appear that RDoc::Markup::ToHtml has changed and now RDoc::Options.new must be passed as the first argument.

I changed OmniMarkupPreviewer/OmniMarkupLib/Renderers/bin/rdoc.rb:13 to

conv = RDoc::Markup::ToHtml.new(RDoc::Options.new)

And it worked, but I don't how to maintain backwards compatibility nor if it's necessary, since I take a look to the ruby code and it's appear that since version 2.0.0 the options parameter is necessary: https://github.com/ruby/ruby/blob/ruby_2_0_0/lib/rdoc/markup/to_html.rb#L44