technicalpickles/jeweler — pull request #225 by aia (2012-01-25 22:29:12+00:00)
Title: Simplecov for Ruby 1.9 test coverage

Here's a bigger, but very much necessary change.

In current state, Jeweler adds rcov gem by default. The problem is that rcov does not work under Ruby 1.9. The general consensus is to use simplecov for test coverage in Ruby 1.9. Rcov gem itself promotes simplecov - e.g.

$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

$ jeweler -v
Version: 1.8.3

$ gem list rcov

*** LOCAL GEMS ***

rcov (0.9.11, 0.9.10, 0.9.8)

$ jeweler --rspec --cucumber --yard jtest
create	.gitignore
create	Rakefile
create	Gemfile
create	LICENSE.txt
create	README.rdoc
create	.document
create	lib
create	lib/jtest.rb
create	spec
create	spec/spec_helper.rb
create	spec/jtest_spec.rb
create	.rspec
create	features
create	features/jtest.feature
create	features/support
create	features/support/env.rb
create	features/step_definitions
create	features/step_definitions/jtest_steps.rb
Jeweler has prepared your gem in ./jtest

$ cd jtest
jtest (master) $ bundle install
Fetching source index for http://rubygems.org/
Using rake (0.9.2.2)
Using builder (3.0.0)
Using bundler (1.0.21)
Using diff-lcs (1.1.3)
Using json (1.6.5)
Using gherkin (2.7.6)
Using term-ansicolor (1.0.7)
Using cucumber (1.1.4)
Using git (1.2.5)
Using rdoc (3.12)
Using jeweler (1.8.3)
Installing rcov (1.0.0) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/Users/artem/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
**** Ruby 1.9 is not supported. Please switch to simplecov ****

Gem files will remain installed in /Users/artem/.rvm/gems/ruby-1.9.3-p0/gems/rcov-1.0.0 for inspection.
Results logged to /Users/artem/.rvm/gems/ruby-1.9.3-p0/gems/rcov-1.0.0/ext/rcovrt/gem_make.out
An error occured while installing rcov (1.0.0), and Bundler cannot continue.
Make sure that `gem install rcov -v '1.0.0'` succeeds before bundling.

Here comes the simplecov:

With the listed updates.

$ jeweler --rspec --cucumber --yard jtest
create	.gitignore
create	Rakefile
create	Gemfile
create	LICENSE.txt
create	README.rdoc
create	.document
create	lib
create	lib/jtest.rb
create	spec
create	spec/spec_helper.rb
create	spec/jtest_spec.rb
create	.rspec
create	features
create	features/jtest.feature
create	features/support
create	features/support/env.rb
create	features/step_definitions
create	features/step_definitions/jtest_steps.rb
Jeweler has prepared your gem in ./jtest

cd jtest/
jtest (master) $ bundle install
Fetching source index for http://rubygems.org/
Using rake (0.9.2.2)
Using builder (3.0.0)
Using bundler (1.0.21)
Using diff-lcs (1.1.3)
Using json (1.6.5)
Using gherkin (2.7.6)
Using term-ansicolor (1.0.7)
Using cucumber (1.1.4)
Using git (1.2.5)
Using rdoc (3.12)
Using jeweler (1.8.3)
Using multi_json (1.0.4)
Using rspec-core (2.8.0)
Using rspec-expectations (2.8.0)
Using rspec-mocks (2.8.0)
Using rspec (2.8.0)
Using simplecov-html (0.5.3)
Using simplecov (0.5.4)
Using yard (0.7.4)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.