#!/usr/bin/env ruby # -*- coding: utf-8 -*- require'sqlite3' require'cgi' cgi = CGI.new db = SQLite3::Database.new("test.sqlite3") model = cgi["model"].read #モデル本体 modelname = cgi["model"].original_filename path = "assets/#{modelname}" # 単一のモデルを参照することになる? # testdata_init db.execute("drop table if exists modeltest_path") db.execute("create table if not exists modeltest_path(path)",) #____ 10000.times{db.execute("insert into modeltest_path values(?)",path)} open(path,"w"){|out| out.write model} puts %( <!DOCTYPE html> <html> <head> <meta charset=utf-8> <body> <p>テストデータの作成に成功しました。</p> <a href="index.html">back</a> </body> </html> )