end
archiver.each_entry do |ent|
case ent
- when /\.pmd\z/
+ when /\.pm[dx]\z/
puts [ code, ent ].join(' ')
pmds = Pmd.select { |rec| rec.arc == code && rec.path == ent }
pmds.count != 0 || Pmd.create(:arc => code, :path => ent)
end
end
end
-
- def create_pmx_entries(path)
- archiver = Archivers.load(path, extname)
- unless archiver
- puts "archiver not found: #{path}"
- return
- end
- archiver.each_entry do |ent|
- case ent
- when /\.pmx\z/
- puts [ code, ent ].join(' ')
- pmds = Pmd.select { |rec| rec.arc == code && rec.path == ent }
- pmds.count != 0 || Pmd.create(:arc => code, :path => ent)
- end
- end
- end
end
+++ /dev/null
-#!ruby
-# encoding: utf-8
-$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
-$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../app/models')
-require 'connection'
-require 'site'
-require 'arc'
-require 'pmd'
-require 'vmd'
-require 'x'
-require 'thumb'
-require 'bowl'
-
-Dir.glob("/Volumes/uploader/arc/mmd3dcu/MMD*.*") do |ent|
- basename = File.basename(ent)
- md = /\AMMD(\d+)/.match(basename)
- number = md[1].to_i
- code = "cu%04d" % number
- arc = Arc.find(code)
- next unless arc
- arc.create_pmx_entries(ent)
-end
+++ /dev/null
-#!ruby
-# encoding: utf-8
-$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
-$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../app/models')
-require 'connection'
-require 'site'
-require 'arc'
-require 'pmd'
-require 'vmd'
-require 'x'
-require 'thumb'
-require 'bowl'
-
-Dir.glob("/Volumes/uploader/arc/mmdbowl/dl*.*") do |ent|
- basename = File.basename(ent)
- md = /\Adl(\d+)/.match(basename)
- number = md[1].to_i
- code = "bo%04d" % number
- arc = Arc.find(code)
- next unless arc
- arc.create_pmx_entries(ent)
-end