Last active
June 10, 2016 16:22
-
-
Save nycdavid/423312c79f7530401ccd to your computer and use it in GitHub Desktop.
Revisions
-
David ko revised this gist
Mar 16, 2016 . 1 changed file with 6 additions and 2 deletions.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 @@ -13,8 +13,12 @@ def move_bins source = name split_name = name.split("/").last.split("-") bin = Bin.new(split_name[0], split_name[1], split_name[2]) dest_path = "#{@project_path}#{bin.type}/#{bin.genre}/" dest = "#{dest_path}#{bin.filename}" begin unless Dir.exist? dest_path FileUtils.mkdir_p dest_path end FileUtils.mv source, dest puts "Moving to #{dest}" rescue @@ -23,4 +27,4 @@ def move_bins end end end end -
Jingle Media revised this gist
Dec 9, 2015 . 1 changed file with 26 additions and 1 deletion.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 @@ -1 +1,26 @@ require "fileutils" class AvidMover Bin = Struct.new(:type, :genre, :filename) def initialize(project_path) @project_path = project_path end def move_bins @bin_names = Dir.glob("#{@project_path}*.avb") @bin_names.each do |name| source = name split_name = name.split("/").last.split("-") bin = Bin.new(split_name[0], split_name[1], split_name[2]) dest = "#{@project_path}#{bin.type}/#{bin.genre}/#{bin.filename}" begin FileUtils.mv source, dest puts "Moving to #{dest}" rescue puts "Can't move to #{dest}" next end end end end -
David Ko created this gist
Dec 9, 2015 .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 @@ #