Yoji Shidara
null+****@clear*****
Tue Feb 18 12:05:48 JST 2014
Yoji Shidara 2014-02-18 12:05:48 +0900 (Tue, 18 Feb 2014) New Revision: 69fa945d470bd0a6874b24be7c4207a5df06e578 https://github.com/droonga/fluent-plugin-droonga/commit/69fa945d470bd0a6874b24be7c4207a5df06e578 Message: schema: Add Droonga::Catalog::Schema Added files: lib/droonga/catalog/schema.rb Modified files: lib/droonga/catalog/base.rb Modified: lib/droonga/catalog/base.rb (+3 -1) =================================================================== --- lib/droonga/catalog/base.rb 2014-02-18 14:20:06 +0900 (fcfdbbf) +++ lib/droonga/catalog/base.rb 2014-02-18 12:05:48 +0900 (b037309) @@ -16,13 +16,14 @@ require "digest/sha1" require "zlib" require "time" +require "droonga/catalog/schema" require "droonga/message_processing_error" require "droonga/catalog/errors" module Droonga module Catalog class Base - attr_reader :path, :base_path + attr_reader :path, :base_path, :schema def initialize(data, path) @data = data @path = path @@ -47,6 +48,7 @@ module Droonga dataset["continuum"] = continuum.sort do |a, b| a[0] - b[0]; end end @options = @data["options"] || {} + @schema = Droonga::Catalog::Schema.new(@data["schema"]) end def option(name) Added: lib/droonga/catalog/schema.rb (+26 -0) 100644 =================================================================== --- /dev/null +++ lib/droonga/catalog/schema.rb 2014-02-18 12:05:48 +0900 (5a059b5) @@ -0,0 +1,26 @@ +# 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 Schema + def initialize(data) + @data = data + end + + # TODO provide useful methods + end + end +end -------------- next part -------------- HTML����������������������������...Download