Class: DepsGrapher::Command::Analyzer

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/deps_grapher/command/analyzer.rb

Instance Method Summary collapse

Methods included from Logging

#error, #info, #verbose, #warn

Constructor Details

#initialize(file_paths, context) ⇒ Analyzer

Returns a new instance of Analyzer.



8
9
10
11
# File 'lib/deps_grapher/command/analyzer.rb', line 8

def initialize(file_paths, context)
  @file_paths = file_paths
  @context = context
end

Instance Method Details

#run!Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/deps_grapher/command/analyzer.rb', line 13

def run!
  if file_paths.empty?
    warn { "No files to analyze" }
    return
  end

  clean_dir!
  analyze!
  visualize!
rescue TargetNodeNotFound => e
  info { e.message }
end