Skip to content

Instantly share code, notes, and snippets.

@andersr
Created October 13, 2013 16:49
Show Gist options
  • Save andersr/6964410 to your computer and use it in GitHub Desktop.
Save andersr/6964410 to your computer and use it in GitHub Desktop.
def normalize_path(path)
"#{"#{Dir.pwd}/" if relative_path?(path)}#{path}"
end
def relative_path?(path)
!absolute_path?(path)
end
def absolute_path?(path)
path.start_with?("/")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment