Module: Avm::EacRubyBase1::Rubocop::Runner::Gemfile

Defined in:
lib/avm/eac_ruby_base1/rubocop/runner/gemfile.rb

Instance Method Summary collapse

Instance Method Details

#gemfile_rubocop_commandObject



8
9
10
11
12
# File 'lib/avm/eac_ruby_base1/rubocop/runner/gemfile.rb', line 8

def gemfile_rubocop_command
  return nil unless rubocop_gemfile?

  rubocop_command_by_gemfile_path(mygem.path)
end

#rubocop_command_by_gemfile_path(path) ⇒ Object



14
15
16
# File 'lib/avm/eac_ruby_base1/rubocop/runner/gemfile.rb', line 14

def rubocop_command_by_gemfile_path(path)
  ::Avm::EacRubyBase1::Sources::Base.new(path).bundle('exec', 'rubocop').chdir_root
end

#rubocop_gemfile?Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
# File 'lib/avm/eac_ruby_base1/rubocop/runner/gemfile.rb', line 18

def rubocop_gemfile?
  return false if mygem.blank?

  mygem.bundle('install').execute!
  mygem.gemfile_lock_gem_version('rubocop').present?
end