source_route 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/source_route/formats/html.rb +2 -1
- data/lib/source_route/formats/html_template.slim +32 -21
- data/lib/source_route/version.rb +1 -1
- data/test/source_route_test.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37be5d396bcfb224e69e6e3577f1e71ddeffe4ba
|
4
|
+
data.tar.gz: 544985519acf978873b41219ace7e89e115423f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4db59f01f059e29e2ceb2ff78101aaecb7298b66a9503ed2e5d8ebdc2f8c756a1a36165f099877a60ea9e41d9cdd47aa091153121bcb5090550d57c13af2a36
|
7
|
+
data.tar.gz: 57ddfee91d7f69b7295e2b87e1184582934ffd11da00ede3ff9bc7bb32aed2b817330a6e78d5308958b39c3f4b3c83ff9078d5e5bfb1e8642aa336a2a139c72e
|
@@ -11,7 +11,8 @@ module SourceRoute
|
|
11
11
|
slim_template = Slim::Template.new(template_path)
|
12
12
|
|
13
13
|
filename = result_config[:filename] || "#{Time.now.strftime('%H%M')}-source-route.html"
|
14
|
-
|
14
|
+
|
15
|
+
if result_config.import_return_to_call and wrapper.condition.has_call_and_return_event
|
15
16
|
wrapper.import_return_value_to_call_results
|
16
17
|
end
|
17
18
|
html_output_str = slim_template.render(wrapper)
|
@@ -6,12 +6,12 @@ html
|
|
6
6
|
script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"
|
7
7
|
script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"
|
8
8
|
|
9
|
-
body(ng-app="SourceRoute")
|
9
|
+
body(ng-app="SourceRoute" ng-controller="MainCtrl")
|
10
10
|
ruby:
|
11
11
|
local_trace_data = @tp_attrs_results.map do |tp_result|
|
12
12
|
if tp_result.key?(:defined_class)
|
13
13
|
tp_result[:defined_class] = tp_result[:defined_class].inspect
|
14
|
-
tp_result[:return_value] = tp_result[:return_value].inspect
|
14
|
+
tp_result[:return_value] = tp_result[:return_value].inspect if tp_result.key?(:return_value)
|
15
15
|
end
|
16
16
|
tp_result
|
17
17
|
end
|
@@ -20,22 +20,24 @@ html
|
|
20
20
|
/ dont use local_trace_data.to_json, because ActiveSupport override it and can introduce unexpected crash for some data
|
21
21
|
#trace-data(data-trace="#{JSON.dump(local_trace_data)}" data-tp-events="#{JSON.dump(@condition.events)}")
|
22
22
|
|
23
|
-
.container(ng-controller="MainCtrl")
|
24
|
-
.top-header(style="margin-bottom: 2em; margin-top: 2em")
|
25
23
|
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
nav.navbar.navbar-default.navbar-static-top
|
25
|
+
.container
|
26
|
+
.container-fluid
|
27
|
+
.navbar-header
|
28
|
+
a.navbar-brand(href="#" ng-click="resetTraceFilter()") ALL
|
29
|
+
ul.nav.navbar-nav
|
30
|
+
li(ng-repeat="event in tpEvents" ng-class="{active: event == traceFilter.event}")
|
31
|
+
a(href="#" ng-click="traceFilter.event = event" ng-bind="event")
|
32
|
+
ul.nav.navbar-nav.navbar-right
|
33
|
+
li
|
34
|
+
a(disabled)
|
35
|
+
span Current Trace Count
|
36
|
+
span.badge<(ng-bind="currentCounter()")
|
29
37
|
|
30
|
-
|
31
|
-
button.btn.btn-default(ng-click="resetTraceFilter()")
|
32
|
-
span ALL Event :
|
33
|
-
span<(ng-bind="tpEvents[0]")
|
34
|
-
|
35
|
-
.btn-group(ng-if="tpEvents.length > 1")
|
36
|
-
button.btn.btn-default(ng-click="resetTraceFilter()") ALL
|
37
|
-
button.btn.btn-primary(ng-bind="event" ng-click="traceFilter.event = event" ng-repeat="event in tpEvents")
|
38
|
+
.clearfix
|
38
39
|
|
40
|
+
.container
|
39
41
|
.trace-flow
|
40
42
|
.row
|
41
43
|
.left-info.col-sm-4
|
@@ -51,11 +53,11 @@ html
|
|
51
53
|
span
|
52
54
|
| .
|
53
55
|
span(ng-bind="trace.method_id")
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
/ workaround for return_value is 'false' and return_value always to be string when existed
|
57
|
+
div(ng-if="isIncludeReturnValue")
|
58
|
+
span
|
59
|
+
| =>
|
60
|
+
span<(ng-bind="trace.return_value")
|
59
61
|
|
60
62
|
.details(ng-if="showMoreDetail")
|
61
63
|
.local-vars.well.well-sm(ng-if="trace.local_var" style="color: green")
|
@@ -64,6 +66,7 @@ html
|
|
64
66
|
span<>(ng-bind="key")
|
65
67
|
span<>
|
66
68
|
| =>
|
69
|
+
/ to do: could inspect fix it?
|
67
70
|
span<>(ng-bind="value || 'null'")
|
68
71
|
.ins-vars.well.well-sm(ng-if="trace.instance_var" style="color: blue")
|
69
72
|
span Instance Var
|
@@ -80,10 +83,18 @@ html
|
|
80
83
|
javascript:
|
81
84
|
sourceRoute = angular.module('SourceRoute', [])
|
82
85
|
sourceRoute.controller('MainCtrl', function($scope, $filter) {
|
83
|
-
$scope.traceFilter = {}
|
84
86
|
$scope.traces = angular.element("#trace-data").data('trace')
|
85
87
|
$scope.tpEvents = angular.element("#trace-data").data('tp-events')
|
86
88
|
|
89
|
+
$scope.isIncludeReturnValue = !angular.isUndefined($scope.traces[0].return_value)
|
90
|
+
|
91
|
+
$scope.traceFilter = {event: $scope.tpEvents[0]}
|
92
|
+
if ($scope.tpEvents.length == 1 && angular.isUndefined($scope.traces[0].event)) {
|
93
|
+
_.each($scope.traces, function(trace) {
|
94
|
+
trace.event = $scope.tpEvents[0]
|
95
|
+
})
|
96
|
+
}
|
97
|
+
|
87
98
|
$scope.definedClasses = _.uniq(_.map($scope.traces, 'defined_class'))
|
88
99
|
|
89
100
|
$scope.resetTraceFilter = function() {
|
data/lib/source_route/version.rb
CHANGED
data/test/source_route_test.rb
CHANGED
@@ -184,7 +184,6 @@ class SourceRouteTest < Minitest::Test
|
|
184
184
|
# So Run rake test will not generate html file, run ruby -Itest test/source_route.rb will generate output file
|
185
185
|
else
|
186
186
|
SourceRoute.build_html_output
|
187
|
-
puts @wrapper.tp_attrs_results.inspect
|
188
187
|
end
|
189
188
|
end
|
190
189
|
|
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.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- raykin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|