RCov with jruby-complete possible?

I’m trying to use RCov in my Rakefile for code coverage with Rspec in
the ruby code our App, but because of our special needs in the app (mix
code of Java, Ruby and Scala) we’re executing it with jruby-complete
(1.5.1 right now).

The thing is that because RCov need an executable that is installed when
the gem is, the jruby-complete can’t find it because it’s looking for
inside the bin directory in the jar file.

Is there any way to execute RCov with jruby-complete??

I think it would be nice to include rcov inside the jruby-complete,
because is very related to the spec gem and really useful for testing.
In that case it wouldn’t be any problem using RCov with JRuby-Complete.

My fail is the following:

$ java -jar jruby-complete-1.5.1.jar -S rake spec
(in /Users/david/Documents/Abstra/BlueMountain/FrontEnd/DSL)
rm -r coverage
jruby: No such file, directory, or command – rcov

If I see my gem environment:

$ java -jar jruby-complete-1.5.1.jar -S gem env
RubyGems Environment:

  • RUBYGEMS VERSION: 1.3.6
  • RUBY VERSION: 1.8.7 (2010-06-06 patchlevel 249) [java]
  • INSTALLATION DIRECTORY:
    file:/Users/david/Documents/Abstra/BlueMountain/FrontEnd/DSL/jruby-complete-1.5.1.jar!/META-INF/jruby.home/lib/ruby/gems/1.8
  • RUBY EXECUTABLE: java -jar
    /Users/david/Documents/Abstra/BlueMountain/FrontEnd/DSL/jruby-complete-1.5.1.jar
  • EXECUTABLE DIRECTORY:
    file:/Users/david/Documents/Abstra/BlueMountain/FrontEnd/DSL/jruby-complete-1.5.1.jar!/META-INF/jruby.home/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • universal-java-1.6
  • GEM PATHS:

file:/Users/david/Documents/Abstra/BlueMountain/FrontEnd/DSL/jruby-complete-1.5.1.jar!/META-INF/jruby.home/lib/ruby/gems/1.8
- /Users/david/.gem/jruby/1.8

  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
    • “install” => “–env-shebang”
    • “update” => “–env-shebang”
  • REMOTE SOURCES:

So I can’t install the gem with the jruby-complete, due to not be
possible to include binaries in the EXECUTABLE DIRECTORY and gems to the
INSTALLATION DIRECTORY (inside the jruby-complete.jar)

Does anyone know how to run the RCov with the JRuby-Complete without
having to create your own jruby-complete.jar???

Thanks.

Interesting… I’m not familiar enough with how jruby-complete works
with binaries not inside of it. But would be great to know. I do a
lot of work with RCov to keep it working with JRuby, but I don’t think
it’s something we want bundled into JRuby-Complete by default.
(Although I’ll let Tom and Charles weigh in on that part). I will try
to find some time this afternoon to play around with this and see if I
can get something working.

If I do I’ll post and update the RCov instructions on github.

Jay

2010/7/9 David Cañadillas [email protected]:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thanks for your quick response Jay!

I’ll be waiting for your news. In the meantime I’m going to continue my
“research” about it and I’ll be playing around with this. If I get some
solution or something interesting about it I’ll let you know.

We’re thinking about creating our own jruby-complete, but this is just a
provisional “hack” until we get the elegant solution (I suppose we’ll
give up jruby-complete and use just “jruby”).

David.

Jay McGaffigan wrote:

Interesting… I’m not familiar enough with how jruby-complete works
with binaries not inside of it. But would be great to know. I do a
lot of work with RCov to keep it working with JRuby, but I don’t think
it’s something we want bundled into JRuby-Complete by default.
(Although I’ll let Tom and Charles weigh in on that part). I will try
to find some time this afternoon to play around with this and see if I
can get something working.

If I do I’ll post and update the RCov instructions on github.

Jay

2010/7/9 David Ca�adillas [email protected]:

�- EXECUTABLE DIRECTORY:
� � - :verbose => true
INSTALLATION DIRECTORY (inside the jruby-complete.jar)

� �http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

hey david… With nick sieger’s help I’ve made some progress…

Without an exact equivalent of what you are trying to do, this is
where I got to:

