Class: RailsCodeHealth::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_code_health/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



5
6
7
8
9
# File 'lib/rails_code_health/configuration.rb', line 5

def initialize
  @thresholds = load_default_thresholds
  @excluded_paths = default_excluded_paths
  @output_format = :console
end

Instance Attribute Details

#excluded_pathsObject

Returns the value of attribute excluded_paths.



3
4
5
# File 'lib/rails_code_health/configuration.rb', line 3

def excluded_paths
  @excluded_paths
end

#output_formatObject

Returns the value of attribute output_format.



3
4
5
# File 'lib/rails_code_health/configuration.rb', line 3

def output_format
  @output_format
end

#thresholdsObject

Returns the value of attribute thresholds.



3
4
5
# File 'lib/rails_code_health/configuration.rb', line 3

def thresholds
  @thresholds
end

Instance Method Details

#load_thresholds_from_file(file_path) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/rails_code_health/configuration.rb', line 15

def load_thresholds_from_file(file_path)
  if File.exist?(file_path)
    @thresholds = JSON.parse(File.read(file_path))
  else
    raise Error, "Thresholds file not found: #{file_path}"
  end
end