Class: Codeqa::Configuration
- Inherits:
-
Object
- Object
- Codeqa::Configuration
- Defined in:
- lib/codeqa/configuration.rb
Instance Attribute Summary collapse
-
#enabled_checker ⇒ Object
Returns the value of attribute enabled_checker.
-
#erb_engine ⇒ Object
the default config file will setup all variables to some sane defaults.
-
#excludes ⇒ Object
Returns the value of attribute excludes.
-
#rubocop_formatter_cops ⇒ Object
Returns the value of attribute rubocop_formatter_cops.
Instance Method Summary collapse
- #default_config_path ⇒ Object
-
#excluded?(file) ⇒ Boolean
tests a given filepath if it should be excluded.
- #home_config_path ⇒ Object
- #project_config_path ⇒ Object
Instance Attribute Details
#enabled_checker ⇒ Object
Returns the value of attribute enabled_checker.
6 7 8 |
# File 'lib/codeqa/configuration.rb', line 6 def enabled_checker @enabled_checker end |
#erb_engine ⇒ Object
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 |
#excludes ⇒ Object
Returns the value of attribute excludes.
6 7 8 |
# File 'lib/codeqa/configuration.rb', line 6 def excludes @excludes end |
#rubocop_formatter_cops ⇒ Object
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_path ⇒ Object
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
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_path ⇒ Object
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_path ⇒ Object
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 |