aboutsummaryrefslogtreecommitdiff
path: root/ruby/dep_spec.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-10 21:04:29 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-10 21:56:32 +0000
commit57e75ec95dffd6bccd5bfa3dbb2544d53d3f05f6 (patch)
tree6bdff8312f1591ff888d5f614893044daea47db1 /ruby/dep_spec.cc
parent2ae50ba059835a056ac724a34d985fb73ae49cf6 (diff)
downloadpaludis-57e75ec95dffd6bccd5bfa3dbb2544d53d3f05f6.tar.gz
paludis-57e75ec95dffd6bccd5bfa3dbb2544d53d3f05f6.tar.xz
Don't need block_kinds any more
Diffstat (limited to 'ruby/dep_spec.cc')
-rw-r--r--ruby/dep_spec.cc27
1 files changed, 5 insertions, 22 deletions
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index 8cb530077..405d2d05c 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -45,7 +45,6 @@ namespace
static VALUE c_dep_spec;
static VALUE c_string_dep_spec;
- static VALUE c_block_kind;
static VALUE c_block_dep_spec;
static VALUE c_dependencies_labels_dep_spec;
static VALUE c_fetchable_uri_dep_spec;
@@ -474,20 +473,16 @@ namespace
}
VALUE
- block_dep_spec_new(VALUE self, VALUE str, VALUE spec, VALUE kind)
+ block_dep_spec_new(VALUE self, VALUE str, VALUE spec)
{
std::shared_ptr<const WrappedSpecBase> * ptr(0);
try
{
- int l = NUM2INT(kind);
- if (l < 0 || l >= last_bk)
- rb_raise(rb_eTypeError, "BlockDepSpec expects a valid BlockKind as the third parameter");
-
std::shared_ptr<const PackageDepSpec> pkg(value_to_package_dep_spec(spec));
ptr = new std::shared_ptr<const WrappedSpecBase>(std::make_shared<WrappedSpec<BlockDepSpec>>(
- std::make_shared<BlockDepSpec>(StringValuePtr(str), *pkg, static_cast<BlockKind>(l))));
+ std::make_shared<BlockDepSpec>(StringValuePtr(str), *pkg)));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<const WrappedSpecBase> >::free, ptr));
- rb_obj_call_init(tdata, 3, &str);
+ rb_obj_call_init(tdata, 2, &str);
return tdata;
}
catch (const std::exception & e)
@@ -1176,26 +1171,14 @@ namespace
rb_define_method(c_plain_text_label_dep_spec, "to_s", RUBY_FUNC_CAST(plain_text_dep_label_spec_to_s), 0);
/*
- * Document-module: Paludis::BlockKind
- *
- * The kind of a BlockDepSpec
- */
- c_block_kind = rb_define_module_under(paludis_module(), "BlockKind");
- for (BlockKind l(static_cast<BlockKind>(0)), l_end(last_bk) ; l != l_end ;
- l = static_cast<BlockKind>(static_cast<int>(l) + 1))
- rb_define_const(c_block_kind, value_case_to_RubyCase(stringify(l)).c_str(), INT2FIX(l));
-
- // cc_enum_special<paludis/dep_spec.hh, BlockKind, c_block_kind>
-
- /*
* Document-class: Paludis::BlockDepSpec
*
* A BlockDepSpec represents a block on a package name (for example, 'app-editors/vim'), possibly with
* associated version and SLOT restrictions.
*/
c_block_dep_spec = rb_define_class_under(paludis_module(), "BlockDepSpec", c_string_dep_spec);
- rb_define_singleton_method(c_block_dep_spec, "new", RUBY_FUNC_CAST(&block_dep_spec_new), 3);
- rb_define_method(c_block_dep_spec, "initialize", RUBY_FUNC_CAST(&dep_spec_init_1), 3);
+ rb_define_singleton_method(c_block_dep_spec, "new", RUBY_FUNC_CAST(&block_dep_spec_new), 2);
+ rb_define_method(c_block_dep_spec, "initialize", RUBY_FUNC_CAST(&dep_spec_init_1), 2);
rb_define_method(c_block_dep_spec, "blocking", RUBY_FUNC_CAST(&block_dep_spec_blocking), 0);
VALUE (* block_dep_spec_to_s) (VALUE) = &dep_spec_to_s<BlockDepSpec>;
rb_define_method(c_block_dep_spec, "to_s", RUBY_FUNC_CAST(block_dep_spec_to_s), 0);