public
anonymous / gist:4237869
Last active

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/ruby
require 'taglib'
 
Dir.foreach("/home/music/") do |filename|
# Load a file
TagLib::FileRef.open (filename) do |fileref|
tag = fileref.tag
File.rename ( "/home/music/#{filename}","/home/music/#{tag.title}-#{tag.artist}.mp3")
end
end # File is automatically closed at block end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.