replace sed to ruby in post-hook