Class: Churnalizer::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/churnalizer/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



7
8
9
10
# File 'lib/churnalizer/cli.rb', line 7

def initialize
  @path = path
  analyze
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



5
6
7
# File 'lib/churnalizer/cli.rb', line 5

def path
  @path
end

Instance Method Details

#analyzeObject



12
13
14
15
# File 'lib/churnalizer/cli.rb', line 12

def analyze
  return help if path.nil?
  puts churnalizer.run
end

#churnalizerObject



17
18
19
# File 'lib/churnalizer/cli.rb', line 17

def churnalizer
  @churnalizer ||= Churnalizer::Analyzer.new(path)
end

#helpObject



21
22
23
24
25
26
27
28
# File 'lib/churnalizer/cli.rb', line 21

def help
  puts """This is Churnalizer, a churn vs complexity analyzer for your Ruby
application.

Usage:
churnalizer my-app/
  """
end