You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
497 B
22 lines
497 B
10 years ago
|
#!/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
|