Created
October 5, 2014 23:22
-
-
Save milesmatthias/fecafc937b88cf9e99b1 to your computer and use it in GitHub Desktop.
Revisions
-
milesmatthias created this gist
Oct 5, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ #!/usr/bin/env ruby require 'pry' require 'fileutils' EPISODES = [ nil, nil, nil, "My Happy Place.mov", "My ABC's.mov", "My Cookie Pants.mov", "My New Role.mov", "My Lawyer's in Love.mov", nil, nil, nil, "Their Story II.mov", "My Full Moon.mov", "My Soul on Fire, Part 1.mov", "My Soul on Fire, Part 2.mov", nil, "My Chief Concern.mov", "My Finale.mov" ] EPISODES.each_with_index do |ep, i| next if ep.nil? prefix = i + 1 if prefix < 10 prefix = "0" + prefix.to_s end new_name = prefix.to_s + " " + ep puts "moving #{ ep } to #{ new_name }" FileUtils.mv(ep, new_name) end exit