Mercurial > hgrepos > hgweb.cgi > skipweb
changeset 2174:483100968342
cgiをcに修正
author | SUZUKI Takehisa <c110128@e.koeki-u.ac.jp> |
---|---|
date | Mon, 13 Jan 2014 17:18:07 +0900 |
parents | 44a4dd946a73 |
children | 621f9299312a |
files | coop/entry.rb |
diffstat | 1 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/coop/entry.rb Mon Jan 13 17:13:01 2014 +0900 +++ b/coop/entry.rb Mon Jan 13 17:18:07 2014 +0900 @@ -14,10 +14,10 @@ m.hexdigest end -cgi = CGI.new('html4Tr') -me = File.basename(cgi.script_name) +c = CGI.new('html4Tr') +me = File.basename(c.script_name) -cookie = cgi.cookies['id'] +cookie = c.cookies['id'] if !cookie.empty? if /^[a-z0-f]{32}$/i =~ cookie.first @@ -54,20 +54,20 @@ end -cgi.out({'cookie' => cookie}) do - cgi.html({'PRETTY' => ' '}) do - cgi.head do - cgi.title {'サンプル'} - end + cgi.body do +c.out({'cookie' => cookie}) do + c.html({'PRETTY' => ' '}) do + c.head do + c.title {'サンプル'} + end + c.body do srand(56384679263254687) 10000.times {rand(1000000)} idlist = (1..100).collect{rand(10000000)} if idlist.index(ARGV[0].to_i) - cgi.p{'おめでとう'} + cgi.p{ - cgi.code {cookie} + c.p{'おめでとう'} + c.p{ + c.code {cookie} } else - cgi.p{'ごめんなさい'} + c.p{'ごめんなさい'} end end end