summaryrefslogtreecommitdiff
path: root/lib/extracts_path.rb
diff options
context:
space:
mode:
authorSimon Knox <psimyn@gmail.com>2018-02-07 20:05:38 +1100
committerSimon Knox <psimyn@gmail.com>2018-02-07 20:05:38 +1100
commit4e91d397833eb10e9eb64a48387c441be2922dfb (patch)
tree079cbe95e6b0ac773987dd2ccedb98b1ded9681b /lib/extracts_path.rb
parentb68e473e7bb2b64e1a36c54f9ced10ffe5a96763 (diff)
parent4457cf9d178dc9912fd9c16427ad81b389179d00 (diff)
downloadgitlab-ce-snake-case.tar.gz
Merge branch 'master' into snake-casesnake-case
Diffstat (limited to 'lib/extracts_path.rb')
-rw-r--r--lib/extracts_path.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb
index d8aca3304c5..a9b04c183ad 100644
--- a/lib/extracts_path.rb
+++ b/lib/extracts_path.rb
@@ -56,7 +56,7 @@ module ExtractsPath
if valid_refs.length == 0
# No exact ref match, so just try our best
- pair = id.match(/([^\/]+)(.*)/).captures
+ pair = id.match(%r{([^/]+)(.*)}).captures
else
# There is a distinct possibility that multiple refs prefix the ID.
# Use the longest match to maximize the chance that we have the
@@ -68,7 +68,7 @@ module ExtractsPath
end
# Remove ending slashes from path
- pair[1].gsub!(/^\/|\/$/, '')
+ pair[1].gsub!(%r{^/|/$}, '')
pair
end