Skip to content

Commit

Permalink
Merge 13db64d into 42f6beb
Browse files Browse the repository at this point in the history
  • Loading branch information
danmayer committed Jul 3, 2020
2 parents 42f6beb + 13db64d commit 47edd6c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
11 changes: 8 additions & 3 deletions lib/coverband.rb
Expand Up @@ -99,9 +99,14 @@ def self.runtime_coverage!
begin
# Coverband should be setup as early as possible
# to capture usage of things loaded by initializers or other Rails engines
configure
start
require "coverband/utils/railtie" if defined? ::Rails::Railtie
# but after gems are loaded to avoid slowing down gem usage
# best is in application.rb after the bundler line but we get close with Railtie
if defined? ::Rails::Railtie
require "coverband/utils/railtie"
else
configure
start
end
require "coverband/integrations/resque" if defined? ::Resque
rescue Redis::CannotConnectError => error
Coverband.configuration.logger.info "Redis is not available (#{error}), Coverband not configured"
Expand Down
2 changes: 1 addition & 1 deletion lib/coverband/adapters/file_store.rb
Expand Up @@ -5,7 +5,7 @@ module Adapters
###
# FilesStore store a merged coverage file to local disk
# Generally this is for testing and development
# Not recommended for production deployment
# Not recommended for production deployment, as it doesn't handle concurrency
###
class FileStore < Base
def initialize(path, _opts = {})
Expand Down
7 changes: 7 additions & 0 deletions lib/coverband/utils/railtie.rb
Expand Up @@ -36,6 +36,13 @@ class Railtie < Rails::Railtie
end
end

config.before_configuration do
unless ENV["COVERBAND_DISABLE_AUTO_START"]
Coverband.configure
Coverband.start
end
end

rake_tasks do
load "coverband/utils/tasks.rb"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/coverband/version.rb
Expand Up @@ -5,5 +5,5 @@
# use format '4.2.1.rc.1' ~> 4.2.1.rc to prerelease versions like v4.2.1.rc.2 and v4.2.1.rc.3
###
module Coverband
VERSION = "5.0.0.rc.1"
VERSION = "5.0.0.rc.2"
end

0 comments on commit 47edd6c

Please sign in to comment.