Skip to content

Commit

Permalink
Merge pull request #171 from danmayer/remove_dependency_on_environmen…
Browse files Browse the repository at this point in the history
…t_task

Remove dependency on environment rake task
  • Loading branch information
danmayer committed Jan 19, 2019
2 parents 9339c25 + 9b87703 commit c91782b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/coverband/utils/tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
namespace :coverband do
Coverband.configure

def environment
Rake.application['environment'].invoke if Rake::Task.task_defined?('environment')
end

###
# NOTE: If your project has set many simplecov filters.
# You might want to override them and clear the filters.
# Or run the task `coverage_no_filters` below.
###
desc 'report runtime Coverband code coverage'
task coverage: :environment do
task :coverage do
environment
if Coverband.configuration.reporter == 'scov'
Coverband::Reporters::HTMLReport.report(Coverband.configuration.store)
else
Expand All @@ -18,7 +23,8 @@
end

desc 'report runtime coverband code coverage after disabling simplecov filters'
task coverage_no_filters: :environment do
task :coverage_no_filters do
environment
if Coverband.configuration.reporter == 'scov'
clear_simplecov_filters
Coverband::Reporters::HTMLReport.report(Coverband.configuration.store)
Expand All @@ -31,7 +37,8 @@
# clear data helpful for development or after configuration issues
###
desc 'reset Coverband coverage data, helpful for development, debugging, etc'
task clear: :environment do
task :clear do
environment
Coverband.configuration.store.clear!
end
end

0 comments on commit c91782b

Please sign in to comment.