Module: Ragnarson::Stylecheck::RubocopHelpers
- Defined in:
- lib/ragnarson/stylecheck/rubocop_helpers.rb
Overview
helper to nicely update rubocop config
Class Method Summary collapse
- .config ⇒ Object
- .project_config_exists? ⇒ Boolean
- .project_config_path ⇒ Object
- .stylecheck_config_path ⇒ Object
- .template_config_path ⇒ Object
Class Method Details
.config ⇒ Object
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
16 17 18 |
# File 'lib/ragnarson/stylecheck/rubocop_helpers.rb', line 16 def project_config_exists? File.exist?(project_config_path) end |
.project_config_path ⇒ Object
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_path ⇒ Object
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_path ⇒ Object
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 |