Navigation Menu

Skip to content

Commit

Permalink
Remove unused options
Browse files Browse the repository at this point in the history
It's a backward incompatible change but it's not a problem. Because
nobody doesn't use.
  • Loading branch information
kou committed Apr 13, 2015
1 parent 0152f92 commit 1a2a6ee
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 40 deletions.
26 changes: 10 additions & 16 deletions ext/groonga/rb-grn-column.c
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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 */
Expand Down
26 changes: 10 additions & 16 deletions ext/groonga/rb-grn-table.c
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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);

Expand Down
18 changes: 10 additions & 8 deletions lib/groonga/record.rb
Expand Up @@ -366,18 +366,20 @@ def unlock(options={})
@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+ を返す。
Expand Down

0 comments on commit 1a2a6ee

Please sign in to comment.