2 # vim: fileencoding=utf-8
3 $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
8 location_code = ARGV.shift || 'mmd'
9 location = Location.find_by_code(location_code)
11 puts "location not found."
18 name, summary, size, date, mime, origname, with_key, with_password = line.chomp.split(/\t/)
19 when 'mmdfile', 'mmdacc1', 'mmdacc2'
20 name, summary, size, date, origname = line.chomp.split(/\t/)
22 md = /\.(.+)\z/.match(name)
24 code = File.basename(name, '.' + extname)
29 code = 'file%04d' % code.to_i
31 code = 'mini%04d' % code.to_i
35 arc = Arc.find_by_code(code)
37 puts "found code: #{code}"
40 puts "Arc.create code: #{code}"
41 arc = Arc.create(:code => code, :extname => extname, :location => location, :summary => summary, :origname => origname)