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

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

Instance Method Summary collapse

Instance Method Details

#gemfile_rubocop_commandObject



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

def gemfile_rubocop_command
  return nil unless rubocop_gemfile?

  rubocop_command_by_gemfile_path(mygem.path)
end

#rubocop_command_by_gemfile_path(path) ⇒ Object



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

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

#rubocop_gemfile?Boolean

Returns:

  • (Boolean)


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

def rubocop_gemfile?
  return false if mygem.blank?

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