mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-02 19:05:32 -04:00
Handle the rare case when renamed string is ".."
This commit is contained in:
parent
45cdfd5306
commit
e53641add1
@ -129,15 +129,19 @@ module Rename
|
|||||||
end
|
end
|
||||||
|
|
||||||
def render(hash : VHash)
|
def render(hash : VHash)
|
||||||
@ary.map do |e|
|
str = @ary.map do |e|
|
||||||
if e.is_a? String
|
if e.is_a? String
|
||||||
e
|
e
|
||||||
else
|
else
|
||||||
e.render hash
|
e.render hash
|
||||||
end
|
end
|
||||||
end.join
|
end.join.strip
|
||||||
.strip
|
post_process str
|
||||||
.gsub("/", "_")
|
end
|
||||||
|
|
||||||
|
private def post_process(str)
|
||||||
|
return "_" if str == ".."
|
||||||
|
str.gsub "/", "_"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user