Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 32 lines (29 sloc) 0.835 kb
9f19d3f @mbleigh Initial import.
mbleigh authored
1 require 'fileutils'
2
3 ARTBOARDS = {
4 "01" => "twitter",
5 "02" => "facebook",
6 "03" => "linkedin",
7 "04" => "google",
8 "05" => "openid",
9 "06" => "yahoo",
10 "07" => "aol",
11 "08" => "myspace",
12 "09" => "github",
13 "10" => "basecamp",
14 "11" => "campfire",
15 "12" => "presently"
16 }
17
18 desc "Rename automatically exported files to their proper service names."
19 task :rename do
20 FileList["**/*"].each do |file|
21 ext = File.extname(file)
22 dir = File.dirname(file)
23
24 if file.match /.*-[0-9]{2}\..(?:png|jpg)/i
25 size, index = File.basename(file).split('.')[0].split('-')
26 `mv #{file} #{dir}/#{ARTBOARDS[index]}_#{size}#{ext}`
27 puts "+ Moved #{file} to #{dir}/#{ARTBOARDS[index]}_#{size}#{ext}"
28 elsif file.match /authbuttons-([0-9]{2})\.eps/i
29 `mv #{file} #{dir}/#{ARTBOARDS[$1]}.eps`
30 end
31 end
32 end
Something went wrong with that request. Please try again.