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."
16 name, summary, size, date, origname = line.chomp.split(/\t/)
17 md = /\.(.+)\z/.match(name)
19 code = File.basename(name, '.' + extname)
24 code = 'file%04d' % code.to_i
26 code = 'mini%04d' % code.to_i
30 arc = Arc.find_by_code(code)
32 puts "found code: #{code}"
35 puts "Arc.create code: #{code}"
36 arc = Arc.create(:code => code, :extname => extname, :location => location, :summary => summary, :origname => origname)