overrider 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/overrider.rb +6 -4
- data/lib/overrider/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f5f6427ceb87b0ec35bc2cd671ee20adec487cec6d5b360194ef010700fe8b7
|
4
|
+
data.tar.gz: f060e48860d1e11560fefb8e7008b16d99e7c44d11389802b6004243aacd399b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8ed5bf14feef878b73f1be4153badae266baed307def1c95440092dc2120df56e3bbc45dd4de47fa3bb805effb67aa7998b554f5c5cd5a02318b7611079e5f7
|
7
|
+
data.tar.gz: 05a8c4c1dc1c2b7e91ba36a3b0f134a879dec3d688940fae35aea12e5f3e7119ff1fedfd47a60335a56a8e76da87f4b9fe55fa336fdc7669ef78c6e924725992
|
data/README.md
CHANGED
@@ -53,8 +53,8 @@ end # => raise
|
|
53
53
|
```
|
54
54
|
|
55
55
|
### for Production
|
56
|
-
If you want to disable
|
57
|
-
If
|
56
|
+
If you want to disable Overrider, write `Overrider.disable = true` at first line.
|
57
|
+
If Overrider is disabled, TracePoint never runs, and so there is no overhead of VM instruction.
|
58
58
|
|
59
59
|
### Caution
|
60
60
|
|
data/lib/overrider.rb
CHANGED
@@ -31,11 +31,13 @@ module Overrider
|
|
31
31
|
using Module.new {
|
32
32
|
refine Module do
|
33
33
|
def detect_event_type
|
34
|
-
caller_info = caller_locations(2,
|
35
|
-
if caller_info.label.match?(/
|
36
|
-
[:
|
37
|
-
|
34
|
+
caller_info = caller_locations(2, 2)[0]
|
35
|
+
if caller_info.label.match?(/<class/) || caller_info.label.match?(/<module/)
|
36
|
+
[:end, :raise]
|
37
|
+
elsif caller_info.label.match?(/singleton class/)
|
38
38
|
[:end, :raise]
|
39
|
+
else
|
40
|
+
[:b_call, :b_return, :raise]
|
39
41
|
end
|
40
42
|
end
|
41
43
|
end
|
data/lib/overrider/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: overrider
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joker1007
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|