Class: PhpCop::ConfigLoader
- Inherits:
-
Object
- Object
- PhpCop::ConfigLoader
- 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
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize ⇒ ConfigLoader
constructor
A new instance of ConfigLoader.
Constructor Details
#initialize ⇒ ConfigLoader
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
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/phpcop/configloader.rb', line 10 def @options end |