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.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb
index b2c8d46ede1..3432c0a7850 100644
--- a/lib/extracts_path.rb
+++ b/lib/extracts_path.rb
@@ -40,7 +40,7 @@ module ExtractsPath
# Returns an Array where the first value is the tree-ish and the second is the
# path
def extract_ref(id)
- pair = ['', '']
+ pair = ["", ""]
return pair unless @project # rubocop:disable Gitlab/ModuleWithInstanceVariables
@@ -52,8 +52,8 @@ module ExtractsPath
# branches and tags
# Append a trailing slash if we only get a ref and no file path
- unless id.ends_with?('/')
- id = [id, '/'].join
+ unless id.ends_with?("/")
+ id = [id, "/"].join
end
valid_refs = ref_names.select { |v| id.start_with?("#{v}/") }
@@ -72,7 +72,7 @@ module ExtractsPath
end
# Remove ending slashes from path
- pair[1].gsub!(%r{^/|/$}, '')
+ pair[1].gsub!(%r{^/|/$}, "")
pair
end
@@ -84,7 +84,7 @@ module ExtractsPath
# match, so it is possible to create a branch which has an unroutable Atom
# feed.
def extract_ref_without_atom(id)
- id_without_atom = id.sub(/\.atom$/, '')
+ id_without_atom = id.sub(/\.atom$/, "")
valid_refs = ref_names.select { |v| "#{id_without_atom}/".start_with?("#{v}/") }
valid_refs.max_by(&:length)
@@ -116,7 +116,7 @@ module ExtractsPath
@commit = @repo.commit(@ref)
- if @path.empty? && !@commit && @id.ends_with?('.atom')
+ if @path.empty? && !@commit && @id.ends_with?(".atom")
@id = @ref = extract_ref_without_atom(@id)
@commit = @repo.commit(@ref)