lib/covered/policy/default.rb in covered-0.14.2 vs lib/covered/policy/default.rb in covered-0.15.0
- old
+ new
@@ -18,23 +18,27 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
require_relative '../policy'
-$covered = Covered.policy do
- cache!
-
- # Only files in the root would be tracked:
- root(Dir.pwd)
-
- # We will ignore any files in the test or spec directory:
- skip(/^.*\/(test|spec|vendor)\//)
-
- # We will include all files under lib, even if they aren't loaded:
- include("lib/**/*.rb")
-
- persist!
-
- source
-
- reports!
+if File.exist?("config/coverage.rb")
+ load("config/coverage.rb")
+else
+ $covered = Covered.policy do
+ cache!
+
+ # Only files in the root would be tracked:
+ root(Dir.pwd)
+
+ # We will ignore any files in the test or spec directory:
+ skip(/^.*\/(test|spec|vendor)\//)
+
+ # We will include all files under lib, even if they aren't loaded:
+ include("lib/**/*.rb")
+
+ persist!
+
+ source
+
+ reports!
+ end
end