Module: Ragnarson::Stylecheck::RubocopHelpers

Defined in:
lib/ragnarson/stylecheck/rubocop_helpers.rb

Overview

helper to nicely update rubocop config

Class Method Summary collapse

Class Method Details

.configObject



8
9
10
11
12
13
14
# File 'lib/ragnarson/stylecheck/rubocop_helpers.rb', line 8

def config
  if project_config_exists?
    project_config_path
  else
    stylecheck_config_path
  end
end

.project_config_exists?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/ragnarson/stylecheck/rubocop_helpers.rb', line 16

def project_config_exists?
  File.exist?(project_config_path)
end

.project_config_pathObject



20
21
22
# File 'lib/ragnarson/stylecheck/rubocop_helpers.rb', line 20

def project_config_path
  File.join(Dir.pwd, "config", "rubocop.yml")
end

.stylecheck_config_pathObject



24
25
26
# File 'lib/ragnarson/stylecheck/rubocop_helpers.rb', line 24

def stylecheck_config_path
  File.join(Ragnarson::Stylecheck.root, "config", "rubocop.yml")
end

.template_config_pathObject



28
29
30
# File 'lib/ragnarson/stylecheck/rubocop_helpers.rb', line 28

def template_config_path
  File.join(Ragnarson::Stylecheck.root, "lib", "ragnarson", "templates", "rubocop.yml")
end