Skip to content

Instantly share code, notes, and snippets.

Created Dec 8, 2012
What would you like to do?
require 'taglib'
Dir.foreach("/home/music/") do |filename|
# Load a file (filename) do |fileref|
tag = fileref.tag
File.rename ( "/home/music/#{filename}","/home/music/#{tag.title}-#{tag.artist}.mp3")
end # File is automatically closed at block end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment