Class: PhpCop::ConfigLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/phpcop/configloader.rb

Overview

This class load a files configuration to gem. So config file default and customize config file in project scan

Constant Summary collapse

DEFAULT_PATH =

Path to gem

File.realpath(File.join(File.dirname(__FILE__), '..', '..'))
DEFAULT_CONF =

Config file in gem

File.join(DEFAULT_PATH, 'config', 'default.yml')
CUSTOMIZE_CONF =

Config file in project PHP

'.phpcop.yml'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfigLoader

Returns a new instance of ConfigLoader.



19
20
21
22
# File 'lib/phpcop/configloader.rb', line 19

def initialize
  @options = load_configuration(DEFAULT_CONF)
  @options ||= load_configuration(CUSTOMIZE_CONF)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/phpcop/configloader.rb', line 10

def options
  @options
end