Skip to content

Commit

Permalink
removed unused variables: plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Aug 10, 2014
1 parent 9dab850 commit b194874
Show file tree
Hide file tree
Showing 19 changed files with 28 additions and 51 deletions.
2 changes: 1 addition & 1 deletion misc/plugin/amazon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def amazon_detail_html( item )
@conf['amazon.imgsize'] = size_orig

url = amazon_url( item )
html = <<-HTML
<<-HTML
<a class="amazon-detail" href="#{url}"><span class="amazon-detail">
<img class="amazon-detail left" src="#{h image[:src]}"
height="#{h image[:height]}" width="#{h image[:width]}"
Expand Down
2 changes: 0 additions & 2 deletions misc/plugin/calendar2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ def calendar2_make_anchor(ym, str)
end

def calender2_make_image(diary, date)
f_list = []

/[^_]image(?:_left|_right|_gps)?\s*\(?\s*([0-9]*)\s*\,?\s*'[^']*'/ =~ diary.to_s
if $1 == nil
return nil
Expand Down
1 change: 0 additions & 1 deletion misc/plugin/calendar3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def calendar3
end
year = date.year
month = date.month
day = date.day

result << %Q|<span class="calendar-prev-month"><a href="#{h @index}#{anchor "%04d%02d" % Calendar3.prev_month(year, month)}">&lt;&lt;</a></span>\n|
result << %Q|<span class="calendar-current-month"><a href="#{h @index}#{anchor "%04d%02d" % [year, month]}">#{"%04d/%02d" % [year, month]}</a>/</span>\n|
Expand Down
6 changes: 0 additions & 6 deletions misc/plugin/category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ def category_navi

def category_list_sections
info = Category::Info.new(@cgi, @years, @conf)
category = info.category
years = info.years
r = ''

raise ::TDiary::NotFound if @categorized.empty? and bot?
Expand Down Expand Up @@ -141,8 +139,6 @@ def category_list_sections

def category_list_sections_mobile
info = Category::Info.new(@cgi, @years, @conf)
category = info.category
years = info.years
r = ''

raise ::TDiary::NotFound if @categorized.empty? and bot?
Expand Down Expand Up @@ -496,7 +492,6 @@ def recreate(years)
ym = "#{y}#{m}"
cgi.params['date'] = [ym]
m = TDiaryMonth.new(cgi, '', @conf)
sections = {}
m.diaries.each do |ymd, diary|
next if !diary.visible?
initial_replace_sections(diary)
Expand Down Expand Up @@ -699,7 +694,6 @@ def category_icon_sample

if @mode == 'conf' || @mode == 'saveconf'
add_conf_proc( 'category', @category_conf_label, 'basic' ) do
cache = @category_cache
if @mode == 'saveconf'
if @cgi.valid?( 'category_initialize' )
@category_cache.recreate(@years)
Expand Down
2 changes: 1 addition & 1 deletion misc/plugin/counter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def kiriban
msg = @options["counter.kiriban_today_msg"] ? @options["counter.kiriban_today_msg"] : ""
ERB.new(msg.untaint).result(binding)
else
msg = @options["counter.kiriban_nomatch_msg"] ? @options["counter.kiriban_nomatch_msg"] : ""
@options["counter.kiriban_nomatch_msg"] ? @options["counter.kiriban_nomatch_msg"] : ""
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion misc/plugin/daily_theme.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def daily_theme_conf_proc
# initialize Theme list
@conf['daily_theme.list'] = "default" unless @conf['daily_theme.list']

result = <<-HTML
<<-HTML
<h3>#{@daily_theme_label}</h3>
<p>#{@daily_theme_label_desc}</p>
<p><textarea name="daily_theme.list" cols="70" rows="20">#{h( @conf['daily_theme.list'] )}</textarea></p>
Expand Down
2 changes: 1 addition & 1 deletion misc/plugin/disp_referrer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ def others_to_long_html( cat_key )
end
result << "</li>\n"
end
rescue Encoding::CompatibilityError => e
rescue Encoding::CompatibilityError
end
end
result << "</ul>\n"
Expand Down
2 changes: 1 addition & 1 deletion misc/plugin/edit_today.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def edit_today_link( date, title )
edit_today_init
caption = @conf['edit_today.caption']
unless @cgi.mobile_agent?
r = <<-HTML
<<-HTML
#{title}\n<span class="edit-today">
<a href="#{@update}?edit=true;#{date.strftime( 'year=%Y;month=%m;day=%d' )}" title="#{edit_today_edit_label( date )}" rel="nofollow">#{caption}</a>
</span>
Expand Down
2 changes: 1 addition & 1 deletion misc/plugin/en/edit_today.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def edit_today_edit_label( date )
end

def edit_today_conf_html
r = <<-HTML
<<-HTML
<h3 class="subtitle">Link String</h3>
<p>Specify string to link to edit page. If you have image file, you can specify icon on this link.</p>
<p><input name="edit_today_caption" size="70" value="#{h @conf['edit_today.caption']}"></p>
Expand Down
2 changes: 1 addition & 1 deletion misc/plugin/en/hide-mail-field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@hide_mail_field_label_conf = 'Hide Mail Field'

