Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Yard does not work in JRuby =>184.108.40.206 #4363
Since JRuby 220.127.116.11 yard stopped working. More precisely it is probably not able to align comments with actual elements. Same project, same version of yard, "documented" dropped from 100% to 28.57%. Also it started to print warning "Unknown tag @host", however there is no such tag in comments and this warning is generated based on commented instance variable within method implementation (therefore I guess there is some problem with comment alignment).
Running the test suite of YARD makes JRuby 18.104.22.168 confused.
This works on JRuby 22.214.171.124 and fails on higher versions:
bundle exec rspec spec/code_objects/base_spec.rb:405
There's a bit of re-setting back to CLI defaults using some metaprogramming. Here's one test-case which fails on JRuby 126.96.36.199:
Finished in 2.44 seconds (files took 1.79 seconds to load)
rspec './spec/templates/helpers/text_helper_spec.rb[1:1:1:4]' # YARD::Templates::Helpers::TextHelper#signature it should behave like signature shows signature for private class method
Hm. It seems it uses something called "thread-local store":
Woo even after narrowing this down with a bisect it took a while to get it:
nodes =  nodes.each.with_index do |node, index| puts node nodes.insert index + 1, *[2, 3, 4] if node == 1 end
The if is just so this does not run forever. JRuby will only print 1 and MRI will print 1,2,3,4.
Closing the loop...
The problem was that the newish packed arrays had a couple block-receiving methods that did not handle modification during iteration. So if it was a one or two element array and you did
NOTE: Matz himself has said that modification during iteration is an undefined behavior, so technically we were not doing anything wrong here. However, the fix was simple so we went ahead with it. I do not recommend relying on this behavior.
@petr666 This change is a fix for the test that I noted, but it will not make all of YARD's behavior work in JRuby.
I have set up a Travis build with YARD's test suite on my own Github fork. It shows lots of test failures on
I recommend running