[Hiki-cvs 1478] [1026] fix history plugin

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 8月 30日 (日) 23:46:36 JST


Revision: 1026
          http://sourceforge.jp/projects/hiki/svn/view?view=rev&revision=1026
Author:   okkez
Date:     2009-08-30 23:46:36 +0900 (Sun, 30 Aug 2009)

Log Message:
-----------
fix history plugin

* a plugin returns an instance of Hiki::Response, Hiki render the response

Modified Paths:
--------------
    hiki/branches/rack/hiki/command.rb
    hiki/branches/rack/misc/plugin/history.rb

Modified: hiki/branches/rack/hiki/command.rb
===================================================================
--- hiki/branches/rack/hiki/command.rb	2009-08-30 14:46:33 UTC (rev 1025)
+++ hiki/branches/rack/hiki/command.rb	2009-08-30 14:46:36 UTC (rev 1026)
@@ -561,6 +561,7 @@
       result = true
       if****@plugi*****_to?( plugin ) && !Object.method_defined?( plugin )
         result =****@plugi*****( plugin )
+        return result if result.instance_of? Hiki::Response
       else
         raise PluginException, 'not plugin method'
       end

Modified: hiki/branches/rack/misc/plugin/history.rb
===================================================================
--- hiki/branches/rack/misc/plugin/history.rb	2009-08-30 14:46:33 UTC (rev 1025)
+++ hiki/branches/rack/misc/plugin/history.rb	2009-08-30 14:46:36 UTC (rev 1026)
@@ -210,7 +210,7 @@
     # Output source at an arbitrary revision
     def history_src
       # make command string
-      r =****@cgi*****['r'][0] || '1'
+      r =****@cgi*****['r'] || '1'
       txt =****@conf*****_revision(@p, r)
       txt = "*** no source ***" if txt.empty?
 
@@ -233,8 +233,8 @@
     # Output diff between two arbitrary revisions
     def history_diff
       # make command string
-      r =****@cgi*****['r'][0] || '1'
-      r2 =****@cgi*****['r2'][0]
+      r =****@cgi*****['r'] || '1'
+      r2 =****@cgi*****['r2']
       if r2.nil? || r2.to_i == 0
         new =****@db*****(@p)
         old =****@conf*****_revision(@p, r)




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