Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
This ugly hack makes the pow webserver work with current JRuby 1.7.0 #32
This is a workaround for this issue in pow:
I know this is very ugly and i have no idea why JRuby throws an IOError exception even though everything is working fine.
Ok, i understand. I didn't feel good about this "patch" anyway, but...
Do you have a suggestion on how i would make pow work with jruby apps then?
Maybe one can overwrite this behavior within pow itself!?
I'm afraid i have no idea what i'm doing ;)
Josh, I think, on the contrary, that JRuby has much better support for UNIX sockets including IO.select now. This seems to be a bug with the new UNIXSockets lib they're using.
Regardless, this code doesn't belong in your project. I'll try to write up an example and submit it to JRuby bugs.
What about simply...
sock.close_read rescue nil
sock.close_read unless RUBY_PLATFORM.eql?('java')
or, possibly the best
begin sock.close_read rescue IOError raise unless RUBY_PLATFORM.eql?('java') end
All more elegant, and achieve the same desired effect.