Ruby 1.8.7 compatible double slash gsub

This commit is contained in:
Dustin DeYoung
2013-05-26 16:14:56 -04:00
parent f63180d8d8
commit e2c0dcc0da
+1 -1
View File
@@ -28,7 +28,7 @@ module Precious
# Ensure path begins with a single leading slash
def clean_path(path)
if path
(path[0] != '/' ? path.insert(0, '/') : path).gsub('//','/')
(path[0] != '/' ? path.insert(0, '/') : path).gsub(/\/{2,}/,'/')
end
end