Class: Develry::Config
- Inherits:
-
Object
- Object
- Develry::Config
- Defined in:
- lib/develry/config.rb
Overview
Abstract base class of tool configuration
Defined Under Namespace
Classes: Develry, Flay, Flog, Mutant, Reek, Rubocop, Yardstick
Constant Summary collapse
- DEFAULT_CONFIG =
Represent no configuration
{}.freeze
Instance Attribute Summary collapse
-
#project ⇒ Project
readonly
private
Return project.
Instance Method Summary collapse
-
#config_file ⇒ String
private
Return config path.
-
#enabled? ⇒ Boolean
private
Test if the task is enabled.
-
#initialize(project) ⇒ Project
constructor
private
Initialize object.
Constructor Details
#initialize(project) ⇒ Project
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize object
44 45 46 |
# File 'lib/develry/config.rb', line 44 def initialize(project) @project = project end |
Instance Attribute Details
#project ⇒ Project (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return project
36 37 38 |
# File 'lib/develry/config.rb', line 36 def project @project end |
Instance Method Details
#config_file ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return config path
54 55 56 |
# File 'lib/develry/config.rb', line 54 def config_file @config_file ||= project.config_dir.join(self.class::FILE).freeze end |
#enabled? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Test if the task is enabled
If there is no config file, and no sensible defaults, then the rake task should become disabled.
67 68 69 |
# File 'lib/develry/config.rb', line 67 def enabled? ! raw.equal?(DEFAULT_CONFIG) end |