def hide_mail_field_conf_html
r = <<-HTML
<<-HTML
<h3>Description of TSUKKOMI</h3>
<p>Show messeges about hidden of E-mail field for your subscribers. This field is as same as in default spam filter preferences.<br>
<textarea name="comment_description" cols="60" rows="5">#{h comment_description}</textarea></p>
Expand Down
5 changes: 0 additions & 5 deletions misc/plugin/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,6 @@ def image_list( date )
img_type, img_w, img_h = image_info(File.join(@image_dir,img).untaint)
end
r << %Q[<td><img id="image-index-#{id}" class="image-img form" src="#{h @image_url}/#{h img}" alt="#{id}" width="#{h( (img_w && img_w > 160) ? 160 : (img_w ? img_w : 160) )}"></td>]
if @conf.secure then
img_info = ''
else
img_info = "#{File.size(File.join(@image_dir,img).untaint).to_s.reverse.gsub( /\d{3}/, '\0,' ).sub( /,$/, '' ).reverse} bytes"
end
img_info = ''
if img_w && img_h
img_info << %Q|<span class="image-width">#{img_w}</span> x <span class="image-height">#{img_h}</span>|
Expand Down
2 changes: 1 addition & 1 deletion misc/plugin/ja/edit_today.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def edit_today_edit_label( date )
end

def edit_today_conf_html
r = <<-HTML
<<-HTML
<h3 class="subtitle">リンク文字列</h3>
<p>編集ページへのリンクを示す文字列を指定します。画像が用意できれば、アイコンなども指定出来ます。</p>
<p><input name="edit_today_caption" size="70" value="#{h @conf['edit_today.caption']}"></p>
Expand Down
2 changes: 1 addition & 1 deletion misc/plugin/ja/hide-mail-field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@hide_mail_field_label_conf = 'メール欄隠し'

def hide_mail_field_conf_html
r = <<-HTML
<<-HTML
<h3>ツッコミの注意文</h3>
<p>ツッコミフォームの上に表示する注意文を設定します。メール欄が消えていることを読者にきちんと知らせましょう。この欄は標準spamフィルタの設定ページにあるものと同じものです。<br>
<textarea name="comment_description" cols="70" rows="5">#{h comment_description}</textarea><br>
Expand Down
2 changes: 1 addition & 1 deletion misc/plugin/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def li( text )
text.each_line do |line|
list << ("<li>" + line.chomp + "</li>")
end
result = list
list
end


Expand Down
5 changes: 2 additions & 3 deletions misc/plugin/makerss.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def makerss_header( uri )
copyright += " <#{@conf.author_mail}>" if @conf.author_mail and not @conf.author_mail.empty?
copyright += ", copyright of comments by respective authors"

