Class: Codeqa::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#enabled_checkerObject

Returns the value of attribute enabled_checker.



6
7
8
# File 'lib/codeqa/configuration.rb', line 6

def enabled_checker
  @enabled_checker
end

#erb_engineObject

the default config file will setup all variables to some sane defaults



5
6
7
# File 'lib/codeqa/configuration.rb', line 5

def erb_engine
  @erb_engine
end

#excludesObject

Returns the value of attribute excludes.



6
7
8
# File 'lib/codeqa/configuration.rb', line 6

def excludes
  @excludes
end

#rubocop_formatter_copsObject

Returns the value of attribute rubocop_formatter_cops.



6
7
8
# File 'lib/codeqa/configuration.rb', line 6

def rubocop_formatter_cops
  @rubocop_formatter_cops
end

Instance Method Details

#default_config_pathObject



22
23
24
# File 'lib/codeqa/configuration.rb', line 22

def default_config_path
  Codeqa.root.join('config', 'default')
end

#excluded?(file) ⇒ Boolean

tests a given filepath if it should be excluded

Parameters:

  • file

    File.join compatable filepath

Returns:

  • (Boolean)


43
44
45
46
# File 'lib/codeqa/configuration.rb', line 43

def excluded?(file)
  file = File.join(Dir.pwd, file) unless file.start_with?('/')
  Codeqa.configuration.excludes.any?{ |pattern| match_path?(pattern, file) }
end

#home_config_pathObject



26
27
28
29
30
# File 'lib/codeqa/configuration.rb', line 26

def home_config_path
  home_dir_config = File.join(home_dir, DOTFILE)
  return home_dir_config if File.exist? home_dir_config
  false
end

#project_config_pathObject



32
33
34
35
36
# File 'lib/codeqa/configuration.rb', line 32

def project_config_path
  project_root_config = File.join(project_root, DOTFILE)
  return project_root_config if File.exist? project_root_config
  false
end