JRuby Bug Fixed With Regexp Class
I have had some days funny playing with JRuby, specifically I’m working in a DSL verbal_expressions to parser URL.
verbal_expressions is so sexy, very verbose as way it was built and as you can use it. I tested it in MRI and works fine, but in my current project, we need developing a set new features upon JVM, by this reason JRuby plays an important role.
When I made tests using JRuby, I found an weird behaviour, assuming that JRuby allow carry (almost) the whole Ruby code wrote using MRI.
Basically, I made the following code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Because I went to use the previous code just like this.
1
| |
As you can see is very simple what I want, just inherit from Regexp, nothing out of usual here. But when I ran the previous code get the following output.
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
With idea to discard some problem in my code I decided test it with a dummy code like follow:
1 2 3 4 5 6 7 8 | |
When I run the previous code:
1 2 3 4 | |
Works as expected. In JRuby’s IRC I explained the previous ones, after ratnikov made the tests, he confirms it was an issue in RubyRegexp implementation.
Basically, RubyRegexp was ignoring the new’s block