Ruby 1.8.7 compatible double slash gsub
This commit is contained in:
@@ -28,7 +28,7 @@ module Precious
|
|||||||
# Ensure path begins with a single leading slash
|
# Ensure path begins with a single leading slash
|
||||||
def clean_path(path)
|
def clean_path(path)
|
||||||
if path
|
if path
|
||||||
(path[0] != '/' ? path.insert(0, '/') : path).gsub('//','/')
|
(path[0] != '/' ? path.insert(0, '/') : path).gsub(/\/{2,}/,'/')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user