From 2c358a8edf9285c09bb6d62ee101f02267adc556 Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Wed, 11 Jun 2014 17:29:10 -0600 Subject: Patch to make simplecov/coveralls optional --- rubygem-docile-1.1.3-simplecov.patch | 53 ++++++++++++++++++++++++++++++++++++ rubygem-docile.spec | 12 ++++++-- 2 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 rubygem-docile-1.1.3-simplecov.patch diff --git a/rubygem-docile-1.1.3-simplecov.patch b/rubygem-docile-1.1.3-simplecov.patch new file mode 100644 index 0000000..c8b9dbb --- /dev/null +++ b/rubygem-docile-1.1.3-simplecov.patch @@ -0,0 +1,53 @@ +commit 0db1d3be2bcf2a14de40cca0dbcc777ee911700a +Author: Ken Dreyer +Date: Wed Jun 11 17:24:42 2014 -0600 + + tests: make simplecov/coveralls optional + + If we do not have SimpleCov or Coveralls installed, we should be able to + continue with the rest of the test suite. + + This allows the tests to run outside of Bundler if SimpleCov or + Coveralls are not installed. + +diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb +index 4cd8c40..b5e20a2 100644 +--- a/spec/spec_helper.rb ++++ b/spec/spec_helper.rb +@@ -1,16 +1,20 @@ + require 'rubygems' + require 'rspec' + require 'singleton' +-require 'simplecov' +-require 'coveralls' ++begin ++ require 'simplecov' ++ require 'coveralls' + +-# Both local SimpleCov and publish to Coveralls.io +-SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ +- SimpleCov::Formatter::HTMLFormatter, +- Coveralls::SimpleCov::Formatter +-] +-SimpleCov.start do +- add_filter "/spec/" ++ # Both local SimpleCov and publish to Coveralls.io ++ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ ++ SimpleCov::Formatter::HTMLFormatter, ++ Coveralls::SimpleCov::Formatter ++ ] ++ SimpleCov.start do ++ add_filter "/spec/" ++ end ++rescue LoadError ++ warn 'warning: simplecov/coveralls gems not found; skipping coverage' + end + + test_dir = File.dirname(__FILE__) +@@ -25,4 +29,4 @@ RSpec.configure do |config| + config.expect_with :rspec do |c| + c.syntax = :expect + end +-end +\ No newline at end of file ++end diff --git a/rubygem-docile.spec b/rubygem-docile.spec index 5eeee2d..8887434 100644 --- a/rubygem-docile.spec +++ b/rubygem-docile.spec @@ -7,17 +7,19 @@ Summary: Docile keeps your Ruby DSLs tame and well-behaved Name: rubygem-%{gem_name} Version: 1.1.3 -Release: 1%{?dist} +Release: 2%{?dist} Group: Development/Languages License: MIT URL: http://ms-ati.github.com/docile/ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +# Make simplecov/coveralls deps optional +# https://github.com/ms-ati/docile/pull/15 +Patch0: rubygem-docile-1.1.3-simplecov.patch Requires: ruby(release) Requires: ruby(rubygems) BuildRequires: ruby(release) BuildRequires: rubygems-devel %if 0%{?with_tests} -BuildRequires: rubygem(coveralls) BuildRequires: rubygem(mime-types) BuildRequires: rubygem(rake) BuildRequires: rubygem(redcarpet) @@ -46,6 +48,9 @@ gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec +# Make simplecov/coveralls dep optional +%patch0 -p1 + %build gem build %{gem_name}.gemspec %gem_install @@ -79,5 +84,8 @@ rspec -Ilib spec %{gem_instdir}/spec %changelog +* Wed Jun 11 2014 Ken Dreyer - 1.1.3-2 +- Patch to make simplecov/coveralls optional + * Wed Apr 02 2014 Troy Dawson - 1.1.3-1 - Initial package -- cgit