Changeset 2526 for lang/ruby/ssb
- Timestamp:
- 12/06/07 03:35:55 (13 months ago)
- Location:
- lang/ruby/ssb/trunk
- Files:
-
- 4 modified
-
libs/ssb.rb (modified) (4 diffs)
-
libs/ssb/emoji.rb (modified) (2 diffs)
-
libs/ssb/request.rb (modified) (2 diffs)
-
templates/ssb.rhtml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/ssb/trunk/libs/ssb.rb
r2455 r2526 93 93 94 94 def run(cgi_request, cgi_response) 95 @time_stamp.stamp(:request_start) 96 95 97 # リクエストの生成 96 98 @ssb_uri = 'http://' + cgi_request.host + File.basename(cgi_request.script_name) + '/' … … 99 101 # ログ 100 102 log(@request.method, @request.uri, @request.term.get_useragent(true), @request.term[:uid]) 101 @time_stamp.stamp(:request_start)102 103 103 104 # リクエスト … … 118 119 end 119 120 120 # 変換処理終了121 @time_stamp.stamp(:proc_finish)122 123 121 output_template(@request.uri, 124 122 response, … … 150 148 # qrcode 151 149 qrcode = SSB::Qrcode.make_qrcode(request_uri.to_s) 150 151 # 変換処理終了 152 @time_stamp.stamp(:proc_finish) 152 153 153 154 begin -
lang/ruby/ssb/trunk/libs/ssb/emoji.rb
r2414 r2526 15 15 RE_IMODE_SJIS = Regexp.new("((#{SJIS_IMODE_PICTOGRAM})|(#{SJIS_ONE_BYTE}|#{SJIS_TWO_BYTES}))") 16 16 17 @@ez_uni2_table = nil 18 @@docomo_uni2_table = nil 19 17 20 # TODO: speed up! 18 21 def self.ez_uni2number(uni) 19 table = YAML.load_file(File.join(SSB::CONFIG[:dat_dir], 'kddi-table.yaml')) 20 table.each {|x| 22 if @@ez_uni2_table.nil? 23 @@ez_uni2_table = YAML.load_file(File.join(SSB::CONFIG[:dat_dir], 'kddi-table.yaml')) 24 end 25 @@ez_uni2_table.each {|x| 21 26 if x['unicode'] == uni 22 27 return x['number'] … … 27 32 28 33 def self.docomo_uni2sjis(uni) 29 table = YAML.load_file(File.join(SSB::CONFIG[:dat_dir], 'docomo-table.yaml')) 30 table.each {|x| 34 if @@docomo_uni2_table.nil? 35 @@docomo_uni2_table = YAML.load_file(File.join(SSB::CONFIG[:dat_dir], 'docomo-table.yaml')) 36 end 37 @@docomo_uni2_table.each {|x| 31 38 if x['unicode'] == uni 32 39 return x['sjis'] -
lang/ruby/ssb/trunk/libs/ssb/request.rb
r2404 r2526 8 8 require 'cgi' 9 9 require 'net/http' 10 require 'nkf' 10 11 require 'ssb/misc' 11 12 Net::HTTP::version_1_2 … … 85 86 uri_base = value.dup.untaint 86 87 else # passing parameters 87 uri_params[ key.dup.untaint] = CGI.escape(value.dup.untaint)88 uri_params[NKF::nkf('-s', key)] = CGI.escape(NKF::nkf('-s', value)) 88 89 end 89 90 end -
lang/ruby/ssb/trunk/templates/ssb.rhtml
r2455 r2526 61 61 end %> 62 62 <td class="<%= time_class %>"><%= SSB::Misc.numeric(request_time) %></td> 63 <td class="time_unit">ms</td> 64 </tr> 65 <tr> 66 <td class="time_label">変換処理時間</td> 67 <td class="time"><%= SSB::Misc.numeric(proc_time) %></td> 68 <td class="time_unit">ms</td> 69 </tr> 70 <tr> 71 <td class="time_label">合計</td> 72 <td class="time"><%= SSB::Misc.numeric(total_time) %></td> 63 73 <td class="time_unit">ms</td> 64 74 </tr>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)