Class: RubocopDbl::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/rubocop_dbl/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_config_fileObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/generators/rubocop_dbl/install_generator.rb', line 11

def create_config_file
  file_method = config_file_exists? ? :prepend : :create
  content = defined?(Rails) ? config_file_content_rails : config_file_content

  send(
    :"#{file_method}_file",
    config_file_path,
    content,
  )
end