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', source_file_globber: Quality::LinguistSourceFileGlobber.new, dir: Dir) ⇒ Config

Returns a new instance of Config.



58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/quality/config.rb', line 58

def initialize(quality_name: 'quality',
               ratchet_name: 'ratchet',
               source_file_globber: Quality::LinguistSourceFileGlobber.new,
               dir: Dir)
  @quality_name = quality_name
  @ratchet_name = ratchet_name
  @skip_tools = []
  @output_dir = 'metrics'
  @verbose = false
  @source_file_globber = source_file_globber
  @dir = dir
  @source_files_exclude_glob = nil
end

Instance Attribute Details

#minimum_thresholdObject



54
55
56
# File 'lib/quality/config.rb', line 54

def minimum_threshold
  @minimum_threshold ||= { bigfiles: 300 }
end

#output_dirObject

Returns the value of attribute output_dir.



14
15
16
# File 'lib/quality/config.rb', line 14

def output_dir
  @output_dir
end

#punchlist_regexpObject

Returns the value of attribute punchlist_regexp.



14
15
16
# File 'lib/quality/config.rb', line 14

def punchlist_regexp
  @punchlist_regexp
end

#quality_nameObject

Returns the value of attribute quality_name.



14
15
16
# File 'lib/quality/config.rb', line 14

def quality_name
  @quality_name
end

#ratchet_nameObject

Returns the value of attribute ratchet_name.



14
15
16
# File 'lib/quality/config.rb', line 14

def ratchet_name
  @ratchet_name
end

#scalastyle_configObject

Returns the value of attribute scalastyle_config.



14
15
16
# File 'lib/quality/config.rb', line 14

def scalastyle_config
  @scalastyle_config
end

#scalastyle_excludeObject

Returns the value of attribute scalastyle_exclude.



14
15
16
# File 'lib/quality/config.rb', line 14

def scalastyle_exclude
  @scalastyle_exclude
end

#skip_toolsObject

Returns the value of attribute skip_tools.



14
15
16
# File 'lib/quality/config.rb', line 14

def skip_tools
  @skip_tools
end

#source_files_exclude_globObject



46
47
48
# File 'lib/quality/config.rb', line 46

def source_files_exclude_glob
  @source_files_exclude_glob || to_glob(exclude_files)
end

#verboseObject

Returns the value of attribute verbose.



14
15
16
# File 'lib/quality/config.rb', line 14

def verbose
  @verbose
end

Instance Method Details

#all_output_filesObject



50
51
52
# File 'lib/quality/config.rb', line 50

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

#source_and_doc_files_globObject



42
43
44
# File 'lib/quality/config.rb', line 42

def source_and_doc_files_glob
  to_glob(source_and_doc_files)
end

#source_files_globObject



38
39
40
# File 'lib/quality/config.rb', line 38

def source_files_glob
  to_glob(source_files)
end

#to_glob(files) ⇒ Object



34
35
36
# File 'lib/quality/config.rb', line 34

def to_glob(files)
  "{#{files.join(',')}}"
end