Class: Deadlyzer::Analyzer

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/deadlyzer/analyzer.rb,
lib/deadlyzer/analyzer/utils.rb,
lib/deadlyzer/analyzer/configurator.rb

Defined Under Namespace

Modules: Utils Classes: Configurator

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

included

Constructor Details

#initialize(argv = []) ⇒ Analyzer

Returns a new instance of Analyzer.



39
40
41
42
43
# File 'lib/deadlyzer/analyzer.rb', line 39

def initialize(argv = [])
  @config_file            = argv.pop || default_config_file
  @empty_files            = []
  @constants_may_not_used = []
end

Instance Attribute Details

#against_constantsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



31
32
33
# File 'lib/deadlyzer/analyzer.rb', line 31

def against_constants
  @against_constants
end

#configObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



19
20
21
# File 'lib/deadlyzer/analyzer.rb', line 19

def config
  @config
end

#config_fileObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



15
16
17
# File 'lib/deadlyzer/analyzer.rb', line 15

def config_file
  @config_file
end

#config_file_ctxObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



23
24
25
# File 'lib/deadlyzer/analyzer.rb', line 23

def config_file_ctx
  @config_file_ctx
end

#constants_may_not_usedObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



35
36
37
# File 'lib/deadlyzer/analyzer.rb', line 35

def constants_may_not_used
  @constants_may_not_used
end

#empty_filesObject (readonly)

Returns the value of attribute empty_files.



37
38
39
# File 'lib/deadlyzer/analyzer.rb', line 37

def empty_files
  @empty_files
end

#target_constantsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



27
28
29
# File 'lib/deadlyzer/analyzer.rb', line 27

def target_constants
  @target_constants
end

Instance Method Details

#analize!Object

Main wrapper analize method

Since:

  • 0.1.0



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/deadlyzer/analyzer.rb', line 47

def analize!
  SpinningCursor.run do
    banner "Analyzing".yellow
    type :dots
    
    action do
      read_configs!
      load_config!
      load_target_constants!
      load_against_constants!
      match!
      send_out!
    end
  end
end