Skip to content

Instantly share code, notes, and snippets.

@ryanburnette
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanburnette/b43d983dbeda26ab24e0 to your computer and use it in GitHub Desktop.
Save ryanburnette/b43d983dbeda26ab24e0 to your computer and use it in GitHub Desktop.
def suffix_filename(filename, suffix)
extension = File.extname(filename)
filename.reverse.sub(extension.reverse, ("#{suffix}#{extension}").reverse).reverse
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment