[bin] Add script for moving crosswords

pull/28/head
Alpha Chen 10 years ago
parent 8aabc2ce43
commit a1f3a335d8

@ -0,0 +1,21 @@
#!/usr/bin/env ruby
require 'fileutils'
Dir[File.expand_path('~/Downloads/*.puz')].each do |puz|
crossword = File.basename(puz, '.puz')
dir = case crossword
when /av\d{6}/
'AV'
when /\d{3}[a-zA-Z]+/
'BEQ'
when /mgwcc\d{3}/
'MGWCC'
when /[A-Z][a-z]{2}\d{4}/
'NYT'
else
'etc'
end
dir = File.expand_path("~/Dropbox/Shared/Crosswords/#{dir}")
FileUtils.mv puz, to, verbose: true
end
Loading…
Cancel
Save