Class: Quality::Config
- Inherits:
-
Object
- Object
- Quality::Config
- Extended by:
- Forwardable
- Defined in:
- lib/quality/config.rb
Overview
Configuration for running quality tool
Instance Attribute Summary collapse
- #minimum_threshold ⇒ Object
-
#output_dir ⇒ Object
Returns the value of attribute output_dir.
-
#punchlist_regexp ⇒ Object
Returns the value of attribute punchlist_regexp.
-
#quality_name ⇒ Object
Returns the value of attribute quality_name.
-
#ratchet_name ⇒ Object
Returns the value of attribute ratchet_name.
-
#scalastyle_config ⇒ Object
Returns the value of attribute scalastyle_config.
-
#scalastyle_exclude ⇒ Object
Returns the value of attribute scalastyle_exclude.
-
#skip_tools ⇒ Object
Returns the value of attribute skip_tools.
- #source_files_exclude_glob ⇒ Object
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
- #all_output_files ⇒ Object
-
#initialize(quality_name: 'quality', ratchet_name: 'ratchet', source_file_globber: Quality::LinguistSourceFileGlobber.new, dir: Dir) ⇒ Config
constructor
A new instance of Config.
- #source_and_doc_files_glob ⇒ Object
- #source_files_glob ⇒ Object
- #to_glob(files) ⇒ Object
Constructor Details
#initialize(quality_name: 'quality', ratchet_name: 'ratchet', source_file_globber: Quality::LinguistSourceFileGlobber.new, dir: Dir) ⇒ Config
Returns a new instance of Config.
56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/quality/config.rb', line 56 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_threshold ⇒ Object
52 53 54 |
# File 'lib/quality/config.rb', line 52 def minimum_threshold @minimum_threshold ||= { bigfiles: 300 } end |
#output_dir ⇒ Object
Returns the value of attribute output_dir.
12 13 14 |
# File 'lib/quality/config.rb', line 12 def output_dir @output_dir end |
#punchlist_regexp ⇒ Object
Returns the value of attribute punchlist_regexp.
12 13 14 |
# File 'lib/quality/config.rb', line 12 def punchlist_regexp @punchlist_regexp end |
#quality_name ⇒ Object
Returns the value of attribute quality_name.
12 13 14 |
# File 'lib/quality/config.rb', line 12 def quality_name @quality_name end |
#ratchet_name ⇒ Object
Returns the value of attribute ratchet_name.
12 13 14 |
# File 'lib/quality/config.rb', line 12 def ratchet_name @ratchet_name end |
#scalastyle_config ⇒ Object
Returns the value of attribute scalastyle_config.
12 13 14 |
# File 'lib/quality/config.rb', line 12 def scalastyle_config @scalastyle_config end |
#scalastyle_exclude ⇒ Object
Returns the value of attribute scalastyle_exclude.
12 13 14 |
# File 'lib/quality/config.rb', line 12 def scalastyle_exclude @scalastyle_exclude end |
#skip_tools ⇒ Object
Returns the value of attribute skip_tools.
12 13 14 |
# File 'lib/quality/config.rb', line 12 def skip_tools @skip_tools end |
#source_files_exclude_glob ⇒ Object
44 45 46 |
# File 'lib/quality/config.rb', line 44 def source_files_exclude_glob @source_files_exclude_glob || to_glob(exclude_files) end |
#verbose ⇒ Object
Returns the value of attribute verbose.
12 13 14 |
# File 'lib/quality/config.rb', line 12 def verbose @verbose end |
Instance Method Details
#all_output_files ⇒ Object
48 49 50 |
# File 'lib/quality/config.rb', line 48 def all_output_files @dir.glob("#{output_dir}/*_high_water_mark") end |
#source_and_doc_files_glob ⇒ Object
40 41 42 |
# File 'lib/quality/config.rb', line 40 def source_and_doc_files_glob to_glob(source_and_doc_files) end |
#source_files_glob ⇒ Object
36 37 38 |
# File 'lib/quality/config.rb', line 36 def source_files_glob to_glob(source_files) end |
#to_glob(files) ⇒ Object
32 33 34 |
# File 'lib/quality/config.rb', line 32 def to_glob(files) "{#{files.join(',')}}" end |