active_interaction_mapper 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04df9c268dba3ec70903f55e79c1c2192ea5b48e56c54efe90151236163ba8ec
4
- data.tar.gz: 0b52c77f0a6f2ad1f8fef6d0110c48019e736a80e4e15f528009dc5250f3444d
3
+ metadata.gz: 34617c785387380e983feab4a68843197ef5e876159babdfd03b56a6b0a991a2
4
+ data.tar.gz: c4dad041abcd489e3be9b54684fc172513d1450247026d25898a5d8c755756eb
5
5
  SHA512:
6
- metadata.gz: 1948eb450ee1077ac2ad496d04010dd918ac3061f464258fa535bf103bb28137bc23ac6388d508698ba99095dc8db7590a56541afa135acf93ab72826197dd01
7
- data.tar.gz: 4cae1c962e177c00f828a0423f2bc254106d013774750b14a3f380aac925396730b2e9192d5bad0a65e5f293ba1034e329a23cacf79262cf0de9aff90a1f1da9
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
- @graph.add_edge(@stack.last,node)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveInteractionMapper
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
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.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-10 00:00:00.000000000 Z
11
+ date: 2021-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-graphviz