[Hiki-cvs 1494] [1041] use single dot instead of double colon when calling singleton methods.

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 9月 2日 (水) 00:02:07 JST


Revision: 1041
          http://sourceforge.jp/projects/hiki/svn/view?view=rev&revision=1041
Author:   okkez
Date:     2009-09-02 00:02:07 +0900 (Wed, 02 Sep 2009)

Log Message:
-----------
use single dot instead of double colon when calling singleton methods.

Modified Paths:
--------------
    hiki/branches/rack/hiki/db/ptstore.rb
    hiki/branches/rack/misc/plugin/attach.rb
    hiki/branches/rack/misc/plugin/footnote.rb
    hiki/branches/rack/misc/plugin/google-sitemaps.rb
    hiki/branches/rack/misc/plugin/note.rb
    hiki/branches/rack/misc/plugin/pagerank.rb
    hiki/branches/rack/misc/plugin/referer.rb
    hiki/branches/rack/misc/plugin/rss.rb

Modified: hiki/branches/rack/hiki/db/ptstore.rb
===================================================================
--- hiki/branches/rack/hiki/db/ptstore.rb	2009-09-01 15:02:04 UTC (rev 1040)
+++ hiki/branches/rack/hiki/db/ptstore.rb	2009-09-01 15:02:07 UTC (rev 1041)
@@ -106,15 +106,15 @@
   end
 
   def dump(table)
-    TMarshal::dump(table)
+    TMarshal.dump(table)
   end
 
   def load(content)
-    TMarshal::load(content)
+    TMarshal.load(content)
   end
 
   def load_file(file)
-    TMarshal::load(file)
+    TMarshal.load(file)
   end
 
   private

Modified: hiki/branches/rack/misc/plugin/attach.rb
===================================================================
--- hiki/branches/rack/misc/plugin/attach.rb	2009-09-01 15:02:04 UTC (rev 1040)
+++ hiki/branches/rack/misc/plugin/attach.rb	2009-09-01 15:02:07 UTC (rev 1041)
@@ -95,7 +95,7 @@
   file_name   = (params['file_name'] || '')
   attach_file = "#{@cache_path}/attach/#{escape(page)}/#{escape(file_name)}"
   extname     =  /\.([^.]+)$/.match(file_name.downcase).to_a[1]
-  if File::exist?( attach_file.untaint )
+  if File.exist?( attach_file.untaint )
     mime_type = nil
     File.open(attach_file.untaint, 'rb') do |fh|
       mime_type = ImageSize.new(fh).mime_type
@@ -104,7 +104,7 @@
     header = {}
     header['Content-Type'] = mime_type
     header['Content-Length'] = File.size(attach_file.untaint)
-    header['Last-Modified'] = CGI::rfc1123_date(File.mtime(attach_file.untaint))
+    header['Last-Modified'] = CGI.rfc1123_date(File.mtime(attach_file.untaint))
     if %r|^image/| =~ mime_type
       header['Content-Disposition'] = %Q|inline; filename="#{file_name.to_sjis}"; modification-date="#{header['Last-Modified']}";|
     else
@@ -125,7 +125,7 @@
   if file_name =~ /\.(txt|rd|rb|c|pl|py|sh|java|html|htm|css|xml|xsl|sql|yaml)\z/i
     file = "#{@conf.cache_path}/attach/#{escape(page.untaint)}/#{escape(file_name.untaint)}"
     s = %Q!<pre>!
-    content = File::readlines(file)
+    content = File.readlines(file)
     if @options['attach.show_linenum']
       line = 0
       content.collect! {|i| sprintf("%3d| %s", line+=1, i)}
@@ -146,9 +146,9 @@
 def attach_page_files
   result = []
   attach_path = "#{@cache_path}/attach/#{escape(@page)}".untaint
-  if FileTest::directory?(attach_path)
+  if FileTest.directory?(attach_path)
     Dir.entries(attach_path).collect do |file_name|
-      result << file_name if FileTest::file?("#{attach_path}/#{file_name}".untaint)
+      result << file_name if FileTest.file?("#{attach_path}/#{file_name}".untaint)
     end
   end
   result
@@ -156,7 +156,7 @@
 
 def attach_all_files
   attach_files = Hash.new([])
-  return [] unless File::exist?("#{@cache_path}/attach/")
+  return [] unless File.exist?("#{@cache_path}/attach/")
 
   Dir.foreach("#{@cache_path}/attach/") do |dir|
     next if /^\./ =~ dir

Modified: hiki/branches/rack/misc/plugin/footnote.rb
===================================================================
--- hiki/branches/rack/misc/plugin/footnote.rb	2009-09-01 15:02:04 UTC (rev 1040)
+++ hiki/branches/rack/misc/plugin/footnote.rb	2009-09-01 15:02:07 UTC (rev 1041)
@@ -47,15 +47,15 @@
 def render( text )
   tmp =****@conf*****_plugin
   @conf.use_plugin = false
-  parser =****@conf*****::new( @conf )
+  parser =****@conf*****( @conf )
   tokens = parser.parse(unescape_html(text) )
-  formatter =****@conf*****::new( tokens, @db, self, @conf )
+  formatter =****@conf*****( tokens, @db, self, @conf )
   @conf.use_plugin = tmp
   formatter.to_s.gsub(/\A<p>/,'').gsub(/<\/p>\Z/,'').gsub(/<p>/, '<p class="footnote">')
 end
 
 if @options['command'] == 'view'
