jarrett / rbbcode

Converts BBCode to HTML. Gracefully handles invalid input. Built on Treetop.
41 stars 9 forks source link

Make compatible with ruby 1.9.1 #5

Closed fatalerrorx closed 11 years ago

fatalerrorx commented 14 years ago

I suspect there need to be minor changes to get it to work with ruby 1.9.1 but atm it fails 43/47 tests for ruby 1.9.1 and i can't figure out whats causing the problem.

jarrett commented 14 years ago

Ouch. I don't have 1.9.1 installed on any of my machines, but I might be able to do that sometime soon. Could you post the error messages? (If it's the same message every time, please just post it once.)

fatalerrorx commented 14 years ago

First need to put this comment at the top of tree_maker_spec http://pastie.org/878196 the error that gets repeated is: http://pastie.org/878194 thanks for looking into this in advance.

jarrett commented 14 years ago

Try running spec with the backtrace option. That will trace the error into the library. Right now, your trace only tells me about tree_maker_spec.rb:15, which does not itself call collect.

jarrett commented 14 years ago

By the way, what's the deal with the # coding: utf-8 comment?

fatalerrorx commented 14 years ago

Here is the backtrace http://pastie.org/878200

The coding comment tells ruby 1.9.1 that the file contains non-ascii characters otherwise ruby 1.9.1 throws and error: /home/paul/rbbcode/spec/parser_spec.rb:74: invalid multibyte char (US-ASCII)

fatalerrorx commented 14 years ago

i made a mistake btw should put it in parser_spec.rb :)

jarrett commented 14 years ago

Oh, neat. I haven't used Ruby 1.9.1 yet. Can you point me to some docs on how # coding: utf-8 works?

jarrett commented 14 years ago

It appears that I had incorrectly used a variable-length argument list. For some reason, Ruby 1.8.6 didn't mind, but 1.9.1 does, I guess. So I rewrote it to be correct. Hopefully the new version will fix it for you.

fatalerrorx commented 14 years ago

Ah that fixed alot of problems but there are still 8 failures: http://pastie.org/878208

jarrett commented 14 years ago

I've added the magic comments. They'll ship with the next release.

The problems mostly seem to be with URLs. RbbCode uses my sanitize_url gem. Could you try running the tests on that in 1.9.1? I'm curious to see if they fail.

jarrett commented 14 years ago

Most problems have been fixed thanks to the new release of sanitize-url. However, there are still 3 failure that are probably due to the changes to String in 1.9.1. I plan to push out a fix for these.

kpitn commented 13 years ago

Any news about a fix ?

I'm using ruby 1.9.2 and with just this caracter "é"

I have this error : incompatible character encodings: UTF-8 and ASCII-8BIT

jarrett commented 13 years ago

Unfortunately I'm not able to put a lot of time in this project lately. Regarding your encoding error, are you sure you've properly declared the encoding of your source file with magic comments? If that's not the issue, and there's something wrong with rbbcode, I would welcome a patch. But for now, I don't know if I'll be able to address it myself.

kpitn commented 13 years ago

i will write you a patch tomorrow, i've fix the issue

jarrett commented 11 years ago

A new version based on Treetop will be coming out soon. This is a total rewrite, so all current issues will be closed.