Skip to content

Instantly share code, notes, and snippets.

@itochan
Created June 20, 2011 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itochan/1036885 to your computer and use it in GitHub Desktop.
Save itochan/1036885 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# coding: utf-8
require "benchmark"
case ARGV[0].to_i
# 既存の(ruby 1.9.2p180)cgi
when 0 then require "cgi/util"
# このパッチを適用したcgi
when 1 then require "./ruby/lib/cgi/util"
end
str = "テストtest >< 2×2=4 2÷2=1"
puts Benchmark::CAPTION
puts Benchmark.measure {
10000.times do
$unescapestr = CGI.unescapeHTML(str);
end
}
puts $unescapestr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment