[Hiki-cvs 1466] [1013] * hiki/config.rb (Hiki::Config#initialize): improved performance.

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2009年 8月 28日 (金) 23:12:08 JST


Revision: 1013
          http://sourceforge.jp/projects/hiki/svn/view?view=rev&revision=1013
Author:   okkez
Date:     2009-08-28 23:12:08 +0900 (Fri, 28 Aug 2009)

Log Message:
-----------
* hiki/config.rb (Hiki::Config#initialize): improved performance.

Modified Paths:
--------------
    hiki/trunk/ChangeLog
    hiki/trunk/hiki/config.rb

Modified: hiki/trunk/ChangeLog
===================================================================
--- hiki/trunk/ChangeLog	2009-08-27 14:59:32 UTC (rev 1012)
+++ hiki/trunk/ChangeLog	2009-08-28 14:12:08 UTC (rev 1013)
@@ -1,3 +1,7 @@
+2009-08-28  okkez  <okkez****@gmail*****>
+
+	* hiki/config.rb (Hiki::Config#initialize): improved performance.
+
 2009-08-24  Kazuhiko  <kazuh****@fdiar*****>
 	* style/default/parser.rb, style/default/html_formatter.rb:
 	replacing WikiName links is now handled by HikiDoc by specifying

Modified: hiki/trunk/hiki/config.rb
===================================================================
--- hiki/trunk/hiki/config.rb	2009-08-27 14:59:32 UTC (rev 1012)
+++ hiki/trunk/hiki/config.rb	2009-08-28 14:12:08 UTC (rev 1013)
@@ -38,19 +38,7 @@
       # repository class
       @repos = Hiki.const_get("Repos#{@repos_type.capitalize}").new(@repos_root, @data_path)
 
-      instance_variables.each do |v|
-        v = v.to_s
-        v.sub!( /@/, '' )
-        instance_eval( <<-SRC
-        def #{v}
-          @#{v}
-        end
-        def #{v}=(p)
-          @#{v} = p
-        end
-        SRC
-        )
-      end
+      self.class.__send__ :attr_accessor, *instance_variables.map{|v| v.sub('@', '') }
 
       bot = ["googlebot", "Hatena Antenna", "moget****@goo*****"]
       bot += @options['bot'] || []




Hiki-cvs メーリングリストの案内
アーカイブの一覧に戻る