Kouhei Sutou
null+****@clear*****
Wed Jan 13 17:19:23 JST 2016
Kouhei Sutou 2012-12-05 17:38:27 +0900 (Wed, 05 Dec 2012) New Revision: bfd09b5592c3832fbc105ea73712749b095ffbb8 https://github.com/groonga/groonga-command/commit/bfd09b5592c3832fbc105ea73712749b095ffbb8 Message: Support register Added files: lib/groonga/command/register.rb test/command/test-register.rb Modified files: lib/groonga/command/parser.rb Modified: lib/groonga/command/parser.rb (+2 -0) =================================================================== --- lib/groonga/command/parser.rb 2012-11-29 12:42:01 +0900 (ddbfc30) +++ lib/groonga/command/parser.rb 2012-12-05 17:38:27 +0900 (a7dded2) @@ -24,6 +24,7 @@ require "yajl" require "groonga/command/error" require "groonga/command/base" + require "groonga/command/get" require "groonga/command/select" require "groonga/command/suggest" @@ -36,6 +37,7 @@ require "groonga/command/column-remove" require "groonga/command/column-rename" require "groonga/command/delete" require "groonga/command/truncate" +require "groonga/command/register" module Groonga module Command Added: lib/groonga/command/register.rb (+35 -0) 100644 =================================================================== --- /dev/null +++ lib/groonga/command/register.rb 2012-12-05 17:38:27 +0900 (003b0fa) @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2012 Kouhei Sutou <kou �� clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +require "groonga/command/base" + +module Groonga + module Command + class Register < Base + Command.register("register", self) + + class << self + def parameter_names + [ + :path, + ] + end + end + end + end +end Added: test/command/test-register.rb (+39 -0) 100644 =================================================================== --- /dev/null +++ test/command/test-register.rb 2012-12-05 17:38:27 +0900 (ada2aca) @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2012 Kouhei Sutou <kou �� clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +class RegisterCommandTest < Test::Unit::TestCase + class CommandLineTest < self + include GroongaCommandTestUtils::CommandLineCommandParser + + def test_ordered_arguments + path = "tokenizers/mecab" + + command = parse(path) + assert_instance_of(Groonga::Command::Register, command) + assert_equal({ + :path => path, + }, + command.arguments) + end + + private + def parse(*arguments) + super("register", arguments, :output_type => false) + end + end +end -------------- next part -------------- HTML����������������������������...Download