[Groonga-commit] ranguba/rroonga at dcef04a [master] Add Groonga::Plugin.ruby_suffix

Back to archive index

Kouhei Sutou null+****@clear*****
Wed May 13 17:50:35 JST 2015


Kouhei Sutou	2015-05-13 17:50:35 +0900 (Wed, 13 May 2015)

  New Revision: dcef04a01d08f863fed3875a0e6610b8d756cd12
  https://github.com/ranguba/rroonga/commit/dcef04a01d08f863fed3875a0e6610b8d756cd12

  Message:
    Add Groonga::Plugin.ruby_suffix

  Modified files:
    ext/groonga/rb-grn-plugin.c
    test/test-plugin.rb

  Modified: ext/groonga/rb-grn-plugin.c (+15 -1)
===================================================================
--- ext/groonga/rb-grn-plugin.c    2015-05-13 17:50:11 +0900 (fcfb36b)
+++ ext/groonga/rb-grn-plugin.c    2015-05-13 17:50:35 +0900 (ca6102a)
@@ -1,6 +1,6 @@
 /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
-  Copyright (C) 2011  Kouhei Sutou <kou �� clear-code.com>
+  Copyright (C) 2011-2015  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
@@ -191,6 +191,18 @@ rb_grn_plugin_s_suffix (VALUE klass)
     return rb_str_new_cstr(grn_plugin_get_suffix());
 }
 
+/*
+ * Returns the plugin file suffix written in Ruby. It returns ".rb".
+ *
+ * @overload ruby_suffix
+ *   @return [String]
+ */
+static VALUE
+rb_grn_plugin_s_ruby_suffix (VALUE klass)
+{
+    return rb_str_new_cstr(grn_plugin_get_ruby_suffix());
+}
+
 void
 rb_grn_init_plugin (VALUE mGrn)
 {
@@ -205,4 +217,6 @@ rb_grn_init_plugin (VALUE mGrn)
                                rb_grn_plugin_s_system_plugins_dir, 0);
     rb_define_singleton_method(cGrnPlugin, "suffix",
                                rb_grn_plugin_s_suffix, 0);
+    rb_define_singleton_method(cGrnPlugin, "ruby_suffix",
+                               rb_grn_plugin_s_ruby_suffix, 0);
 }

  Modified: test/test-plugin.rb (+5 -1)
===================================================================
--- test/test-plugin.rb    2015-05-13 17:50:11 +0900 (d2fdde3)
+++ test/test-plugin.rb    2015-05-13 17:50:35 +0900 (8513784)
@@ -1,4 +1,4 @@
-# Copyright (C) 2011  Kouhei Sutou <kou �� clear-code.com>
+# Copyright (C) 2011-2015  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
@@ -35,6 +35,10 @@ class PluginTest < Test::Unit::TestCase
     end
   end
 
+  def test_ruby_suffix
+    assert_equal(".rb", Groonga::Plugin.ruby_suffix)
+  end
+
   class UnregisterTest < self
     def test_by_name
       context.register_plugin("token_filters/stop_word")
-------------- next part --------------
HTML����������������������������...
Download 



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