Skip to content

Instantly share code, notes, and snippets.

@ahawkins
Created August 8, 2010 09:32
Show Gist options
  • Save ahawkins/513825 to your computer and use it in GitHub Desktop.
Save ahawkins/513825 to your computer and use it in GitHub Desktop.
artist_name = lambda {|release_name| artist = release_name.split('-').first; artist.match(/(.+)_$/) ? $~[1] : artist }
releases.each do |release|
path = "#{track_path}/#{artist_name.call(release)}"
FileUtils.mkdir(path) unless File.directory?(path)
FileUtils.mv(release, "#{path}/#{File.basename(release)}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment