Class: PodPrebuild::Visualizer

Inherits:
CommandExecutor show all
Defined in:
lib/command/executor/visualizer.rb

Instance Method Summary collapse

Methods inherited from CommandExecutor

#git, #git_clone, #installer, #prepare_cache_dir, #use_local_cache?

Constructor Details

#initialize(options) ⇒ Visualizer

Returns a new instance of Visualizer.



6
7
8
9
10
11
12
13
# File 'lib/command/executor/visualizer.rb', line 6

def initialize(options)
  super(options)
  @lockfile = options[:lockfile]
  @open = options[:open]
  @output_dir = options[:output_dir]
  @devpod_only = options[:devpod_only]
  @max_deps = options[:max_deps]
end

Instance Method Details

#runObject



15
16
17
18
19
20
21
# File 'lib/command/executor/visualizer.rb', line 15

def run
  FileUtils.mkdir_p(@output_dir)
  graph = DependenciesGraph.new(lockfile: @lockfile, devpod_only: @devpod_only, max_deps: @max_deps)
  output_path = "#{@output_dir}/graph.png"
  graph.write_graphic_file(output_path: output_path)
  system("open #{@output_path}") if @open
end