Class: Standard::CreatesConfigStore::MergesUserConfigExtensions

Inherits:
Object
  • Object
show all
Defined in:
lib/standard/creates_config_store/merges_user_config_extensions.rb

Defined Under Namespace

Classes: ExtendConfigPlugin

Instance Method Summary collapse

Constructor Details

#initializeMergesUserConfigExtensions

Returns a new instance of MergesUserConfigExtensions.



24
25
26
# File 'lib/standard/creates_config_store/merges_user_config_extensions.rb', line 24

def initialize
  @merges_plugins_into_rubocop_config = Standard::Plugin::MergesPluginsIntoRubocopConfig.new
end

Instance Method Details

#call(options_config, standard_config) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/standard/creates_config_store/merges_user_config_extensions.rb', line 28

def call(options_config, standard_config)
  return unless standard_config[:extend_config]&.any?

  plugins = standard_config[:extend_config].map { |path|
    ExtendConfigPlugin.new(path)
  }
  @merges_plugins_into_rubocop_config.call(options_config, standard_config, plugins, permit_merging: false)
end