xml = %Q[<?xml version="1.0" encoding="UTF-8"?>
%Q[<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="rss.css" type="text/css"?>
<rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="#{h @conf.html_lang}">
<channel rdf:about="#{h rdf_url}">
Expand Down Expand Up @@ -342,7 +342,6 @@ def makerss_body( uri, rdfsec )

@makerss_in_feed = true
subtitle = rdfsec.section.subtitle_to_html
sec_id = rdfsec.id[9,2].to_i
body_enter = body_enter_proc( date )
body = apply_plugin( rdfsec.section.body_to_html )
body_leave = body_leave_proc( date )
Expand Down Expand Up @@ -445,7 +444,7 @@ def makerss_footer
else
''
end
r = <<-HTML
<<-HTML
<div class="makerss"><label for="makerss_update">
<input type="checkbox" id="makerss_update" name="makerss_update" value="false"#{checked} tabindex="390">
#{@makerss_edit_label}
Expand Down
4 changes: 2 additions & 2 deletions misc/plugin/ping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def ping_conf_proc
@conf['ping.list'] = '' unless @conf['ping.list']
@conf['ping.timeout'] = '3' unless @conf['ping.timeout']

result = <<-HTML
<<-HTML
<h3>#{@ping_label_list}</h3>
<p>#{@ping_label_list_desc}</p>
<p><textarea name="ping.list" cols="70" rows="5">#{h( @conf['ping.list'] )}</textarea></p>
Expand All @@ -82,7 +82,7 @@ def ping_edit_proc
if @mode == 'preview' then
checked = @cgi.params['plugin_ping_send'][0] == 'true' ? ' checked' : ''
end
r = <<-HTML
<<-HTML
<div class="ping"><label for="plugin_ping_send">
<input type="checkbox" id="plugin_ping_send" name="plugin_ping_send" value="true"#{checked} tabindex="400">
#{@ping_label_send}
Expand Down
3 changes: 1 addition & 2 deletions misc/plugin/search-default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def shorten(str, len = 200)
end

def search_input_form( q )
r = <<-HTML
<<-HTML
<form method="GET" action="#{@conf.index}"><div>
検索キーワード:
<input name="q" value="#{h q}">
Expand All @@ -237,7 +237,6 @@ def search_result
end

query = CGI::unescape( @cgi.params['q'][0] )
start = CGI::unescape( @cgi.params['start'][0] || '0' ).to_i

begin
patterns = DefaultIOSearch::setup_patterns(query)
Expand Down
2 changes: 1 addition & 1 deletion misc/plugin/tlink.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def tlink_initialize
@tlink_path = dir + "/tlink.dat"

Dir.mkdir(dir, 0700) unless FileTest.exist?(dir)
db = PStore.new(@tlink_path).transaction do |db|
PStore.new(@tlink_path).transaction do |db|
if (db.root?('tlinkdata')) then
@tlink_dic = db["tlinkdata"]
else
Expand Down
31 changes: 12 additions & 19 deletions misc/plugin/xmlrpc/xmlrpc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@
@cgi.params['day'] = [postid[6..7]]
@cgi.params['body'] = [src]
@cgi.params['csrf_protection_key'] = [@conf.options['csrf_protection_key']]
tdiary = ::TDiary::TDiaryReplace::new( @cgi, nil, @conf )
body = tdiary.eval_rhtml
::TDiary::TDiaryReplace::new( @cgi, nil, @conf )
postid + "%02d" % index
rescue ::TDiary::ForceRedirect => redirect
rescue ::TDiary::ForceRedirect
postid + "%02d" % index
end
else
Expand Down Expand Up @@ -100,10 +99,9 @@
@cgi.params['day'] = [postid[6..7]]
@cgi.params['body'] = [src]
@cgi.params['csrf_protection_key'] = [@conf.options['csrf_protection_key']]
tdiary = ::TDiary::TDiaryReplace::new( @cgi, nil, @conf )
body = tdiary.eval_rhtml
::TDiary::TDiaryReplace::new( @cgi, nil, @conf )
true
rescue ::TDiary::ForceRedirect => redirect
rescue ::TDiary::ForceRedirect
true
rescue Exception
raise XMLRPC::FaultException.new(1,$!.to_s + "\n" + $!.backtrace.join("\n"))
Expand Down Expand Up @@ -136,10 +134,9 @@
@cgi.params['day'] = [postid[6..7]]
@cgi.params['body'] = [src]
@cgi.params['csrf_protection_key'] = [@conf.options['csrf_protection_key']]
tdiary = ::TDiary::TDiaryReplace::new( @cgi, nil, @conf )
body = tdiary.eval_rhtml
::TDiary::TDiaryReplace::new( @cgi, nil, @conf )
true
rescue ::TDiary::ForceRedirect => redirect
rescue ::TDiary::ForceRedirect
true
rescue Exception
raise XMLRPC::FaultException.new(1,$!.to_s + "\n" + $!.backtrace.join("\n"))
Expand Down Expand Up @@ -229,10 +226,9 @@
@cgi.params['day'] = [postid[6..7]]
@cgi.params['body'] = [src]
@cgi.params['csrf_protection_key'] = [@conf.options['csrf_protection_key']]
tdiary = ::TDiary::TDiaryReplace::new( @cgi, nil, @conf )
body = tdiary.eval_rhtml
::TDiary::TDiaryReplace::new( @cgi, nil, @conf )
postid + "%02d" % index
rescue ::TDiary::ForceRedirect => redirect
rescue ::TDiary::ForceRedirect
postid + "%02d" % index
end
end
Expand Down Expand Up @@ -271,10 +267,9 @@
@cgi.params['day'] = [postid[6..7]]
@cgi.params['body'] = [src]
@cgi.params['csrf_protection_key'] = [@conf.options['csrf_protection_key']]
tdiary = ::TDiary::TDiaryReplace::new( @cgi, nil, @conf )
body = tdiary.eval_rhtml
::TDiary::TDiaryReplace::new( @cgi, nil, @conf )
true
rescue ::TDiary::ForceRedirect => redirect
rescue ::TDiary::ForceRedirect
true
rescue Exception
raise XMLRPC::FaultException.new(1,$!.to_s + "\n" + $!.backtrace.join("\n"))
Expand Down Expand Up @@ -415,7 +410,6 @@
ym = "#{y}#{m}"
@cgi.params['date'] = [ym]
m = ::TDiary::TDiaryMonth.new(@cgi, '', @conf)
sections = {}
m.diaries.each do |ymd, diary|
next if !diary.visible?
diary.each_section do |s|
Expand Down Expand Up @@ -503,10 +497,9 @@
@cgi.params['day'] = [postid[6..7]]
@cgi.params['body'] = [src]
@cgi.params['csrf_protection_key'] = [@conf.options['csrf_protection_key']]
tdiary = ::TDiary::TDiaryReplace::new( @cgi, nil, @conf )
body = tdiary.eval_rhtml
::TDiary::TDiaryReplace::new( @cgi, nil, @conf )
true
rescue ::TDiary::ForceRedirect => redirect
rescue ::TDiary::ForceRedirect
true
rescue Exception
raise XMLRPC::FaultException.new(1,$!.to_s + "\n" + $!.backtrace.join("\n"))
Expand Down

0 comments on commit b194874

Please sign in to comment.