[Hiki-cvs 1491] [1038] use literal instead of obvious new method.

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 9月 1日 (火) 23:27:26 JST


Revision: 1038
          http://sourceforge.jp/projects/hiki/svn/view?view=rev&revision=1038
Author:   okkez
Date:     2009-09-01 23:27:26 +0900 (Tue, 01 Sep 2009)

Log Message:
-----------
use literal instead of obvious new method.

	* hiki/auth/typekey.rb: use literal instead of obvious new method.
	* hiki/auth/typekey.rb: ditto.
	* misc/plugin/attach.rb: ditto.
	* misc/plugin/category.rb: ditto.
	* misc/plugin/google-sitemaps.rb: ditto.
	* misc/plugin/incremental_search.rb: ditto.
	* misc/plugin/keyword.rb: ditto.
	* misc/plugin/math.rb: ditto.
	* misc/plugin/pagerank.rb: ditto.
	* misc/plugin/rss.rb: ditto.
	* misc/plugin/src.rb: ditto.
	* plugin/01sp.rb: ditto.
	* style/default/html_formatter.rb: ditto.
	* style/rd+/anchorlist.rb: ditto.
	* style/rd+/rd2html.rb: ditto.

Modified Paths:
--------------
    hiki/trunk/ChangeLog
    hiki/trunk/hiki/auth/typekey.rb
    hiki/trunk/misc/plugin/attach.rb
    hiki/trunk/misc/plugin/category.rb
    hiki/trunk/misc/plugin/google-sitemaps.rb
    hiki/trunk/misc/plugin/incremental_search.rb
    hiki/trunk/misc/plugin/keyword.rb
    hiki/trunk/misc/plugin/math.rb
    hiki/trunk/misc/plugin/pagerank.rb
    hiki/trunk/misc/plugin/rss.rb
    hiki/trunk/misc/plugin/src.rb
    hiki/trunk/plugin/01sp.rb
    hiki/trunk/style/default/html_formatter.rb
    hiki/trunk/style/rd+/anchorlist.rb
    hiki/trunk/style/rd+/rd2html.rb

Modified: hiki/trunk/ChangeLog
===================================================================
--- hiki/trunk/ChangeLog	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/ChangeLog	2009-09-01 14:27:26 UTC (rev 1038)
@@ -1,3 +1,22 @@
+2009-08-31  okkez  <okkez****@gmail*****>
+
+	* hiki/auth/typekey.rb: use literal instead of obvious new method.
+	* hiki/auth/typekey.rb: ditto.
+	* misc/plugin/attach.rb: ditto.
+	* misc/plugin/category.rb: ditto.
+	* misc/plugin/google-sitemaps.rb: ditto.
+	* misc/plugin/incremental_search.rb: ditto.
+	* misc/plugin/keyword.rb: ditto.
+	* misc/plugin/math.rb: ditto.
+	* misc/plugin/pagerank.rb: ditto.
+	* misc/plugin/rss.rb: ditto.
+	* misc/plugin/src.rb: ditto.
+	* plugin/01sp.rb: ditto.
+	* style/default/html_formatter.rb: ditto.
+	* style/rd+/anchorlist.rb: ditto.
+	* style/rd+/rd2html.rb: ditto.
+
+
 2009-08-30  okkez  <okkez****@gmail*****>
 
 	* hiki/command.rb: use Hiki::Util#escape, Hiki::Util#unescape,

Modified: hiki/trunk/hiki/auth/typekey.rb
===================================================================
--- hiki/trunk/hiki/auth/typekey.rb	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/hiki/auth/typekey.rb	2009-09-01 14:27:26 UTC (rev 1038)
@@ -146,7 +146,7 @@
         @key_string = fh.read
       }
     end
-    tk_key = Hash.new
+    tk_key = {}
     for pair in @key_string.strip.split(' ')
       key, value = pair.split('=')
       tk_key[key] = value.to_i

Modified: hiki/trunk/misc/plugin/attach.rb
===================================================================
--- hiki/trunk/misc/plugin/attach.rb	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/misc/plugin/attach.rb	2009-09-01 14:27:26 UTC (rev 1038)
@@ -101,7 +101,7 @@
       mime_type = ImageSize.new(fh).mime_type
     end
 
-    header = Hash::new
+    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))
@@ -144,7 +144,7 @@
 end
 
 def attach_page_files
-  result = Array::new
+  result = []
   attach_path = "#{@cache_path}/attach/#{escape(@page)}".untaint
   if FileTest::directory?(attach_path)
     Dir.entries(attach_path).collect do |file_name|

Modified: hiki/trunk/misc/plugin/category.rb
===================================================================
--- hiki/trunk/misc/plugin/category.rb	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/misc/plugin/category.rb	2009-09-01 14:27:26 UTC (rev 1038)
@@ -6,7 +6,7 @@
 
   category.collect! {|a| unescape_html(a) }
 
-  l = Hash::new
+  l = {}
   @db.page_info.each do |a|
     if category_re =~ a.keys[0] && (category.size == 0 || category.index($1))
       l[$1] = [] unless l[$1]

Modified: hiki/trunk/misc/plugin/google-sitemaps.rb
===================================================================
--- hiki/trunk/misc/plugin/google-sitemaps.rb	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/misc/plugin/google-sitemaps.rb	2009-09-01 14:27:26 UTC (rev 1038)
@@ -27,7 +27,7 @@
 
 def google_sitemaps
   body, last_modified = google_sitemaps_body
