[Groonga-commit] droonga/drntest at 050084e [master] Shorten name of TestRunner's attribute accessors

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Nov 25 17:46:42 JST 2013


YUKI Hiroshi	2013-11-25 17:46:42 +0900 (Mon, 25 Nov 2013)

  New Revision: 050084e3f43e5b9c09ed72f6a8dee72fe2c76006
  https://github.com/droonga/drntest/commit/050084e3f43e5b9c09ed72f6a8dee72fe2c76006

  Message:
    Shorten name of TestRunner's attribute accessors

  Modified files:
    lib/drntest/executor.rb
    lib/drntest/test-runner.rb

  Modified: lib/drntest/executor.rb (+4 -4)
===================================================================
--- lib/drntest/executor.rb    2013-11-25 17:42:53 +0900 (10795e3)
+++ lib/drntest/executor.rb    2013-11-25 17:46:42 +0900 (f3eb120)
@@ -17,10 +17,10 @@ require "droonga/client"
 
 module Drntest
   class Executor
-    attr_reader :tester, :request
+    attr_reader :owner, :request
 
-    def initialize(tester, request)
-      @tester = tester
+    def initialize(owner, request)
+      @owner = owner
       @request = request
     end
 
@@ -30,7 +30,7 @@ module Drntest
 
     private
     def execute_commands
-      client = Droonga::Client.new(tag: tester.tag, port: tester.port)
+      client = Droonga::Client.new(tag: owner.tag, port: owner.port)
       client.connection.send(request, :response => :one)
     end
 

  Modified: lib/drntest/test-runner.rb (+22 -22)
===================================================================
--- lib/drntest/test-runner.rb    2013-11-25 17:42:53 +0900 (ce8b05a)
+++ lib/drntest/test-runner.rb    2013-11-25 17:46:42 +0900 (a65606c)
@@ -23,10 +23,10 @@ require "fileutils"
 
 module Drntest
   class TestRunner
-    attr_reader :tester, :target_path
+    attr_reader :owner, :target_path
 
-    def initialize(tester, target)
-      @tester = tester
+    def initialize(owner, target)
+      @owner = owner
       @target_path = Pathname(target)
     end
 
@@ -40,53 +40,53 @@ module Drntest
     end
 
     def config_dir
-      return @config_file.parent if @config_file
+      retur****@confi***** if @config
       @target_path.parent
     end
 
-    def config_file
-      @config_file || @config_dir + "fluentd.conf"
+    def config
+      @config || @config_dir + "fluentd.conf"
     end
 
-    def config_file=(path)
+    def config=(path)
       path = Pathname(path)
       path += "fluentd.conf" if path.directory?
-      @config_file = path
+      @config = path
     end
 
-    def catalog_file
-      @catalog_file || @config_dir + "catalog.json"
+    def catalog
+      @catalog || @config_dir + "catalog.json"
     end
 
-    def catalog_file=(path)
-      @catalog_file = Pathname(path)
+    def catalog=(path)
+      @catalog = Pathname(path)
     end
 
     private
     def prepare
-      self.config_file = tester.config if tester.config
-      self.catalog_file = tester.catalog if tester.catalog
+      self.config = owner.config if owner.config
+      self.catalog = owner.catalog if owner.catalog
 
       options = load_options
-      self.config_file = Pathname(options[:config]) if options[:config]
-      self.catalog_file = Pathname(options[:catalog]) if options[:catalog]
+      self.config = Pathname(options[:config]) if options[:config]
+      self.catalog = Pathname(options[:catalog]) if options[:catalog]
     end
 
     def setup
-      unless config_file.exist?
-        raise "Missing config file: #{config_file.to_s}"
+      unless config.exist?
+        raise "Missing config file: #{config.to_s}"
       end
-      unless catalog_file.exist?
-        raise "Missing catalog file: #{catalog_file.to_s}"
+      unless catalog.exist?
+        raise "Missing catalog file: #{catalog.to_s}"
       end
 
       FileUtils.rm_rf(temporary_dir)
       FileUtils.mkdir_p(temporary_dir)
 
       temporary_config = temporary_dir + "fluentd.conf"
-      FileUtils.cp(config_file, temporary_config)
+      FileUtils.cp(config, temporary_config)
       temporary_catalog = temporary_dir + "catalog.json"
-      FileUtils.cp(catalog_file, temporary_catalog)
+      FileUtils.cp(catalog, temporary_catalog)
 
       engine_command = "fluentd --config #{temporary_config}"
       engine_env = {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index