diff options
Diffstat (limited to 'rubocop/cop/project_path_helper.rb')
-rw-r--r-- | rubocop/cop/project_path_helper.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/rubocop/cop/project_path_helper.rb b/rubocop/cop/project_path_helper.rb index f3810622eb1..2842638064e 100644 --- a/rubocop/cop/project_path_helper.rb +++ b/rubocop/cop/project_path_helper.rb @@ -1,9 +1,9 @@ module RuboCop module Cop class ProjectPathHelper < RuboCop::Cop::Cop - MSG = 'Use short project path helpers without explicitly passing the namespace: ' \ - '`foo_project_bar_path(project, bar)` instead of ' \ - '`foo_namespace_project_bar_path(project.namespace, project, bar)`.'.freeze + MSG = "Use short project path helpers without explicitly passing the namespace: " \ + "`foo_project_bar_path(project, bar)` instead of " \ + "`foo_namespace_project_bar_path(project.namespace, project, bar)`.".freeze METHOD_NAME_PATTERN = /\A([a-z_]+_)?namespace_project(?:_[a-z_]+)?_(?:url|path)\z/.freeze @@ -21,12 +21,12 @@ module RuboCop end def autocorrect(node) - helper_name = method_name(node).to_s.sub('namespace_project', 'project') + helper_name = method_name(node).to_s.sub("namespace_project", "project") arguments = arguments(node) arguments.shift # Remove namespace argument - replacement = "#{helper_name}(#{arguments.map(&:source).join(', ')})" + replacement = "#{helper_name}(#{arguments.map(&:source).join(", ")})" lambda do |corrector| corrector.replace(node.source_range, replacement) |