Class: Quality::Config

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/quality/config.rb

Overview

Configuration for running quality tool

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(quality_name: 'quality', ratchet_name: 'ratchet', globber: raise) ⇒ Config

Returns a new instance of Config.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/quality/config.rb', line 78

def initialize(quality_name: 'quality',
               ratchet_name: 'ratchet',
               globber: raise)
  @quality_name = quality_name
  @ratchet_name = ratchet_name
  @skip_tools = []
  @output_dir = 'metrics'
  @verbose = false
  @globber = globber
  source_file_globber.source_files_exclude_glob =
    '{' + source_file_globber.source_files_exclude_glob +
    ',db/schema.rb' \
    '}'
end

Instance Attribute Details

#output_dirObject

Returns the value of attribute output_dir.



10
11
12
# File 'lib/quality/config.rb', line 10

def output_dir
  @output_dir
end

#punchlist_regexpObject

Returns the value of attribute punchlist_regexp.



10
11
12
# File 'lib/quality/config.rb', line 10

def punchlist_regexp
  @punchlist_regexp
end

#quality_nameObject

Returns the value of attribute quality_name.



10
11
12
# File 'lib/quality/config.rb', line 10

def quality_name
  @quality_name
end

#ratchet_nameObject

Returns the value of attribute ratchet_name.



10
11
12
# File 'lib/quality/config.rb', line 10

def ratchet_name
  @ratchet_name
end

#skip_toolsObject

Returns the value of attribute skip_tools.



10
11
12
# File 'lib/quality/config.rb', line 10

def skip_tools
  @skip_tools
end

#verboseObject

Returns the value of attribute verbose.



10
11
12
# File 'lib/quality/config.rb', line 10

def verbose
  @verbose
end

Instance Method Details

#all_output_filesObject



74
75
76
# File 'lib/quality/config.rb', line 74

def all_output_files
  @globber.glob("#{output_dir}/*_high_water_mark")
end

#source_file_globberObject



69
70
71
72
# File 'lib/quality/config.rb', line 69

def source_file_globber
  @source_file_globber ||=
    SourceFinder::SourceFileGlobber.new(globber: @globber)
end