[Groonga-commit] ranguba/rroonga at 1a2a6ee [master] Remove unused options

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Apr 13 15:50:38 JST 2015


Kouhei Sutou	2015-04-13 15:50:38 +0900 (Mon, 13 Apr 2015)

  New Revision: 1a2a6eeda9ebb0af1df7c3dd0d2032f40b1e36f1
  https://github.com/ranguba/rroonga/commit/1a2a6eeda9ebb0af1df7c3dd0d2032f40b1e36f1

  Message:
    Remove unused options
    
    It's a backward incompatible change but it's not a problem. Because
    nobody doesn't use.

  Modified files:
    ext/groonga/rb-grn-column.c
    ext/groonga/rb-grn-table.c
    lib/groonga/record.rb

  Modified: ext/groonga/rb-grn-column.c (+10 -16)
===================================================================
--- ext/groonga/rb-grn-column.c    2015-04-13 15:39:55 +0900 (4a0de56)
+++ ext/groonga/rb-grn-column.c    2015-04-13 15:50:38 +0900 (ee24794)
@@ -504,19 +504,16 @@ rb_grn_column_lock (int argc, VALUE *argv, VALUE self)
 }
 
 /*
- * Force to clear lock of `column`.
+ * Forces to clear lock of the `column`.
  *
- * @overload clear_lock(options={})
- *   @param [::Hash] options No available options.
+ * @overload clear_lock
+ *   @return [void]
  */
 static VALUE
