source_route 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 +4 -4
- data/README.md +2 -0
- data/examples/study_callback.rb +1 -1
- data/lib/source_route/tp_result_chain.rb +3 -2
- data/lib/source_route/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33409f8b60b621ff40f5df4c5154430334884017
|
4
|
+
data.tar.gz: 2fcdf3f68ed75e8dede1f051e804058285834ae5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0e36502780c37fefdffb66f8cb120bed3f1d007bfa599fc7061fc482156b66e2184818ef1becdf28a5f396e0e60204ec2ffdf9bf7bd2b4cd79596568bdbaff4
|
7
|
+
data.tar.gz: 4e5980aaa635a1235079e694dad739615f274d03f408f3ab3d4afe1063c3ac5714554643ac27232e6e667ee54af38c852c4ba67ae2013b2a64dacea2f061ac2a
|
data/README.md
CHANGED
@@ -66,6 +66,8 @@ It will output the trace when you run the application.
|
|
66
66
|
see more usage in examples.
|
67
67
|
see full usage in examples/study_callback.rb
|
68
68
|
|
69
|
+
![Study Callback Example](https://cloud.githubusercontent.com/assets/490502/5468821/decbb8fe-860e-11e4-9b74-7aef7f8679fd.png)
|
70
|
+
|
69
71
|
## Why
|
70
72
|
|
71
73
|
I always wanna upgrade my ruby(rails) skills. But everytime when I looking for workaround from stack overflow I feel frustration.
|
data/examples/study_callback.rb
CHANGED
@@ -4,7 +4,7 @@ require 'source_route'
|
|
4
4
|
|
5
5
|
SourceRoute.enable do
|
6
6
|
method_id 'base_decorate', 'prepare_decorate'
|
7
|
-
defined_class 'ActiveSupport::Callbacks', '
|
7
|
+
defined_class 'ActiveSupport::Callbacks', 'House', 'Filters'
|
8
8
|
result_config.filename = 'trace_callback.html'
|
9
9
|
full_feature 10
|
10
10
|
end
|
@@ -39,10 +39,11 @@ module SourceRoute
|
|
39
39
|
def treeize_call_chain
|
40
40
|
init_order_id_and_parent_ids
|
41
41
|
call_chain.each do |tpr|
|
42
|
-
return_tpr = return_chain.find do |rtpr|
|
43
|
-
rtpr[:defined_class] == tpr[:defined_class] and rtpr[:method_id] == tpr[:method_id]
|
42
|
+
return_tpr = return_chain.reject { |c| c[:record_parent] }.find do |rtpr|
|
43
|
+
rtpr[:tp_self] == tpr[:tp_self] and rtpr[:defined_class] == tpr[:defined_class] and rtpr[:method_id] == tpr[:method_id]
|
44
44
|
end
|
45
45
|
unless return_tpr.nil?
|
46
|
+
return_tpr[:record_parent] = true
|
46
47
|
start_index, end_index = tpr[:order_id], return_tpr[:order_id]
|
47
48
|
unless end_index == start_index + 1
|
48
49
|
values_at(start_index+1 ... end_index).select { |tpr| tpr[:event] == :call }.each do |tpr|
|
data/lib/source_route/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: source_route
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- raykin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -171,4 +171,3 @@ test_files:
|
|
171
171
|
- test/source_route/wrapper_test.rb
|
172
172
|
- test/source_route_test.rb
|
173
173
|
- test/test_helper.rb
|
174
|
-
has_rdoc:
|