most of what I’ve done comes from Nick and his block post here:
http://blog.nicksieger.com/articles/2009/01/10/jruby-1-1-6-gems-in-a-jar

First:
I grabbed jruby complete 1.5.1

java -jar jruby-complete.jar -S gem list
gets me:
*** LOCAL GEMS ***

columnize (0.3.1)
rake (0.8.7)
rspec (1.3.0)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3.2)
sources (0.0.1)

following nick’s instructions on his blog:

I grabbed rcov:
java -jar jruby-complete-1.5.1.jar -S gem install -i ./gems rcov

built a “secondary” jar
jar cf rcov-gem.jar -C gems .

now:
java -jar jruby-complete-1.5.1.jar -rrcov-gem.jar -S gem list
shows:
*** LOCAL GEMS ***

columnize (0.3.1)
rake (0.8.7)
rcov (0.9.8)
rspec (1.3.0)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3.2)
sources (0.0.1)

now comes the murky part:
I can’t run rcov with a command like:
java -jar jruby-complete-1.5.1.jar -rrcov-gem.jar -S rcov

says we can’t find rcov

but doing it this way shows I can run it:
java -jar jruby-complete-1.5.1.jar -rrcov-gem.jar -e “load ‘bin/rcov’”

So… This is where it’d be nice to have a simple test case based on
what you are trying to do.
I’ve a feeling that rspec does a system call out to rcov with
something like jruby -S rcov and I’m not convinced we will achieve
success. I’m going to look into it more. But I’d love to hear back
from you and see if you make any more progress based on the above
stuff…

Jay

2010/7/9 David Cañadillas [email protected]:

David.

If I do I’ll post and update the RCov instructions on github.

� �http://xircles.codehaus.org/manage_email
Posted via http://www.ruby-forum.com/.


To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thank you Jay!!

I knew about the Nick S.'s post and I tried before about the gem jar
packaging with no success because of the negative answer from the
command line about the rcov command. What I dind’t try is executing
rcov with the ‘-e “load”’ option in the jruby-complete jar, like you
say. That’s very helpful from you, so thank you very much!

The thing is that I would like to include it in the spec task of my
rakefile. Anyway I’ll try to execute it outside the spec task with your
solution and I’ll tell you the results.

Thanks a lot!

David.

Jay McGaffigan wrote:

hey david… With nick sieger’s help I’ve made some progress…

Without an exact equivalent of what you are trying to do, this is
where I got to:

most of what I’ve done comes from Nick and his block post here:
JRuby 1.1.6: Gems-in-a-jar

First:
I grabbed jruby complete 1.5.1

java -jar jruby-complete.jar -S gem list
gets me:
*** LOCAL GEMS ***

columnize (0.3.1)
rake (0.8.7)
rspec (1.3.0)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3.2)
sources (0.0.1)

following nick’s instructions on his blog:

I grabbed rcov:
java -jar jruby-complete-1.5.1.jar -S gem install -i ./gems rcov

built a “secondary” jar
jar cf rcov-gem.jar -C gems .

now:
java -jar jruby-complete-1.5.1.jar -rrcov-gem.jar -S gem list
shows:
*** LOCAL GEMS ***

columnize (0.3.1)
rake (0.8.7)
rcov (0.9.8)
rspec (1.3.0)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3.2)
sources (0.0.1)

now comes the murky part:
I can’t run rcov with a command like:
java -jar jruby-complete-1.5.1.jar -rrcov-gem.jar -S rcov

says we can’t find rcov

but doing it this way shows I can run it:
java -jar jruby-complete-1.5.1.jar -rrcov-gem.jar -e “load ‘bin/rcov’”

So… This is where it’d be nice to have a simple test case based on
what you are trying to do.
I’ve a feeling that rspec does a system call out to rcov with
something like jruby -S rcov and I’m not convinced we will achieve
success. I’m going to look into it more. But I’d love to hear back
from you and see if you make any more progress based on the above
stuff…

Jay

2010/7/9 David Cañadillas [email protected]:

David.

If I do I’ll post and update the RCov instructions on github.

� �http://xircles.codehaus.org/manage_email
Posted via http://www.ruby-forum.com/.


To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email