From 1281f00bf034cf00488f783f5850a216db3fb39b Mon Sep 17 00:00:00 2001 From: Whitney Young Date: Mon, 11 Nov 2013 12:47:55 -0300 Subject: [PATCH 1/3] Added Coveralls support. --- .gitignore | 1 + README.rdoc | 2 +- Rakefile | 5 ++++- kaminari.gemspec | 1 + spec/spec_helper.rb | 4 ++++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 861961dcc..d232f91b0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .idea Gemfile.lock gemfiles/*.lock +coverage/* pkg/* doc diff --git a/README.rdoc b/README.rdoc index 4f345986d..a6f8608ea 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,4 +1,4 @@ -= Kaminari {}[http://travis-ci.org/amatsuda/kaminari] {}[https://codeclimate.com/github/amatsuda/kaminari] += Kaminari {}[http://travis-ci.org/amatsuda/kaminari] {}[https://codeclimate.com/github/amatsuda/kaminari] {}[https://coveralls.io/r/amatsuda/kaminari] A Scope & Engine based, clean, powerful, customizable and sophisticated paginator for modern web app frameworks and ORMs diff --git a/Rakefile b/Rakefile index 1021afa47..5cf9dc012 100644 --- a/Rakefile +++ b/Rakefile @@ -5,12 +5,15 @@ Bundler::GemHelper.install_tasks require 'rspec/core' require 'rspec/core/rake_task' +require 'coveralls/rake/task' + +Coveralls::RakeTask.new RSpec::Core::RakeTask.new(:spec) do |spec| spec.pattern = FileList['spec/**/*_spec.rb'] end -task :default => "spec:all" +task :default => ["spec:all", "coveralls:push"] namespace :spec do %w(active_record_edge active_record_40 active_record_32 active_record_31 active_record_30 data_mapper_12 mongoid_31 mongoid_30 mongoid_24 mongo_mapper sinatra_13 sinatra_14).each do |gemfile| diff --git a/kaminari.gemspec b/kaminari.gemspec index fd3f8a093..4459ee71e 100644 --- a/kaminari.gemspec +++ b/kaminari.gemspec @@ -33,4 +33,5 @@ Gem::Specification.new do |s| s.add_development_dependency 'capybara', ['>= 1.0'] s.add_development_dependency 'database_cleaner', ['~> 1.2.0'] s.add_development_dependency 'rdoc', ['>= 0'] + s.add_development_dependency 'coveralls', ['>= 0'] end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3063a265d..b92c8c535 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,6 +11,10 @@ require 'capybara/rspec' require 'database_cleaner' +require 'coveralls' + +# Enable Coveralls +Coveralls.wear_merged! # Simulate a gem providing a subclass of ActiveRecord::Base before the Railtie is loaded. require 'fake_gem' if defined? ActiveRecord From 2ce9e16055a678104e986a001538a24e481ed0f1 Mon Sep 17 00:00:00 2001 From: Whitney Young Date: Mon, 11 Nov 2013 14:22:02 -0300 Subject: [PATCH 2/3] Added service name for Coveralls. --- .coveralls.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .coveralls.yml diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 000000000..0170b682d --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1 @@ +service_name: travis From 804ff8c87c9dfa3ed9f58021a5646443a2cdd1c9 Mon Sep 17 00:00:00 2001 From: Whitney Young Date: Mon, 11 Nov 2013 14:22:48 -0300 Subject: [PATCH 3/3] Coveralls handles multiple Travis builds. There's no need to use the merged support from Coveralls since they already handle receiving data from multiple Travis builds and combining that. --- Rakefile | 5 +---- spec/spec_helper.rb | 9 +++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Rakefile b/Rakefile index 5cf9dc012..1021afa47 100644 --- a/Rakefile +++ b/Rakefile @@ -5,15 +5,12 @@ Bundler::GemHelper.install_tasks require 'rspec/core' require 'rspec/core/rake_task' -require 'coveralls/rake/task' - -Coveralls::RakeTask.new RSpec::Core::RakeTask.new(:spec) do |spec| spec.pattern = FileList['spec/**/*_spec.rb'] end -task :default => ["spec:all", "coveralls:push"] +task :default => "spec:all" namespace :spec do %w(active_record_edge active_record_40 active_record_32 active_record_31 active_record_30 data_mapper_12 mongoid_31 mongoid_30 mongoid_24 mongo_mapper sinatra_13 sinatra_14).each do |gemfile| diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b92c8c535..4289ccb9d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,8 @@ +require 'coveralls' + +# Enable Coveralls +Coveralls.wear! + $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) @@ -11,10 +16,6 @@ require 'capybara/rspec' require 'database_cleaner' -require 'coveralls' - -# Enable Coveralls -Coveralls.wear_merged! # Simulate a gem providing a subclass of ActiveRecord::Base before the Railtie is loaded. require 'fake_gem' if defined? ActiveRecord