Class: Hound::Tools::HoundConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/hound/tools/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_dataObject (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_fileObject (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

#yamlObject (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

Returns:

  • (Boolean)


8
9
10
# File 'lib/hound/tools/runner.rb', line 8

def enabled?
  @enabled
end