Class: Templatecop::RuboCopConfigGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/templatecop/rubo_cop_config_generator.rb

Overview

Generate RuboCop::Config.

Instance Method Summary collapse

Constructor Details

#initialize(default_configuration_path:, forced_configuration_path:, implicit_configuration_paths:) ⇒ RuboCopConfigGenerator

Returns a new instance of RuboCopConfigGenerator.

Parameters:

  • default_configuration_path (String)
  • forced_configuration_path (String, nil)
  • implicit_configuration_paths (Array<String>)


11
12
13
14
15
16
17
18
19
# File 'lib/templatecop/rubo_cop_config_generator.rb', line 11

def initialize(
  default_configuration_path:,
  forced_configuration_path:,
  implicit_configuration_paths:
)
  @default_configuration_path = default_configuration_path
  @forced_configuration_path = forced_configuration_path
  @implicit_configuration_paths = implicit_configuration_paths
end

Instance Method Details

#callRuboCop::Config

Returns:

  • (RuboCop::Config)


22
23
24
# File 'lib/templatecop/rubo_cop_config_generator.rb', line 22

def call
  ::RuboCop::ConfigLoader.merge_with_default(merged_config, loaded_path)
end