-rb_grn_column_clear_lock (int argc, VALUE *argv, VALUE self)
+rb_grn_column_clear_lock (VALUE self)
 {
     grn_ctx *context;
     grn_obj *column;
-    VALUE options;
-
-    rb_scan_args(argc, argv, "01",  &options);
 
     rb_grn_column_deconstruct(SELF(self), &column, &context,
                              NULL, NULL,
@@ -528,19 +525,16 @@ rb_grn_column_clear_lock (int argc, VALUE *argv, VALUE self)
 }
 
 /*
- * Check whether `column` is locked or not.
+ * Checks whether the `column` is locked or not.
  *
- * @overload locked?(options={})
- *   @param [::Hash] options No available options.
+ * @overload locked?
+ *   @return [Boolean] `true` if the `column` is locked, `false` otherwise.
  */
 static VALUE
-rb_grn_column_is_locked (int argc, VALUE *argv, VALUE self)
+rb_grn_column_is_locked (VALUE self)
 {
     grn_ctx *context;
     grn_obj *column;
-    VALUE options;
-
-    rb_scan_args(argc, argv, "01",  &options);
 
     rb_grn_column_deconstruct(SELF(self), &column, &context,
                              NULL, NULL,
@@ -804,8 +798,8 @@ rb_grn_init_column (VALUE mGrn)
     rb_define_method(rb_cGrnColumn, "select", rb_grn_column_select, -1);
     rb_define_method(rb_cGrnColumn, "lock", rb_grn_column_lock, -1);
     rb_define_method(rb_cGrnColumn, "unlock", rb_grn_column_unlock, -1);
-    rb_define_method(rb_cGrnColumn, "clear_lock", rb_grn_column_clear_lock, -1);
-    rb_define_method(rb_cGrnColumn, "locked?", rb_grn_column_is_locked, -1);
+    rb_define_method(rb_cGrnColumn, "clear_lock", rb_grn_column_clear_lock, 0);
+    rb_define_method(rb_cGrnColumn, "locked?", rb_grn_column_is_locked, 0);
     rb_define_method(rb_cGrnColumn, "reference?", rb_grn_column_reference_p, 0);
     rb_define_method(rb_cGrnColumn, "truncate", rb_grn_column_truncate, 0);
     /* deprecated: backward compatibility */

  Modified: ext/groonga/rb-grn-table.c (+10 -16)
===================================================================
--- ext/groonga/rb-grn-table.c    2015-04-13 15:39:55 +0900 (7a8d55f)
+++ ext/groonga/rb-grn-table.c    2015-04-13 15:50:38 +0900 (bc930f7)
@@ -2039,19 +2039,16 @@ rb_grn_table_lock (int argc, VALUE *argv, VALUE self)
 }
 
 /*
- * Force to clear lock of `table`.
+ * Forces to clear lock of the `table`.
  *
- * @overload clear_lock(options={})
- *   @param [::Hash] options No available options.
+ * @overload clear_lock
+ *   @return [void]
  */
 static VALUE
-rb_grn_table_clear_lock (int argc, VALUE *argv, VALUE self)
+rb_grn_table_clear_lock (VALUE self)
 {
     grn_ctx *context;
     grn_obj *table;
-    VALUE options;
-
-    rb_scan_args(argc, argv, "01",  &options);
 
     rb_grn_table_deconstruct(SELF(self), &table, &context,
                              NULL, NULL,
@@ -2064,19 +2061,16 @@ rb_grn_table_clear_lock (int argc, VALUE *argv, VALUE self)
 }
 
 /*
- * Check whether `table` is locked or not.
+ * Checks whether the `table` is locked or not.
  *
- * @overload locked?(options={})
- *   @param [options] options No available options.
+ * @overload locked?
+ *   @return [Boolean] `true` if the `table` is locked, `false` otherwise.
  */
 static VALUE
-rb_grn_table_is_locked (int argc, VALUE *argv, VALUE self)
+rb_grn_table_is_locked (VALUE self)
 {
     grn_ctx *context;
     grn_obj *table;
-    VALUE options;
-
-    rb_scan_args(argc, argv, "01",  &options);
 
     rb_grn_table_deconstruct(SELF(self), &table, &context,
                              NULL, NULL,
@@ -2623,8 +2617,8 @@ rb_grn_init_table (VALUE mGrn)
 
     rb_define_method(rb_cGrnTable, "lock", rb_grn_table_lock, -1);
     rb_define_method(rb_cGrnTable, "unlock", rb_grn_table_unlock, -1);
-    rb_define_method(rb_cGrnTable, "clear_lock", rb_grn_table_clear_lock, -1);
-    rb_define_method(rb_cGrnTable, "locked?", rb_grn_table_is_locked, -1);
+    rb_define_method(rb_cGrnTable, "clear_lock", rb_grn_table_clear_lock, 0);
+    rb_define_method(rb_cGrnTable, "locked?", rb_grn_table_is_locked, 0);
 
     rb_define_method(rb_cGrnTable, "select", rb_grn_table_select, -1);
 

  Modified: lib/groonga/record.rb (+10 -8)
===================================================================
--- lib/groonga/record.rb    2015-04-13 15:39:55 +0900 (f14402b)
+++ lib/groonga/record.rb    2015-04-13 15:50:38 +0900 (9328005)
@@ -366,18 +366,20 @@ module Groonga
       @table.unlock(options.merge(:id => @id))
     end
 
-    # レコードが所属するテーブルのロックを強制的に解除する。
+    # Forces to clear lock of the table to which the record belongs.
     #
-    # 利用可能なオプションは現在は無い。
-    def clear_lock(options={})
-      @table.clear_lock(options.merge(:id => @id))
+    # @return [void]
+    def clear_lock
+      @table.clear_lock
     end
 
-    # レコードが所属するテーブルがロックされていれば +true+ を返す。
+    # Checks whether the table to which the record belongs is locked
+    # or not.
     #
-    # 利用可能なオプションは現在は無い。
-    def locked?(options={})
-      @table.locked?(options.merge(:id => @id))
+    # @return [Boolean] `true` if the table to which the record
+    #   belongs is locked, `false` otherwise.
+    def locked?
+      @table.locked?
     end
 
     # レコードが持つIDが有効なIDであれば +true+ を返す。
-------------- next part --------------
HTML����������������������������...
Download 



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