aboutsummaryrefslogtreecommitdiff
path: root/ruby/dep_spec.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ruby/dep_spec.cc')
-rw-r--r--ruby/dep_spec.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index aacaf7069..155068358 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -59,6 +59,7 @@ namespace
static VALUE c_all_dep_spec;
static VALUE c_any_dep_spec;
+ static VALUE c_exactly_one_dep_spec;
static VALUE c_conditional_dep_spec;
static VALUE c_version_requirements_mode;
@@ -130,6 +131,7 @@ namespace
WrappedSpec<NamedSetDepSpec>,
WrappedSpec<AllDepSpec>,
WrappedSpec<AnyDepSpec>,
+ WrappedSpec<ExactlyOneDepSpec>,
WrappedSpec<ConditionalDepSpec>
>::Type>
{
@@ -265,6 +267,12 @@ namespace
wrapped.reset((new WrappedSpec<AnyDepSpec>(std::static_pointer_cast<AnyDepSpec>(node.spec()->clone())))->add_children(node.begin(), node.end()));
klass = c_any_dep_spec;
}
+
+ void visit(const GenericSpecTree::NodeType<ExactlyOneDepSpec>::Type & node)
+ {
+ wrapped.reset((new WrappedSpec<ExactlyOneDepSpec>(std::static_pointer_cast<ExactlyOneDepSpec>(node.spec()->clone())))->add_children(node.begin(), node.end()));
+ klass = c_exactly_one_dep_spec;
+ }
};
template <typename T_>
@@ -1123,6 +1131,17 @@ namespace
rb_define_method(c_any_dep_spec, "each", RUBY_FUNC_CAST((&Composite<AllDepSpec>::each)), 0);
/*
+ * Document-class: Paludis::ExactlyOneDepSpec
+ *
+ * Represents a "^^ ( )" dependency block. Includes
+ * Enumerable[http://www.ruby-doc.org/core/classes/Enumerable.html].
+ */
+ c_exactly_one_dep_spec = rb_define_class_under(paludis_module(), "ExactlyOneDepSpec", c_dep_spec);
+ rb_funcall(c_exactly_one_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_include_module(c_exactly_one_dep_spec, rb_mEnumerable);
+ rb_define_method(c_exactly_one_dep_spec, "each", RUBY_FUNC_CAST((&Composite<AllDepSpec>::each)), 0);
+
+ /*
* Document-class: Paludis::ConditionalDepSpec
*
* Represents a use? ( ) dependency spec. Includes