[Groonga-commit] droonga/fluent-plugin-droonga at 49fa6b6 [master] Add SingleVolume

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Mar 21 15:38:05 JST 2014


Kouhei Sutou	2014-03-21 15:38:05 +0900 (Fri, 21 Mar 2014)

  New Revision: 49fa6b6b4a5bb454a2bb70286e0c13f98df6dd90
  https://github.com/droonga/fluent-plugin-droonga/commit/49fa6b6b4a5bb454a2bb70286e0c13f98df6dd90

  Message:
    Add SingleVolume

  Added files:
    lib/droonga/catalog/single_volume.rb
    test/unit/catalog/test_single_volume.rb

  Added: lib/droonga/catalog/single_volume.rb (+28 -0) 100644
===================================================================
--- /dev/null
+++ lib/droonga/catalog/single_volume.rb    2014-03-21 15:38:05 +0900 (f9357ec)
@@ -0,0 +1,28 @@
+# Copyright (C) 2014 Droonga Project
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1 as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+module Droonga
+  module Catalog
+    class SingleVolume
+      def initialize(data)
+        @data = data
+      end
+
+      def address
+        @data["address"]
+      end
+    end
+  end
+end

  Added: test/unit/catalog/test_single_volume.rb (+31 -0) 100644
===================================================================
--- /dev/null
+++ test/unit/catalog/test_single_volume.rb    2014-03-21 15:38:05 +0900 (cabf25a)
@@ -0,0 +1,31 @@
+# Copyright (C) 2014 Droonga Project
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1 as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+require "droonga/catalog/single_volume"
+
+class CatalogSingleVolumeTest < Test::Unit::TestCase
+  def create_single_volume(data)
+    Droonga::Catalog::SingleVolume.new(data)
+  end
+
+  def test_address
+    data = {
+      "address" => "127.0.0.1:10047/volume.000",
+    }
+    volume = create_single_volume(data)
+    assert_equal("127.0.0.1:10047/volume.000",
+                 volume.address)
+  end
+end
-------------- next part --------------
HTML����������������������������...
Download 



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