spec.platform = "java" in the gemspec seems to simply append
"java" to the end of my gem name. It still installs into MRI
Someone suggested I use gem's (native) extension mechanism to
write a script that would fail if not running under JRuby. But I
can't seem to get this to work. I always get the error "cannot
build native extension" even when my ext script does nothing.
I also tried building with both jgem and normal gem, but it
didn't seem to make a difference. Although it's not clear to me if
the local behavior when testing these things will be the same as
when installing from rubygems.org. I only used the gem command "for
real" so far. Next time I'll try to remember to build and push via
jgem and see if that helps.
Maybe there's a bug report or enhancement request in here
somewhere, but I guess it's not that big of a deal. I suppose if
people can't RTFM or figure out a gem that starts with "j" and ends
with "java" is intended for JRuby, that's not really not my problem