active_interaction_mapper 0.1.1 → 0.1.2
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34617c785387380e983feab4a68843197ef5e876159babdfd03b56a6b0a991a2
|
4
|
+
data.tar.gz: c4dad041abcd489e3be9b54684fc172513d1450247026d25898a5d8c755756eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0420ee1c9c39fbac01a06a9434d23d44001e55a2cbe0bc900bb91c077f3d9e47cca92e0c6ef1c48eb839c1e75ad51306ba96cfc3e747b4ea5f118cda082050e
|
7
|
+
data.tar.gz: 328baf982d6b62f45cc443a63f4f4b445676971329b36f5829f407e9cc689828645ce1406dc72c56d606790c598e96d21661be33fa84eb1fa554cb33dff17d91
|
@@ -13,13 +13,13 @@ require "active_interaction_mapper/output/dot"
|
|
13
13
|
module ActiveInteractionMapper
|
14
14
|
class Error < StandardError; end
|
15
15
|
|
16
|
-
def self.trace(start_at: nil, output_image: true, folder_name:'', file_name:'', &block)
|
16
|
+
def self.trace(start_at: nil, output_image: true, folder_name:'', file_name:'', show_duplicated_path: false, &block)
|
17
17
|
filters = []
|
18
18
|
filters << Filter::StartAt.new(start_at) if start_at
|
19
19
|
filters << Filter::ActiveInteractionFilter.new
|
20
20
|
|
21
21
|
if output_image
|
22
|
-
output = ActiveInteractionMapper::Output::Dot.new(folder_name: folder_name, file_name: file_name)
|
22
|
+
output = ActiveInteractionMapper::Output::Dot.new(folder_name: folder_name, file_name: file_name, show_duplicated_path: show_duplicated_path)
|
23
23
|
else
|
24
24
|
output = ActiveInteractionMapper::Output::Text.new($stdout)
|
25
25
|
end
|
@@ -6,7 +6,7 @@ require 'date'
|
|
6
6
|
module ActiveInteractionMapper
|
7
7
|
module Output
|
8
8
|
class Dot
|
9
|
-
def initialize(folder_name:'', file_name:'')
|
9
|
+
def initialize(folder_name:'', file_name:'', show_duplicated_path: false)
|
10
10
|
d = DateTime.now
|
11
11
|
d_string = d.strftime("%d%m%Y_%H%M%S")
|
12
12
|
if folder_name.empty?
|
@@ -19,6 +19,8 @@ module ActiveInteractionMapper
|
|
19
19
|
else
|
20
20
|
@file_name = "#{file_name}_#{d_string}.png"
|
21
21
|
end
|
22
|
+
@show_duplicated_path = show_duplicated_path
|
23
|
+
@edges = []
|
22
24
|
@stack = []
|
23
25
|
@graph = GraphViz.new('CodeMapper')
|
24
26
|
|
@@ -29,7 +31,14 @@ module ActiveInteractionMapper
|
|
29
31
|
|
30
32
|
|
31
33
|
if @stack != []
|
32
|
-
|
34
|
+
if !@show_duplicated_path
|
35
|
+
if !@edges.include? "#{@stack.last};#{node}"
|
36
|
+
@graph.add_edge(@stack.last,node)
|
37
|
+
@edges << "#{@stack.last};#{node}"
|
38
|
+
end
|
39
|
+
else
|
40
|
+
@graph.add_edge(@stack.last,node)
|
41
|
+
end
|
33
42
|
end
|
34
43
|
|
35
44
|
@stack << node
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_interaction_mapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- charbel-elhajj
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-graphviz
|