deep-cover 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59eeae18ac9959ba027208cc21eda3fedf2735fd
4
- data.tar.gz: 9c2689071947c5f6f57b4040fe2c815121903e71
3
+ metadata.gz: 5b9a570fcc6a08a94f3cdca911b32d44d1e57219
4
+ data.tar.gz: a204a1ed36d34bdf64a3f4a86b18fe88a4aa0631
5
5
  SHA512:
6
- metadata.gz: fbf53d5a5b2b7722ec0b04a7541fb16474be2954a704622b15e656bfcc5a686b5b911aa86d6511bfd4080c2f09cdea623cb8d34e7d3cf9d898e1b44cd2d75a0b
7
- data.tar.gz: fd6e2a09772a24f3f79f3c9046c00d643d3b1d694518fd6e8af778e054e452e83c20c1247eefb3ac5e4eb0f56549df02d93fc915ee9f2b71dcfee526387c084e
6
+ metadata.gz: 0db4636db8502b87c8b3af66395857814703bbf26a05132002f2559531ebad9331d69a79ab8e267c4a14de6fe4223d83ccee7288e7538afff5b0ceb5f73fb4f9
7
+ data.tar.gz: 209c5e33318c27bad6723893a8a8cccdc811bc89c4a2e4c772cef6826ec5674195ef309343d63975ce8cb1e8c0938286434cf23372db2a8c02a564db45303044
@@ -1,5 +1,8 @@
1
1
  # These are the monkeypatches to replace the default #require and
2
2
  # #require_relative in order to instrument the code before it gets run.
3
+ # Kernel.require and Kernel#require must both have their version because
4
+ # each can have been already overwritten individually. (Rubygems only
5
+ # overrides Kernel#require)
3
6
 
4
7
  class << Kernel
5
8
  alias_method :require_without_coverage, :require
@@ -22,8 +25,14 @@ class << Kernel
22
25
  end
23
26
 
24
27
  module Kernel
28
+ alias_method :require_without_coverage, :require
25
29
  def require(path)
26
- Kernel.require(path)
30
+ result = DeepCover.custom_requirer.require(path)
31
+ if [:not_found, :cover_failed, :not_supported].include?(result)
32
+ require_without_coverage(path)
33
+ else
34
+ result
35
+ end
27
36
  end
28
37
 
29
38
  def require_relative(path)
@@ -1,3 +1,3 @@
1
1
  module DeepCover
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deep-cover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-André Lafortune