Module: Avm::Sources::Configuration::Rubocop

Defined in:
lib/avm/sources/configuration/rubocop.rb

Constant Summary collapse

RUBOCOP_COMMAND_KEY =
'ruby.rubocop.command'
RUBOCOP_GEMFILE_KEY =
'ruby.rubocop.gemfile'

Instance Method Summary collapse

Instance Method Details

#rubocop_commandObject



10
11
12
# File 'lib/avm/sources/configuration/rubocop.rb', line 10

def rubocop_command
  read_command(RUBOCOP_COMMAND_KEY)
end

#rubocop_gemfileObject



14
15
16
17
18
19
20
21
22
# File 'lib/avm/sources/configuration/rubocop.rb', line 14

def rubocop_gemfile
  gemfile_path = read_entry(RUBOCOP_GEMFILE_KEY)
  return nil if gemfile_path.blank?

  gemfile_path = gemfile_path.to_pathname.expand_path(storage_path.parent)
  return gemfile_path if gemfile_path.file?

  raise "Gemfile path \"#{gemfile_path}\" does not exist or is not a file"
end