root/platform/tdiary/util/tdiary-for-ruby1.9/tdiary-2.3.1.patch
| Revision 23744, 7.7 kB (checked in by hsbt, 8 months ago) |
|---|
-
index.rb
=== index.rb ==================================================================
1 1 #!/usr/bin/env ruby 2 2 # 3 # index.rb $Revision: 1.35 $3 # index.rb 4 4 # 5 # Copyright (C) 2001-200 6, TADA Tadashi <sho@spc.gr.jp>5 # Copyright (C) 2001-2008, TADA Tadashi <sho@spc.gr.jp> 6 6 # You can redistribute it and/or modify it under GPL2. 7 7 # 8 BEGIN { $ defout.binmode }8 BEGIN { $stdout.binmode } 9 9 $KCODE = 'n' 10 10 11 11 begin … … 70 70 if @cgi.mobile_agent? then 71 71 body = conf.to_mobile( tdiary.eval_rhtml( 'i.' ) ) 72 72 head['charset'] = conf.mobile_encoding 73 head['Content-Length'] = body. size.to_s73 head['Content-Length'] = body.bytesize.to_s 74 74 else 75 75 require 'digest/md5' 76 76 body = tdiary.eval_rhtml … … 80 80 body = '' 81 81 else 82 82 head['charset'] = conf.encoding 83 head['Content-Length'] = body. size.to_s83 head['Content-Length'] = body.bytesize.to_s 84 84 end 85 85 head['Pragma'] = 'no-cache' 86 86 head['Cache-Control'] = 'no-cache' -
plugin/00default.rb
=== plugin/00default.rb ==================================================================
697 697 mail_header = (@conf['comment_mail.header'] || '').dup 698 698 mail_header << ":#{@conf.date_format}" unless /%[a-zA-Z%]/ =~ mail_header 699 699 mail_header = @date.strftime( mail_header ) 700 mail_header = comment_mail_mime( @conf.to_mail( mail_header ) ).join( "\n " ) if /[\x80-\xff]/ =~ mail_header700 mail_header = comment_mail_mime( @conf.to_mail( mail_header ) ).join( "\n " ) 701 701 702 702 rmail = '' 703 703 begin -
plugin/05referer.rb
=== plugin/05referer.rb ==================================================================
159 159 160 160 def referer_add_to_diary( diary, body ) 161 161 return unless body 162 body.each do |r|162 body.each_line do |r| 163 163 count, ref = r.chomp.split( / /, 2 ) 164 164 next unless ref 165 165 diary.add_referer( ref.chomp, count.to_i ) -
plugin/ja/05referer.rb
=== plugin/ja/05referer.rb ==================================================================
31 31 <p>→<a href="#{h @update}?referer=volatile" target="referer">既存設定はこちら</a></p> 32 32 <p><textarea name="only_volatile" cols="70" rows="10">#{h @conf.only_volatile2.join( "\n" )}</textarea></p> 33 33 <h3 class="subtitle">#{label_referer_table}</h3> 34 #{"<p>リンク元リストのURLを、特定の文字列に変換する対応表を指定できます。1件につき、URLと表示文字列を空白で区切って指定します。正規表現が使えるので、URL中に現れた「(〜)」は、置換文字列中で「\\ 1」のような「\数字」で利用できます。</p>" unless @conf.mobile_agent?}34 #{"<p>リンク元リストのURLを、特定の文字列に変換する対応表を指定できます。1件につき、URLと表示文字列を空白で区切って指定します。正規表現が使えるので、URL中に現れた「(〜)」は、置換文字列中で「\\\\1」のような「\\数字」で利用できます。</p>" unless @conf.mobile_agent?} 35 35 <p>→<a href="#{h @update}?referer=table" target="referer">既存設定はこちら</a></p> 36 36 <p><textarea name="referer_table" cols="70" rows="10">#{h @conf.referer_table2.collect{|a|a.join( " " )}.join( "\n" )}</textarea></p> 37 37 HTML -
tdiary/defaultio.rb
=== tdiary/defaultio.rb ==================================================================
13 13 header, body = data.split( /\r?\n\r?\n/, 2 ) 14 14 headers = {} 15 15 if header then 16 header.each do |l|16 header.each_line do |l| 17 17 l.chomp! 18 18 key, val = l.scan( /([^:]*):\s*(.*)/ )[0] 19 19 headers[key] = val ? val.chomp : nil -
tdiary/tdiary_style.rb
=== tdiary/tdiary_style.rb ==================================================================
22 22 if lines.size > 1 then 23 23 if /^<</ =~ lines[0] 24 24 @subtitle = lines.shift.chomp.sub( /^</, '' ) 25 elsif /^[ <]/u !~ lines[0]25 elsif /^[ <]/u !~ lines[0] 26 26 @subtitle = lines.shift.chomp 27 27 end 28 28 end … … 190 190 if /^</ =~ section.body then 191 191 r << %Q[#{section.body}] 192 192 elsif section.subtitle 193 r << %Q[<p>#{section.body.collect{|l|l.chomp.sub( /^[ ]/u, '')}.join( "</p>\n<p>" )}</p>\n]193 r << %Q[<p>#{section.body.collect{|l|l.chomp.sub( /^[ ]/u, '')}.join( "</p>\n<p>" )}</p>\n] 194 194 else 195 195 r << %Q[<p><%= subtitle_proc( Time::at( #{date.to_i} ), nil ) %>] 196 r << %Q[#{section.body.collect{|l|l.chomp.sub( /^[ ]/u, '' )}.join( "</p>\n<p>" )}</p>]196 r << %Q[#{section.body.collect{|l|l.chomp.sub( /^[ ]/u, '' )}.join( "</p>\n<p>" )}</p>] 197 197 end 198 198 r << %Q[<%= section_leave_proc( Time::at( #{date.to_i} ) ) %>\n] 199 199 r << %Q[</div>] … … 211 211 if /^</ =~ section.body then 212 212 r << section.body 213 213 elsif section.subtitle 214 r << %Q[<P>#{section.body.collect{|l|l.chomp.sub( /^[ ]/u, '' )}.join( "</P>\n<P>" )}</P>\n]214 r << %Q[<P>#{section.body.collect{|l|l.chomp.sub( /^[ ]/u, '' )}.join( "</P>\n<P>" )}</P>\n] 215 215 else 216 216 r << %Q[<P><%= subtitle_proc( Time::at( #{date.to_i} ), nil ) %>] 217 r << %Q[#{section.body.collect{|l|l.chomp.sub( /^[ ]/u, '' )}.join( "</P>\n<P>" )}</P>\n]217 r << %Q[#{section.body.collect{|l|l.chomp.sub( /^[ ]/u, '' )}.join( "</P>\n<P>" )}</P>\n] 218 218 end 219 219 r << %Q[<%= section_leave_proc( Time::at( #{date.to_i} ) ) %>\n] 220 220 end -
tdiary.rb
=== tdiary.rb ==================================================================
6 6 You can redistribute it and/or modify it under GPL2. 7 7 =end 8 8 9 TDIARY_VERSION = '2.3.1 '9 TDIARY_VERSION = '2.3.1.20081115' 10 10 11 11 $:.insert( 1, File::dirname( __FILE__ ) + '/misc/lib' ) 12 12 13 require 'compatible' 13 14 require 'cgi' 14 15 require 'uri' 15 16 begin … … 460 461 load 461 462 462 463 instance_variables.each do |v| 464 v = v.to_s 463 465 v.sub!( /@/, '' ) 464 466 instance_eval( <<-SRC 465 467 def #{v} … … 660 662 cgi_conf.untaint unless @secure 661 663 def_vars = "" 662 664 variables.each do |var| def_vars << "#{var} = nil\n" end 663 e val( def_vars )665 extend_vars = 'variables.each do |var| eval "@#{ var} = #{var} if #{var} != nil" end' 664 666 Safe::safe( @secure ? 4 : 1 ) do 665 eval( cgi_conf, binding, "(TDiary::Config#cgi_conf)", 1 )667 eval( def_vars + cgi_conf + extend_vars, binding, "(TDiary::Config#cgi_conf)", 1 ) 666 668 end 667 variables.each do |var| eval "@#{var} = #{var} if #{var} != nil" end668 669 rescue IOError, Errno::ENOENT 669 670 end 670 671 end … … 776 777 @subtitle_procs.taint 777 778 @section_leave_procs.taint 778 779 return Safe::safe( secure ? 4 : 1 ) do 780 src.force_encoding('UTF-8') 779 781 eval( src, binding, "(TDiary::Plugin#eval_src)", 1 ) 780 782 end 781 783 end -
update.rb
=== update.rb ==================================================================
1 1 #!/usr/bin/env ruby 2 2 # 3 # update.rb $Revision: 1.22 $3 # update.rb 4 4 # 5 # Copyright (C) 2001-200 3, TADA Tadashi <sho@spc.gr.jp>5 # Copyright (C) 2001-2008, TADA Tadashi <sho@spc.gr.jp> 6 6 # You can redistribute it and/or modify it under GPL2. 7 7 # 8 BEGIN { $ defout.binmode }8 BEGIN { $stdout.binmode } 9 9 $KCODE = 'n' 10 10 11 11 begin … … 55 55 'status' => '200 OK', 56 56 'type' => 'text/html', 57 57 'charset' => conf.mobile_encoding, 58 'Content-Length' => body. size.to_s,58 'Content-Length' => body.bytesize.to_s, 59 59 'Vary' => 'User-Agent' 60 60 ) 61 61 else … … 64 64 'status' => '200 OK', 65 65 'type' => 'text/html', 66 66 'charset' => conf.encoding, 67 'Content-Length' => body. size.to_s,67 'Content-Length' => body.bytesize.to_s, 68 68 'Vary' => 'User-Agent' 69 69 ) 70 70 end
Note: See TracBrowser
for help on using the browser.
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)