Class: Hound::Tools::HoundConfig
- Inherits:
-
Object
- Object
- Hound::Tools::HoundConfig
- Defined in:
- lib/hound/tools/runner.rb
Instance Attribute Summary collapse
-
#rubocop_data ⇒ Object
readonly
Returns the value of attribute rubocop_data.
-
#rubocop_file ⇒ Object
readonly
Returns the value of attribute rubocop_file.
-
#yaml ⇒ Object
readonly
Returns the value of attribute yaml.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize(filename) ⇒ HoundConfig
constructor
A new instance of HoundConfig.
Constructor Details
#initialize(filename) ⇒ HoundConfig
Returns a new instance of HoundConfig.
12 13 14 15 16 17 |
# File 'lib/hound/tools/runner.rb', line 12 def initialize(filename) @yaml = YAML.load(IO.read(filename)) @enabled = @yaml['ruby'].fetch('enabled', true) @rubocop_file = @yaml['ruby'].fetch('config_file', nil) @rubocop_data = @rubocop_file && YAML.load(IO.read(@rubocop_file)) end |
Instance Attribute Details
#rubocop_data ⇒ Object (readonly)
Returns the value of attribute rubocop_data.
6 7 8 |
# File 'lib/hound/tools/runner.rb', line 6 def rubocop_data @rubocop_data end |
#rubocop_file ⇒ Object (readonly)
Returns the value of attribute rubocop_file.
5 6 7 |
# File 'lib/hound/tools/runner.rb', line 5 def rubocop_file @rubocop_file end |
#yaml ⇒ Object (readonly)
Returns the value of attribute yaml.
4 5 6 |
# File 'lib/hound/tools/runner.rb', line 4 def yaml @yaml end |
Instance Method Details
#enabled? ⇒ Boolean
8 9 10 |
# File 'lib/hound/tools/runner.rb', line 8 def enabled? @enabled end |