summaryrefslogtreecommitdiff
path: root/lib/extracts_path.rb
diff options
context:
space:
mode:
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