-  header = Hash::new
+  header = {}
   header['Last-Modified'] = CGI::rfc1123_date(last_modified)
   header['type']          = 'text/xml'
   header['charset']       =  'UTF-8'

Modified: hiki/trunk/misc/plugin/incremental_search.rb
===================================================================
--- hiki/trunk/misc/plugin/incremental_search.rb	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/misc/plugin/incremental_search.rb	2009-09-01 14:27:26 UTC (rev 1038)
@@ -89,7 +89,7 @@
           r = "<ul>\n" + l.map{|i| "<li>#{i}</li>\n"}.join + "</ul>\n"
         end
       end
-      header = Hash::new
+      header = {}
       header['type'] = 'text/html'
       header['charset'] = 'EUC-JP'
       header['Content-Language'] =****@conf*****

Modified: hiki/trunk/misc/plugin/keyword.rb
===================================================================
--- hiki/trunk/misc/plugin/keyword.rb	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/misc/plugin/keyword.rb	2009-09-01 14:27:26 UTC (rev 1038)
@@ -28,7 +28,7 @@
 def keywords(*keyword)
   keyword.collect! {|a| unescape_html(a) }
 
-  key = Hash::new
+  key = {}
   @db.page_info.each do |info|
     next unless info.values[0][:keyword]
     info.values[0][:keyword].each do |k|

Modified: hiki/trunk/misc/plugin/math.rb
===================================================================
--- hiki/trunk/misc/plugin/math.rb	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/misc/plugin/math.rb	2009-09-01 14:27:26 UTC (rev 1038)
@@ -5,7 +5,7 @@
   image_file = "#{@cache_path}/math_latex/#{escape(page)}/#{escape(file_name)}"
   mime_type  = "image/png"
 
-  header = Hash::new
+  header = {}
   header['Content-Type'] = mime_type
   header['Last-Modified'] = CGI::rfc1123_date(File.mtime(image_file.untaint))
   header['Content-Disposition'] = %Q|filename="#{file_name.to_sjis}"|

Modified: hiki/trunk/misc/plugin/pagerank.rb
===================================================================
--- hiki/trunk/misc/plugin/pagerank.rb	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/misc/plugin/pagerank.rb	2009-09-01 14:27:26 UTC (rev 1038)
@@ -320,7 +320,7 @@
 
 # show pagerank page: called by hiki menu
 def pagerank_page
-  header = Hash::new
+  header = {}
   header['Last-Modified'] = CGI::rfc1123_date(Time.now)
   header['type']          = 'text/html'
   header['charset']       =****@conf*****

Modified: hiki/trunk/misc/plugin/rss.rb
===================================================================
--- hiki/trunk/misc/plugin/rss.rb	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/misc/plugin/rss.rb	2009-09-01 14:27:26 UTC (rev 1038)
@@ -85,7 +85,7 @@
 
 def rss
   body, last_modified = rss_body
-  header = Hash::new
+  header = {}
 
   require 'time'
   begin

Modified: hiki/trunk/misc/plugin/src.rb
===================================================================
--- hiki/trunk/misc/plugin/src.rb	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/misc/plugin/src.rb	2009-09-01 14:27:26 UTC (rev 1038)
@@ -23,7 +23,7 @@
 </html>
 EOS
 
-  header = Hash::new
+  header = {}
   header['Last-Modified'] = CGI::rfc1123_date(Time.now)
   header['type']          = 'text/html'
   header['charset']       =  @conf.charset

Modified: hiki/trunk/plugin/01sp.rb
===================================================================
--- hiki/trunk/plugin/01sp.rb	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/plugin/01sp.rb	2009-09-01 14:27:26 UTC (rev 1038)
@@ -46,7 +46,7 @@
 
 # hash of paths from array of dirs
 def sp_hash_from_dirs( dirs )
-  r = Hash.new
+  r = {}
   dirs.each do |dir|
     Dir.glob( "#{dir}/*.rb" ).each do |path|
       filename = File.basename( path )

Modified: hiki/trunk/style/default/html_formatter.rb
===================================================================
--- hiki/trunk/style/default/html_formatter.rb	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/style/default/html_formatter.rb	2009-09-01 14:27:26 UTC (rev 1038)
@@ -18,7 +18,7 @@
       @plugin     = plugin
       @conf       = conf
       @prefix     = prefix
-      @references = Array.new
+      @references = []
       @interwiki  = InterWiki.new( @db.load( @conf.interwiki_name ) )
       @aliaswiki  = AliasWiki.new( @db.load( @conf.aliaswiki_name ) )
       get_auto_links if****@conf*****_link

Modified: hiki/trunk/style/rd+/anchorlist.rb
===================================================================
--- hiki/trunk/style/rd+/anchorlist.rb	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/style/rd+/anchorlist.rb	2009-09-01 14:27:26 UTC (rev 1038)
@@ -26,7 +26,7 @@
 
 
     def initialize(interwiki_data, plugin)
-      @anchors = Hash.new
+      @anchors = {}
       @plugin = plugin
       n = interwiki_data || ''
       n.scan(REG_INTERWIKI_NAME) do |i|

Modified: hiki/trunk/style/rd+/rd2html.rb
===================================================================
--- hiki/trunk/style/rd+/rd2html.rb	2009-08-30 14:47:15 UTC (rev 1037)
+++ hiki/trunk/style/rd+/rd2html.rb	2009-09-01 14:27:26 UTC (rev 1038)
@@ -36,7 +36,7 @@
       @plugin = plugin
       @db = db
       @conf = conf
-      @references = Array.new
+      @references = []
       @regex = nil
       @toc = []
 




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