summaryrefslogtreecommitdiff
path: root/lib/extracts_path.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-11-22 15:50:36 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-11-22 17:06:57 +0800
commit07d3d44775f6cc5b7a1b768cb4e5b7900d543815 (patch)
tree9b87200493dfc56a64aa6716ff4f03794b8f24c3 /lib/extracts_path.rb
parent15edf741a14a53443fb39ecb59888e75697b9c2b (diff)
downloadgitlab-ce-07d3d44775f6cc5b7a1b768cb4e5b7900d543815.tar.gz
Move ModuleWithInstanceVariables to Gitlab namespace
And use .rubocop.yml to exclude paths we don't care, rather than using the cop itself to exclude.
Diffstat (limited to 'lib/extracts_path.rb')
-rw-r--r--lib/extracts_path.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb
index 40a65aad631..26f699f4c9d 100644
--- a/lib/extracts_path.rb
+++ b/lib/extracts_path.rb
@@ -40,7 +40,7 @@ module ExtractsPath
def extract_ref(id)
pair = ['', '']
- return pair unless @project # rubocop:disable Cop/ModuleWithInstanceVariables
+ return pair unless @project # rubocop:disable Gitlab/ModuleWithInstanceVariables
if id =~ /^(\h{40})(.+)/
# If the ref appears to be a SHA, we're done, just split the string
@@ -104,7 +104,7 @@ module ExtractsPath
#
# Automatically renders `not_found!` if a valid tree path could not be
# resolved (e.g., when a user inserts an invalid path or ref).
- # rubocop:disable Cop/ModuleWithInstanceVariables
+ # rubocop:disable Gitlab/ModuleWithInstanceVariables
def assign_ref_vars
# assign allowed options
allowed_options = ["filter_ref"]
@@ -132,10 +132,10 @@ module ExtractsPath
rescue RuntimeError, NoMethodError, InvalidPathError
render_404
end
- # rubocop:enable Cop/ModuleWithInstanceVariables
+ # rubocop:enable Gitlab/ModuleWithInstanceVariables
def tree
- @tree ||= @repo.tree(@commit.id, @path) # rubocop:disable Cop/ModuleWithInstanceVariables
+ @tree ||= @repo.tree(@commit.id, @path) # rubocop:disable Gitlab/ModuleWithInstanceVariables
end
private
@@ -148,8 +148,8 @@ module ExtractsPath
end
def ref_names
- return [] unless @project # rubocop:disable Cop/ModuleWithInstanceVariables
+ return [] unless @project # rubocop:disable Gitlab/ModuleWithInstanceVariables
- @ref_names ||= @project.repository.ref_names # rubocop:disable Cop/ModuleWithInstanceVariables
+ @ref_names ||= @project.repository.ref_names # rubocop:disable Gitlab/ModuleWithInstanceVariables
end
end