Skip to content

Commit

Permalink
Merge 2f617c2 into 552226d
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Jun 17, 2014
2 parents 552226d + 2f617c2 commit e03f0e1
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion plugin/00default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def nyear_link( date, title )
d = date.strftime( '%d' )
years = @years.find_all {|year, months| months.include? m}
if years.length >= 2 then
%Q|#{title} <span class="nyear">[<a href="#{h @conf.index}#{anchor m + d}" title="#{h(nyear_diary_title(date, years))}">#{nyear_diary_label date, years}</a>]</span>|
%Q|#{title} <span class="nyear">[<a href="#{h @conf.index}#{anchor m + d}" title="#{h(nyear_diary_title)}">#{nyear_diary_label}</a>]</span>|
else
title
end
Expand Down
6 changes: 3 additions & 3 deletions plugin/en/00default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def title_tag
r << '(Preferences Changed)'
when 'nyear'
years = @diaries.keys.map {|ymd| ymd.sub(/^\d{4}/, "")}
r << "(#{years[0].sub( /^(\d\d)/, '\1-')}[#{nyear_diary_label @date, years}])" if @date
r << "(#{years[0].sub( /^(\d\d)/, '\1-')}[#{nyear_diary_label}])" if @date
end
r << '</title>'
end
Expand Down Expand Up @@ -89,8 +89,8 @@ def submit_label
end
def preview_label; 'Preview'; end

def nyear_diary_label(date, years); "my old days"; end
def nyear_diary_title(date, years); "same days in past"; end
def nyear_diary_label; "my old days"; end
def nyear_diary_title; "same days in past"; end


#
Expand Down
3 changes: 0 additions & 3 deletions plugin/en/05referer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ def label_no_referer; "Today's Links Excluding List"; end
def label_only_volatile; "Volatile Links List"; end
def label_referer_table; "Today's Links Conversion Rule"; end

def nyear_diary_label(date, years); "my old days"; end
def nyear_diary_title(date, years); "same days in past"; end

add_conf_proc( 'referer', "Today's Link", 'referer' ) do
saveconf_referer

Expand Down
6 changes: 3 additions & 3 deletions plugin/ja/00default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def title_tag
r << '(設定完了)'
when 'nyear'
years = @diaries.keys.map {|ymd| ymd.sub(/^\d{4}/, "")}
r << "(#{h @cgi.params['date'][0].sub( /^(\d\d)/, '\1-')}[#{nyear_diary_label @date, years}])" if @date
r << "(#{h @cgi.params['date'][0].sub( /^(\d\d)/, '\1-')}[#{nyear_diary_label}])" if @date
end
r << '</title>'
end
Expand Down Expand Up @@ -124,8 +124,8 @@ def submit_label
end
def preview_label; 'プレビュー'; end

def nyear_diary_label(date, years); "長年日記"; end
def nyear_diary_title(date, years); "長年日記"; end
def nyear_diary_label; "長年日記"; end
def nyear_diary_title; "長年日記"; end

#
# labels (for mobile)
Expand Down
2 changes: 1 addition & 1 deletion tdiary/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def erb_src(prefix)

begin
r = ERB.new(rhtml.untaint).result(binding)
rescue ::Encoding::CompatibilityError => e
rescue ::Encoding::CompatibilityError
# migration error on ruby 1.9 only 1st time, reload.
raise ForceRedirect.new(base_url)
end
Expand Down
2 changes: 1 addition & 1 deletion tdiary/compatible.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PStore
def transaction(*args, &block)
begin
compatible_transaction_original(*args, &block)
rescue PStoreRuby18Exception => e
rescue PStoreRuby18Exception
# first loaded the pstore file (it's created by Ruby-1.8)
# force convert ASCII_8BIT pstore data to UTF_8
file = open_and_lock_file(@filename, false)
Expand Down
2 changes: 1 addition & 1 deletion tdiary/core_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def safe( level = 4 )
Proc.new {
begin
$SAFE = level
rescue ArgumentError => e
rescue ArgumentError
# $SAFE=4 was removed from Ruby 2.1.0.
ensure
result = yield
Expand Down
2 changes: 1 addition & 1 deletion tdiary/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def each_conf_key( genre )

def conf_proc( key )
r = ''
label, block = @conf_procs[key]
_, block = @conf_procs[key]
r = block.call if block
r
end
Expand Down
2 changes: 1 addition & 1 deletion tdiary/referer_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def add_referer( ref, count = 1 )
end
begin
uref = CGI::unescape( ref )
rescue ::Encoding::CompatibilityError => e
rescue ::Encoding::CompatibilityError
return
end
if pair = @referers[uref] then
Expand Down
1 change: 0 additions & 1 deletion tdiary/style/tdiary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def to_src

def body_to_html
html = ""
tag = false
@body.lines.each do |p|
if p[0] == ?< then
html = @body.dup
Expand Down
3 changes: 2 additions & 1 deletion tdiary/style/wiki.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# You can distribute this under GPL.
#
require 'hikidoc'
require 'uri'

module TDiary
module Style
Expand Down Expand Up @@ -102,7 +103,7 @@ def to_html( string )
if /^(\d{4}|\d{6}|\d{8}|\d{8}-\d+)[^\d]*?#?([pct]\d+)?$/ =~ u then
%Q[<%=my '#{$1}#{$2}', '#{escape_quote k}' %>]
elsif /:/ =~ u
scheme, path = u.split( /:/, 2 )
scheme = URI( u ).scheme rescue nil # URI::InvalidURIError
if /\A(?:http|https|ftp|mailto)\z/ =~ scheme
u.sub!( /^\w+:/, '' ) if %r|://| !~ u and /^mailto:/ !~ u
%Q[<a href="#{u}">#{k}</a>]
Expand Down

0 comments on commit e03f0e1

Please sign in to comment.