Skip to content
Browse files

change syntax for class method call.

  • Loading branch information...
1 parent 468f0fb commit e4d25b859d30b0279518622b60ca7152142aa047 @hsbt hsbt committed Jan 5, 2013
Showing with 60 additions and 60 deletions.
  1. +56 −56 spec/core/style/wiki_style_spec.rb
  2. +4 −4 tdiary/style/wiki_style.rb
View
112 spec/core/style/wiki_style_spec.rb
@@ -6,7 +6,7 @@
describe TDiary::WikiDiary do
before do
- @diary = TDiary::WikiDiary.new(Time::at( 1041346800 ), "TITLE", "")
+ @diary = TDiary::WikiDiary.new(Time.at( 1041346800 ), "TITLE", "")
end
describe '#append' do
@@ -26,12 +26,12 @@
before do
@html = <<-'EOF'
<div class="section">
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<h3><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></h3>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<h3><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></h3>
<p>honbun</p>
<h4>subTitleH4</h4>
<p>honbun</p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
</div>
EOF
end
@@ -41,12 +41,12 @@
context 'CHTML' do
before do
@html = <<-'EOF'
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<h3><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></h3>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<h3><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></h3>
<p>honbun</p>
<h4>subTitleH4</h4>
<p>honbun</p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
EOF
end
it { @diary.to_html({}, :CHTML).should eq @html }
@@ -77,16 +77,16 @@
replace
EOF
- @diary.replace(Time::at( 1041346800 ), "TITLE", replaced)
+ @diary.replace(Time.at( 1041346800 ), "TITLE", replaced)
@html = <<-'EOF'
<div class="section">
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<h3><%= subtitle_proc( Time::at( 1041346800 ), "replaceTitle" ) %></h3>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<h3><%= subtitle_proc( Time.at( 1041346800 ), "replaceTitle" ) %></h3>
<p>replace</p>
<h4>replaceTitleH4</h4>
<p>replace</p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
</div>
EOF
end
@@ -109,18 +109,18 @@
@html = <<-'EOF'
<div class="section">
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<h3><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></h3>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<h3><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></h3>
<p>honbun</p>
<h4>subTitleH4</h4>
<p>honbun</p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
</div>
<div class="section">
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<h3><%= subtitle_proc( Time::at( 1041346800 ), "subTitle2" ) %></h3>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<h3><%= subtitle_proc( Time.at( 1041346800 ), "subTitle2" ) %></h3>
<p>honbun</p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
</div>
EOF
end
@@ -143,10 +143,10 @@
@html = <<-'EOF'
<div class="section">
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<h3><%= subtitle_proc( Time::at( 1041346800 ), "subTitle2" ) %></h3>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<h3><%= subtitle_proc( Time.at( 1041346800 ), "subTitle2" ) %></h3>
<p>honbun</p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
</div>
EOF
end
@@ -170,11 +170,11 @@
before do
@html = <<-'EOF'
<div class="section">
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<p><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></p>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<p><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></p>
<p>honbun</p>
<p>honbun</p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
</div>
EOF
end
@@ -184,11 +184,11 @@
context 'CHTML' do
before do
@html = <<-'EOF'
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<p><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></p>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<p><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></p>
<p>honbun</p>
<p>honbun</p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
EOF
end
it { @diary.to_html({}, :CHTML).should eq @html }
@@ -216,17 +216,17 @@
before do
@html = <<-'EOF'
<div class="section">
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<p><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></p>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<p><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></p>
<p>honbun</p>
<p>honbun</p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
</div>
<div class="section">
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<h3><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></h3>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<h3><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></h3>
<p>honbun</p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
</div>
EOF
end
@@ -236,15 +236,15 @@
context 'CHTML' do
before do
@html = <<-'EOF'
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<p><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></p>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<p><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></p>
<p>honbun</p>
<p>honbun</p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<h3><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></h3>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<h3><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></h3>
<p>honbun</p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
EOF
end
it { @diary.to_html({}, :CHTML).should eq @html }
@@ -274,8 +274,8 @@
before do
@html = <<-'EOF'
<div class="section">
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<h3><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></h3>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<h3><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></h3>
<p><%=plugin
%>
<%=plugin
@@ -289,7 +289,7 @@
<p><%=ho
ge
%></p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
</div>
EOF
end
@@ -299,8 +299,8 @@
context 'CHTML' do
before do
@html = <<-'EOF'
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<h3><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></h3>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<h3><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></h3>
<p><%=plugin
%>
<%=plugin
@@ -314,7 +314,7 @@
<p><%=ho
ge
%></p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
EOF
end
it { @diary.to_html({}, :CHTML).should eq @html }
@@ -350,8 +350,8 @@
before do
@html = <<-'EOF'
<div class="section">
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<h3><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></h3>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<h3><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></h3>
<p><%=kw 'aaa', 'aaa'%></p>
<p><a href="bbb">aaa</a></p>
<p><a href="ccc">aaa'bbb</a></p>
@@ -361,7 +361,7 @@
<p><%=kw 'bbb:ccc', 'aaa\'bbb'%></p>
<p><a href="http://ja.wikipedia.org/wiki/%E9%AF%96"></a></p>
<p><a href="http://ja.wikipedia.org/wiki/%E9%AF%96">http://ja.wikipedia.org/wiki/%E9%AF%96</a></p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
</div>
EOF
end
@@ -371,8 +371,8 @@
context 'CHTML' do
before do
@html = <<-'EOF'
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<h3><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></h3>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<h3><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></h3>
<p><%=kw 'aaa', 'aaa'%></p>
<p><a href="bbb">aaa</a></p>
<p><a href="ccc">aaa'bbb</a></p>
@@ -382,7 +382,7 @@
<p><%=kw 'bbb:ccc', 'aaa\'bbb'%></p>
<p><a href="http://ja.wikipedia.org/wiki/%E9%AF%96"></a></p>
<p><a href="http://ja.wikipedia.org/wiki/%E9%AF%96">http://ja.wikipedia.org/wiki/%E9%AF%96</a></p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
EOF
end
it { @diary.to_html({}, :CHTML).should eq @html }
@@ -407,11 +407,11 @@
before do
@html = <<-'EOF'
<div class="section">
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<h3><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></h3>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<h3><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></h3>
<p>body</p>
<p>appended body</p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
</div>
EOF
end
@@ -421,11 +421,11 @@
context 'CHTML' do
before do
@html = <<-'EOF'
-<%=section_enter_proc( Time::at( 1041346800 ) )%>
-<h3><%= subtitle_proc( Time::at( 1041346800 ), "subTitle" ) %></h3>
+<%=section_enter_proc( Time.at( 1041346800 ) )%>
+<h3><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></h3>
<p>body</p>
<p>appended body</p>
-<%=section_leave_proc( Time::at( 1041346800 ) )%>
+<%=section_leave_proc( Time.at( 1041346800 ) )%>
EOF
end
it { @diary.to_html({}, :CHTML).should eq @html }
View
8 tdiary/style/wiki_style.rb
@@ -64,10 +64,10 @@ def do_html4( date, idx, opt )
r = @html.lstrip
r.sub!( %r!<h3>(.+?)</h3>!m ) do
subtitle = true
- "<h3><%= subtitle_proc( Time::at( #{date.to_i} ), #{$1.dump.gsub( /%/, '\\\\045' )} ) %></h3>"
+ "<h3><%= subtitle_proc( Time.at( #{date.to_i} ), #{$1.dump.gsub( /%/, '\\\\045' )} ) %></h3>"
end
r.sub!( %r!^<p>(.+?)</p>$!m ) do
- "<p><%= subtitle_proc( Time::at( #{date.to_i} ), #{$1.dump.gsub( /%/, '\\\\045' )} ) %></p>"
+ "<p><%= subtitle_proc( Time.at( #{date.to_i} ), #{$1.dump.gsub( /%/, '\\\\045' )} ) %></p>"
end unless subtitle
r.gsub( /<(\/)?tdiary-section>/, '<\\1p>' )
end
@@ -155,7 +155,7 @@ class WikiDiary
include DiaryBase
include CategorizableDiary
- def initialize( date, title, body, modified = Time::now )
+ def initialize( date, title, body, modified = Time.now )
init_diary
replace( date, title, body )
@last_modified = modified
@@ -198,7 +198,7 @@ def append( body, author = nil )
end
end
@sections << WikiSection::new( section, author ) if section
- @last_modified = Time::now
+ @last_modified = Time.now
self
end

0 comments on commit e4d25b8

Please sign in to comment.
Something went wrong with that request. Please try again.