Class: DebtCeiling::Audit

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
CommonMethods
Defined in:
lib/debt_ceiling/audit.rb

Constant Summary collapse

CONFIG_FILE_NAME =
".debt_ceiling.rb"
CONFIG_LOCATIONS =
["#{Dir.pwd}/#{CONFIG_FILE_NAME}", "#{Dir.home}/#{CONFIG_FILE_NAME}"]
FAILURE_MESSAGE =
"DEBT CEILING FAILURE: "
TOTAL_LIMIT =
"EXCEEDED TOTAL DEBT CEILING "
NO_CONFIG_FOUND =
"No #{CONFIG_FILE_NAME} configuration file detected in #{Dir.pwd} or ~/, using defaults"
PER_MODULE_MESSAGE =
"MAX DEBT PER MODULE EXCEEDED IN AT LEAST ONE LOCATION"
MISSED_TARGET_MESSAGE =
"MISSED DEBT REDUCTION TARGET "

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CommonMethods

#+, #configuration

Constructor Details

#initialize(dir = '.', opts = {}) ⇒ Audit

Returns a new instance of Audit.



22
23
24
25
26
27
28
29
# File 'lib/debt_ceiling/audit.rb', line 22

def initialize(dir = '.', opts = {})
  @loaded     = opts[:preconfigured]
  @dir        = dir
  @accounting = perform_accounting
  accounting.print_results unless opts[:skip_report]
  puts failure_message
  fail_test if failed_condition? && !opts[:warn_only]
end

Instance Attribute Details

#accountingObject (readonly)

Returns the value of attribute accounting.



15
16
17
# File 'lib/debt_ceiling/audit.rb', line 15

def accounting
  @accounting
end

#dirObject (readonly)

Returns the value of attribute dir.



15
16
17
# File 'lib/debt_ceiling/audit.rb', line 15

def dir
  @dir
end

#loadedObject (readonly)

Returns the value of attribute loaded.



15
16
17
# File 'lib/debt_ceiling/audit.rb', line 15

def loaded
  @loaded
end