Class: TablexiDev::Generators::RubocopGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_gemObject



15
16
17
18
19
20
21
# File 'lib/generators/tablexi_dev/rubocop_generator.rb', line 15

def add_gem
  # Prevent us from adding the same gem directive multiple times
  # if the Gemfile already has 'rubocop' in a format other
  # than the exact format we expect.
  content = File.read("Gemfile")
  gem "rubocop", group: %i[development test], require: false unless content.include?("rubocop")
end

#copy_filesObject



11
12
13
# File 'lib/generators/tablexi_dev/rubocop_generator.rb', line 11

def copy_files
  install_rubocop_config_files
end