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.



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/quality/config.rb', line 45

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

#exclude_filesObject



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

def exclude_files
  @exclude_files || []
end

#output_dirObject

Returns the value of attribute output_dir.



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

def output_dir
  @output_dir
end

#punchlist_regexpObject

Returns the value of attribute punchlist_regexp.



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

def punchlist_regexp
  @punchlist_regexp
end

#quality_nameObject

Returns the value of attribute quality_name.



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

def quality_name
  @quality_name
end

#ratchet_nameObject

Returns the value of attribute ratchet_name.



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

def ratchet_name
  @ratchet_name
end

#skip_toolsObject

Returns the value of attribute skip_tools.



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

def skip_tools
  @skip_tools
end

#source_files_exclude_globObject



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

def source_files_exclude_glob
  @source_files_exclude_glob || to_glob(exclude_files)
end

#verboseObject

Returns the value of attribute verbose.



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

def verbose
  @verbose
end

Instance Method Details

#all_output_filesObject



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

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

#source_and_doc_files_globObject



29
30
31
# File 'lib/quality/config.rb', line 29

def source_and_doc_files_glob
  to_glob(source_and_doc_files)
end

#source_files_globObject



25
26
27
# File 'lib/quality/config.rb', line 25

def source_files_glob
  to_glob(source_files)
end

#to_glob(files) ⇒ Object



21
22
23
# File 'lib/quality/config.rb', line 21

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