null+****@clear*****
null+****@clear*****
2012年 6月 6日 (水) 18:56:07 JST
Haruka Yoshihara 2012-06-06 18:56:07 +0900 (Wed, 06 Jun 2012) New Revision: 31f22b8ee6b3a8a5fa524fd287524f4b445012a2 Log: Define methods for creating new executer instead of overriding Modified files: lib/groonga/tester.rb Modified: lib/groonga/tester.rb (+6 -7) =================================================================== --- lib/groonga/tester.rb 2012-06-06 18:43:31 +0900 (f8ed0e5) +++ lib/groonga/tester.rb 2012-06-06 18:56:07 +0900 (fd82e15) @@ -576,7 +576,8 @@ module Groonga end end - def execute_script(path, executer) + def execute_script(path) + executer = create_executer(@context) script_path = Pathname(path) if script_path.relative? script_path = Pathname(@context.base_directory) + script_path @@ -661,9 +662,8 @@ module Groonga @output.gets end - def execute_script(path) - executer = self.class.new(@input, @output, @context) - super(path, executer) + def create_executer(context) + self.class.new(@input, @output, context) end private @@ -707,9 +707,8 @@ module Groonga end end - def execute_script(path) - executer = self.class.new(@host, @port, @context) - super(path, executer) + def create_executer(context) + self.class.new(@host, @port, context) end end