summaryrefslogtreecommitdiff
path: root/lib/extracts_path.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-09-19 01:25:23 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-09-19 01:29:32 +0800
commit6a4ee9aa7140862075cafae1ddebd133eec52b5b (patch)
tree9890bb5c906a0d6e207149ae5fe1df84d213fa7c /lib/extracts_path.rb
parent9ae92b8caa6c11d8860f86b7d6378062215d1b72 (diff)
downloadgitlab-ce-6a4ee9aa7140862075cafae1ddebd133eec52b5b.tar.gz
Allow simple ivar ||= form. Update accordingly
Diffstat (limited to 'lib/extracts_path.rb')
-rw-r--r--lib/extracts_path.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb
index f3e5b1c1109..9e01eed06f3 100644
--- a/lib/extracts_path.rb
+++ b/lib/extracts_path.rb
@@ -1,6 +1,5 @@
# Module providing methods for dealing with separating a tree-ish string and a
# file path string when combined in a request parameter
-# rubocop:disable Cop/ModuleWithInstanceVariables
module ExtractsPath
# Raised when given an invalid file path
InvalidPathError = Class.new(StandardError)
@@ -38,6 +37,7 @@ module ExtractsPath
#
# Returns an Array where the first value is the tree-ish and the second is the
# path
+ # rubocop:disable Cop/ModuleWithInstanceVariables
def extract_ref(id)
pair = ['', '']
@@ -105,6 +105,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
def assign_ref_vars
# assign allowed options
allowed_options = ["filter_ref"]
@@ -133,6 +134,7 @@ module ExtractsPath
render_404
end
+ # rubocop:disable Cop/ModuleWithInstanceVariables
def tree
@tree ||= @repo.tree(@commit.id, @path)
end
@@ -146,6 +148,7 @@ module ExtractsPath
id
end
+ # rubocop:disable Cop/ModuleWithInstanceVariables
def ref_names
return [] unless @project