-  add_body_enter_proc(Proc::new do |date|
+  add_body_enter_proc(Proc.new do |date|
                         date = date.strftime("%Y%m%d")
                         @footnote_name.replace "f%02d"
                         @footnote_url.replace "#{@index}#{anchor date}##{@footnote_name}"
@@ -66,7 +66,7 @@
                         ""
                       end)
 
-  add_body_leave_proc(Proc::new do |date|
+  add_body_leave_proc(Proc.new do |date|
                         if @footnote_name and****@footn***** > 0
                           %Q|<div class="footnote">\n| +
                             @footnotes.collect do |fn|

Modified: hiki/branches/rack/misc/plugin/google-sitemaps.rb
===================================================================
--- hiki/branches/rack/misc/plugin/google-sitemaps.rb	2009-09-01 15:02:04 UTC (rev 1040)
+++ hiki/branches/rack/misc/plugin/google-sitemaps.rb	2009-09-01 15:02:07 UTC (rev 1041)
@@ -28,7 +28,7 @@
 def google_sitemaps
   body, last_modified = google_sitemaps_body
   header = {}
-  header['Last-Modified'] = CGI::rfc1123_date(last_modified)
+  header['Last-Modified'] = CGI.rfc1123_date(last_modified)
   header['type']          = 'text/xml'
   header['charset']       =  'UTF-8'
   header['Content-Language'] =****@conf*****

Modified: hiki/branches/rack/misc/plugin/note.rb
===================================================================
--- hiki/branches/rack/misc/plugin/note.rb	2009-09-01 15:02:04 UTC (rev 1040)
+++ hiki/branches/rack/misc/plugin/note.rb	2009-09-01 15:02:07 UTC (rev 1041)
@@ -4,7 +4,7 @@
 
 def note_orig_page
   if /\A#{Regexp.escape(note_prefix)}/ =~ @page
-    hiki_anchor( CGI::escape( $' ), page_name( $' ) )
+    hiki_anchor(escape($'), page_name($'))
   end
 end
 

Modified: hiki/branches/rack/misc/plugin/pagerank.rb
===================================================================
--- hiki/branches/rack/misc/plugin/pagerank.rb	2009-09-01 15:02:04 UTC (rev 1040)
+++ hiki/branches/rack/misc/plugin/pagerank.rb	2009-09-01 15:02:07 UTC (rev 1041)
@@ -321,7 +321,7 @@
 # show pagerank page: called by hiki menu
 def pagerank_page
   header = {}
-  header['Last-Modified'] = CGI::rfc1123_date(Time.now)
+  header['Last-Modified'] = CGI.rfc1123_date(Time.now)
   header['type']          = 'text/html'
   header['charset']       =****@conf*****
   header['Content-Language'] =****@conf*****

Modified: hiki/branches/rack/misc/plugin/referer.rb
===================================================================
--- hiki/branches/rack/misc/plugin/referer.rb	2009-09-01 15:02:04 UTC (rev 1040)
+++ hiki/branches/rack/misc/plugin/referer.rb	2009-09-01 15:02:07 UTC (rev 1041)
@@ -71,7 +71,7 @@
   Dir.entries(path).sort {|a, b| unescape(a) <=> unescape(b) }.each do |f|
     next if /(?:^\.)|(?:~$)/ =~ f
     next unles****@db*****?(unescape(f.untaint))
-    db = PTStore::new("#{path}/#{f}")
+    db = PTStore.new("#{path}/#{f}")
     p = File.basename(f)
     s << "<li>#{hiki_anchor(p, page_name(unescape(p)))}</li>\n"
     s << "<ul>\n"
@@ -105,7 +105,7 @@
     Dir.mkdir(referer_path) unless File.exist?(referer_path)
 
     file_name = "#{referer_path}/#{escape(@page).to_euc}"
-    db = PTStore::new(file_name)
+    db = PTStore.new(file_name)
     add_referer(db)
 
     case @options['referer.display_type']

Modified: hiki/branches/rack/misc/plugin/rss.rb
===================================================================
--- hiki/branches/rack/misc/plugin/rss.rb	2009-09-01 15:02:04 UTC (rev 1040)
+++ hiki/branches/rack/misc/plugin/rss.rb	2009-09-01 15:02:07 UTC (rev 1041)
@@ -41,13 +41,13 @@
     when 3
       tokens =****@db*****_cache( name )
       unless tokens
-        parser =****@conf*****::new( @conf )
+        parser =****@conf*****( @conf )
         tokens = parser.parse( @db.load( name ) )
         @db.save_cache( name, tokens )
       end
       tmp =****@conf*****_plugin
       @conf.use_plugin = false
-      formatter =****@conf*****::new( tokens, @db, Plugin.new( @conf.options, @conf), @conf )
+      formatter =****@conf*****( tokens, @db, Plugin.new( @conf.options, @conf), @conf )
       content = formatter.to_s
       @conf.use_plugin = tmp
     else
@@ -98,7 +98,7 @@
     header['status'] = 'NOT_MODIFIED'
     print****@cgi*****(header)
   else
-    header['Last-Modified'] = CGI::rfc1123_date(last_modified)
+    header['Last-Modified'] = CGI.rfc1123_date(last_modified)
     header['type']          = 'text/xml'
     header['charset']       =  @conf.charset
     header['Content-Language'] =****@conf*****




Hiki-cvs メーリングリストの案内
Back to archive index