aboutsummaryrefslogtreecommitdiff
path: root/ruby
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-10-09 18:12:57 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-10-11 17:16:30 +0100
commita99f46ae26d0679ec1b815faf33787686b071000 (patch)
treed1512aeac2027a80c77f0c5f56dad84e06db5e96 /ruby
parentc84fb95a15d9b9b96a2e36509391fe6444cc69a0 (diff)
downloadpaludis-a99f46ae26d0679ec1b815faf33787686b071000.tar.gz
paludis-a99f46ae26d0679ec1b815faf33787686b071000.tar.xz
labels changes
Diffstat (limited to 'ruby')
-rw-r--r--ruby/Makefile.am1
-rw-r--r--ruby/dep_label.cc433
-rw-r--r--ruby/dep_label_TEST.rb34
-rw-r--r--ruby/dep_spec.cc54
-rw-r--r--ruby/dep_spec_TEST.rb6
-rw-r--r--ruby/metadata_key.cc6
-rw-r--r--ruby/nice_names.nn2
-rw-r--r--ruby/paludis_ruby.hh9
8 files changed, 125 insertions, 420 deletions
diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index 48d787221..039a73a6d 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -21,7 +21,6 @@ IF_RUBY_TESTS = \
action_TEST.rb \
choice_TEST.rb \
contents_TEST.rb \
- dep_label_TEST.rb \
dep_list_TEST.rb \
dep_spec_TEST.rb \
dep_tag_TEST.rb \
diff --git a/ruby/dep_label.cc b/ruby/dep_label.cc
index af25f824f..9981bb4af 100644
--- a/ruby/dep_label.cc
+++ b/ruby/dep_label.cc
@@ -44,27 +44,15 @@ namespace
static VALUE c_uri_local_mirrors_only_label;
static VALUE c_uri_manual_only_label;
- static VALUE c_dependency_label;
- static VALUE c_dependency_system_label;
- static VALUE c_dependency_type_label;
- static VALUE c_dependency_suggest_label;
- static VALUE c_dependency_abis_label;
- static VALUE c_dependency_host_label;
- static VALUE c_dependency_target_label;
- static VALUE c_dependency_build_label;
- static VALUE c_dependency_run_label;
- static VALUE c_dependency_post_label;
- static VALUE c_dependency_compile_label;
- static VALUE c_dependency_install_label;
- static VALUE c_dependency_suggested_label;
- static VALUE c_dependency_recommended_label;
- static VALUE c_dependency_required_label;
- static VALUE c_dependency_any_label;
- static VALUE c_dependency_mine_label;
- static VALUE c_dependency_primary_label;
- static VALUE c_dependency_abi_label;
-
- static VALUE c_active_dependency_labels;
+ static VALUE c_dependencies_label;
+ static VALUE c_dependencies_build_label;
+ static VALUE c_dependencies_compile_against_label;
+ static VALUE c_dependencies_fetch_label;
+ static VALUE c_dependencies_install_label;
+ static VALUE c_dependencies_post_label;
+ static VALUE c_dependencies_recommendation_label;
+ static VALUE c_dependencies_run_label;
+ static VALUE c_dependencies_suggestion_label;
struct URILabelToValue
{
@@ -113,152 +101,86 @@ namespace
}
};
- struct RealDependencyLabelToValue
+ /*
+ * Document-method: text
+ *
+ * call-seq:
+ * text -> String
+ *
+ * Our text.
+ */
+ /*
+ * Document-method: to_s
+ *
+ * call-seq:
+ * to_s -> String
+ *
+ * Fetch a string representation of ourself.
+ */
+ VALUE
+ uri_label_text(VALUE self)
+ {
+ std::tr1::shared_ptr<const URILabel> * ptr;
+ Data_Get_Struct(self, std::tr1::shared_ptr<const URILabel>, ptr);
+ return rb_str_new2((*ptr)->text().c_str());
+ }
+
+ struct DependenciesLabelToValue
{
VALUE value;
- std::tr1::shared_ptr<const DependencyLabel> mm;
+ std::tr1::shared_ptr<const DependenciesLabel> mm;
- RealDependencyLabelToValue(const std::tr1::shared_ptr<const DependencyLabel> & _m) :
+ DependenciesLabelToValue(const std::tr1::shared_ptr<const DependenciesLabel> & _m) :
mm(_m)
{
- value = Qnil;
- }
-
- void visit(const DependencyHostLabel &)
- {
- value = Data_Wrap_Struct(c_dependency_host_label, 0,
- &Common<std::tr1::shared_ptr<const DependencyLabel> >::free,
- new std::tr1::shared_ptr<const DependencyLabel>(mm));
- }
-
- void visit(const DependencyTargetLabel &)
- {
- value = Data_Wrap_Struct(c_dependency_target_label, 0,
- &Common<std::tr1::shared_ptr<const DependencyLabel> >::free,
- new std::tr1::shared_ptr<const DependencyLabel>(mm));
- }
-
- void visit(const DependencyBuildLabel &)
- {
- value = Data_Wrap_Struct(c_dependency_build_label, 0,
- &Common<std::tr1::shared_ptr<const DependencyLabel> >::free,
- new std::tr1::shared_ptr<const DependencyLabel>(mm));
- }
-
- void visit(const DependencyRunLabel &)
- {
- value = Data_Wrap_Struct(c_dependency_run_label, 0,
- &Common<std::tr1::shared_ptr<const DependencyLabel> >::free,
- new std::tr1::shared_ptr<const DependencyLabel>(mm));
- }
-
- void visit(const DependencyPostLabel &)
- {
- value = Data_Wrap_Struct(c_dependency_post_label, 0,
- &Common<std::tr1::shared_ptr<const DependencyLabel> >::free,
- new std::tr1::shared_ptr<const DependencyLabel>(mm));
- }
-
- void visit(const DependencyCompileLabel &)
- {
- value = Data_Wrap_Struct(c_dependency_compile_label, 0,
- &Common<std::tr1::shared_ptr<const DependencyLabel> >::free,
- new std::tr1::shared_ptr<const DependencyLabel>(mm));
- }
-
- void visit(const DependencyInstallLabel &)
- {
- value = Data_Wrap_Struct(c_dependency_install_label, 0,
- &Common<std::tr1::shared_ptr<const DependencyLabel> >::free,
- new std::tr1::shared_ptr<const DependencyLabel>(mm));
- }
-
- void visit(const DependencySuggestedLabel &)
- {
- value = Data_Wrap_Struct(c_dependency_suggested_label, 0,
- &Common<std::tr1::shared_ptr<const DependencyLabel> >::free,
- new std::tr1::shared_ptr<const DependencyLabel>(mm));
- }
-
- void visit(const DependencyRecommendedLabel &)
- {
- value = Data_Wrap_Struct(c_dependency_recommended_label, 0,
- &Common<std::tr1::shared_ptr<const DependencyLabel> >::free,
- new std::tr1::shared_ptr<const DependencyLabel>(mm));
}
- void visit(const DependencyRequiredLabel &)
+ void visit(const DependenciesBuildLabel &)
{
- value = Data_Wrap_Struct(c_dependency_required_label, 0,
- &Common<std::tr1::shared_ptr<const DependencyLabel> >::free,
- new std::tr1::shared_ptr<const DependencyLabel>(mm));
+ value = Data_Wrap_Struct(c_dependencies_build_label, 0, &Common<std::tr1::shared_ptr<const DependenciesLabel> >::free,
+ new std::tr1::shared_ptr<const DependenciesLabel>(mm));
}
- void visit(const DependencyAnyLabel &)
+ void visit(const DependenciesRunLabel &)
{
- value = Data_Wrap_Struct(c_dependency_any_label, 0,
- &Common<std::tr1::shared_ptr<const DependencyLabel> >::free,
- new std::tr1::shared_ptr<const DependencyLabel>(mm));
+ value = Data_Wrap_Struct(c_dependencies_run_label, 0, &Common<std::tr1::shared_ptr<const DependenciesLabel> >::free,
+ new std::tr1::shared_ptr<const DependenciesLabel>(mm));
}
- void visit(const DependencyMineLabel &)
+ void visit(const DependenciesPostLabel &)
{
- value = Data_Wrap_Struct(c_dependency_mine_label, 0,
- &Common<std::tr1::shared_ptr<const DependencyLabel> >::free,
- new std::tr1::shared_ptr<const DependencyLabel>(mm));
+ value = Data_Wrap_Struct(c_dependencies_post_label, 0, &Common<std::tr1::shared_ptr<const DependenciesLabel> >::free,
+ new std::tr1::shared_ptr<const DependenciesLabel>(mm));
}
- void visit(const DependencyPrimaryLabel &)
+ void visit(const DependenciesInstallLabel &)
{
- value = Data_Wrap_Struct(c_dependency_primary_label, 0,
- &Common<std::tr1::shared_ptr<const DependencyLabel> >::free,
- new std::tr1::shared_ptr<const DependencyLabel>(mm));
+ value = Data_Wrap_Struct(c_dependencies_install_label, 0, &Common<std::tr1::shared_ptr<const DependenciesLabel> >::free,
+ new std::tr1::shared_ptr<const DependenciesLabel>(mm));
}
- void visit(const DependencyABILabel &)
+ void visit(const DependenciesFetchLabel &)
{
- value = Data_Wrap_Struct(c_dependency_abi_label, 0,
- &Common<std::tr1::shared_ptr<const DependencyLabel> >::free,
- new std::tr1::shared_ptr<const DependencyLabel>(mm));
+ value = Data_Wrap_Struct(c_dependencies_fetch_label, 0, &Common<std::tr1::shared_ptr<const DependenciesLabel> >::free,
+ new std::tr1::shared_ptr<const DependenciesLabel>(mm));
}
- };
- struct DependencyLabelToValue
- {
- VALUE value;
- std::tr1::shared_ptr<const DependencyLabel> mm;
-
- DependencyLabelToValue(const std::tr1::shared_ptr<const DependencyLabel> & _m) :
- mm(_m)
+ void visit(const DependenciesSuggestionLabel &)
{
+ value = Data_Wrap_Struct(c_dependencies_suggestion_label, 0, &Common<std::tr1::shared_ptr<const DependenciesLabel> >::free,
+ new std::tr1::shared_ptr<const DependenciesLabel>(mm));
}
- void visit(const DependencySystemLabel & label)
+ void visit(const DependenciesRecommendationLabel &)
{
- RealDependencyLabelToValue v(mm);
- label.accept(v);
- value = v.value;
+ value = Data_Wrap_Struct(c_dependencies_recommendation_label, 0, &Common<std::tr1::shared_ptr<const DependenciesLabel> >::free,
+ new std::tr1::shared_ptr<const DependenciesLabel>(mm));
}
- void visit(const DependencyTypeLabel & label)
+ void visit(const DependenciesCompileAgainstLabel &)
{
- RealDependencyLabelToValue v(mm);
- label.accept(v);
- value = v.value;
- }
-
- void visit(const DependencySuggestLabel & label)
- {
- RealDependencyLabelToValue v(mm);
- label.accept(v);
- value = v.value;
- }
-
- void visit(const DependencyABIsLabel & label)
- {
- RealDependencyLabelToValue v(mm);
- label.accept(v);
- value = v.value;
+ value = Data_Wrap_Struct(c_dependencies_compile_against_label, 0, &Common<std::tr1::shared_ptr<const DependenciesLabel> >::free,
+ new std::tr1::shared_ptr<const DependenciesLabel>(mm));
}
};
@@ -279,34 +201,10 @@ namespace
* Fetch a string representation of ourself.
*/
VALUE
- uri_label_text(VALUE self)
- {
- std::tr1::shared_ptr<const URILabel> * ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<const URILabel>, ptr);
- return rb_str_new2((*ptr)->text().c_str());
- }
-
- /*
- * Document-method: text
- *
- * call-seq:
- * text -> String
- *
- * Our text.
- */
- /*
- * Document-method: to_s
- *
- * call-seq:
- * to_s -> String
- *
- * Fetch a string representation of ourself.
- */
- VALUE
- dependency_label_text(VALUE self)
+ dependencies_label_text(VALUE self)
{
- std::tr1::shared_ptr<const DependencyLabel> * ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<const DependencyLabel>, ptr);
+ std::tr1::shared_ptr<const DependenciesLabel> * ptr;
+ Data_Get_Struct(self, std::tr1::shared_ptr<const DependenciesLabel>, ptr);
return rb_str_new2((*ptr)->text().c_str());
}
@@ -316,82 +214,6 @@ namespace
return self;
}
- VALUE
- active_dependency_labels_new(int argc, VALUE *argv, VALUE self)
- {
- std::tr1::shared_ptr<ActiveDependencyLabels> * ptr(0);
- try
- {
- if (1 == argc && rb_obj_is_kind_of(argv[0], c_active_dependency_labels))
- {
- ptr = new std::tr1::shared_ptr<ActiveDependencyLabels>(
- new ActiveDependencyLabels(*value_to_active_dependency_labels(argv[0])));
- }
- else if (1 == argc && rb_obj_is_kind_of(argv[0], *dependency_labels_dep_spec_value_ptr()))
- {
- ptr = new std::tr1::shared_ptr<ActiveDependencyLabels>(
- new ActiveDependencyLabels(*value_to_dependency_labels_dep_spec(argv[0])));
- }
- else if (1 == argc && rb_obj_is_kind_of(argv[0], rb_cArray))
- {
- std::tr1::shared_ptr<DependencyLabelSequence> seq(new DependencyLabelSequence);
-
- for (int i(0) ; i < RARRAY_LEN(argv[0]) ; ++i)
- {
- VALUE entry(rb_ary_entry(argv[0], i));
- seq->push_back(value_to_dependency_label(entry));
- }
-
- ptr = new std::tr1::shared_ptr<ActiveDependencyLabels>(new ActiveDependencyLabels(*seq));
- }
- else if (2 == argc && rb_obj_is_kind_of(argv[0], c_active_dependency_labels) &&
- rb_obj_is_kind_of(argv[1], *dependency_labels_dep_spec_value_ptr()))
- {
- ptr = new std::tr1::shared_ptr<ActiveDependencyLabels>(
- new ActiveDependencyLabels(*value_to_active_dependency_labels(argv[0]),
- *value_to_dependency_labels_dep_spec(argv[1])));
- }
- else
- {
- rb_raise(rb_eArgError, "ActiveDependencyLabels expects one or two arguments, but got %d",argc);
- }
-
- VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::tr1::shared_ptr<ActiveDependencyLabels> >::free, ptr));
- rb_obj_call_init(tdata, argc, argv);
- return tdata;
- }
- catch (const std::exception & e)
- {
- delete ptr;
- exception_to_ruby_exception(e);
- }
- }
-
- template <typename T_, const std::tr1::shared_ptr<const T_> (ActiveDependencyLabels::* f_) () const>
- struct ActiveDependencyLabelsLabels
- {
- static VALUE
- get(VALUE self)
- {
- try
- {
- std::tr1::shared_ptr<ActiveDependencyLabels> * ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<ActiveDependencyLabels>, ptr);
- std::tr1::shared_ptr<const T_> v(((**ptr).*(f_))());
-
- VALUE result(rb_ary_new());
- for (typename T_::ConstIterator i(v->begin()), i_end(v->end()) ;
- i != i_end ; ++i)
- rb_ary_push(result, dependency_label_to_value(*i));
- return result;
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
- };
-
void do_register_dep_label()
{
/*
@@ -411,80 +233,25 @@ namespace
c_uri_local_mirrors_only_label = rb_define_class_under(paludis_module(), "URILocalMirrorsOnlyLabel", c_uri_label);
c_uri_manual_only_label = rb_define_class_under(paludis_module(), "URIManualOnlyLabel", c_uri_label);
- c_dependency_label = rb_define_class_under(paludis_module(), "DependencyLabel", rb_cObject);
- rb_funcall(c_dependency_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_dependency_label, "text", RUBY_FUNC_CAST(&dependency_label_text), 0);
- rb_define_method(c_dependency_label, "to_s", RUBY_FUNC_CAST(&dependency_label_text), 0);
-
- c_dependency_system_label = rb_define_class_under(paludis_module(), "DependencySystemLabel", c_dependency_label);
- rb_funcall(c_dependency_system_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_type_label = rb_define_class_under(paludis_module(), "DependencyTypeLabel", c_dependency_label);
- rb_funcall(c_dependency_type_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_suggest_label = rb_define_class_under(paludis_module(), "DependencySuggestLabel", c_dependency_label);
- rb_funcall(c_dependency_suggest_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_abis_label = rb_define_class_under(paludis_module(), "DependencyABIsLabel", c_dependency_label);
- rb_funcall(c_dependency_abis_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_host_label = rb_define_class_under(paludis_module(), "DependencyHostLabel", c_dependency_system_label);
- rb_funcall(c_dependency_host_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_target_label = rb_define_class_under(paludis_module(), "DependencyTargetLabel", c_dependency_system_label);
- rb_funcall(c_dependency_target_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_build_label = rb_define_class_under(paludis_module(), "DependencyBuildLabel", c_dependency_type_label);
- rb_funcall(c_dependency_build_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_run_label = rb_define_class_under(paludis_module(), "DependencyRunLabel", c_dependency_type_label);
- rb_funcall(c_dependency_run_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_post_label = rb_define_class_under(paludis_module(), "DependencyPostLabel", c_dependency_type_label);
- rb_funcall(c_dependency_post_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_compile_label = rb_define_class_under(paludis_module(), "DependencyCompileLabel", c_dependency_type_label);
- rb_funcall(c_dependency_compile_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_install_label = rb_define_class_under(paludis_module(), "DependencyInstallLabel", c_dependency_type_label);
- rb_funcall(c_dependency_install_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_suggested_label = rb_define_class_under(paludis_module(), "DependencySuggestedLabel", c_dependency_suggest_label);
- rb_funcall(c_dependency_suggested_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_recommended_label = rb_define_class_under(paludis_module(), "DependencyRecommendedLabel", c_dependency_suggest_label);
- rb_funcall(c_dependency_recommended_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_required_label = rb_define_class_under(paludis_module(), "DependencyRequiredLabel", c_dependency_suggest_label);
- rb_funcall(c_dependency_required_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_any_label = rb_define_class_under(paludis_module(), "DependencyAnyLabel", c_dependency_abis_label);
- rb_funcall(c_dependency_any_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_mine_label = rb_define_class_under(paludis_module(), "DependencyMineLabel", c_dependency_abis_label);
- rb_funcall(c_dependency_mine_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_primary_label = rb_define_class_under(paludis_module(), "DependencyPrimaryLabel", c_dependency_abis_label);
- rb_funcall(c_dependency_primary_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
-
- c_dependency_abi_label = rb_define_class_under(paludis_module(), "DependencyAbiLabel", c_dependency_abis_label);
- rb_funcall(c_dependency_abi_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ /*
+ * Document-class: Paludis::DependenciesLabel
+ *
+ * Dependencies label base class.
+ */
+ c_dependencies_label = rb_define_class_under(paludis_module(), "DependenciesLabel", rb_cObject);
+ rb_funcall(c_dependencies_label, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_dependencies_label, "text", RUBY_FUNC_CAST(&dependencies_label_text), 0);
+ rb_define_method(c_dependencies_label, "to_s", RUBY_FUNC_CAST(&dependencies_label_text), 0);
+
+ c_dependencies_build_label = rb_define_class_under(paludis_module(), "DependenciesBuildLabel", c_dependencies_label);
+ c_dependencies_run_label = rb_define_class_under(paludis_module(), "DependenciesRunLabel", c_dependencies_label);
+ c_dependencies_post_label = rb_define_class_under(paludis_module(), "DependenciesPostLabel", c_dependencies_label);
+ c_dependencies_install_label = rb_define_class_under(paludis_module(), "DependenciesInstallLabel", c_dependencies_label);
+ c_dependencies_compile_against_label = rb_define_class_under(paludis_module(), "DependenciesCompileAgainstLabel", c_dependencies_label);
+ c_dependencies_fetch_label = rb_define_class_under(paludis_module(), "DependenciesFetchLabel", c_dependencies_label);
+ c_dependencies_suggestion_label = rb_define_class_under(paludis_module(), "DependenciesSuggestionLabel", c_dependencies_label);
+ c_dependencies_recommendation_label = rb_define_class_under(paludis_module(), "DependenciesRecommendationLabel", c_dependencies_label);
- c_active_dependency_labels = rb_define_class_under(paludis_module(), "ActiveDependencyLabels", rb_cObject);
- rb_define_singleton_method(c_active_dependency_labels, "new", RUBY_FUNC_CAST(&active_dependency_labels_new), -1);
- rb_define_method(c_active_dependency_labels, "initialize", RUBY_FUNC_CAST(&empty_init), -1);
- rb_define_method(c_active_dependency_labels, "system_labels", RUBY_FUNC_CAST((
- ActiveDependencyLabelsLabels<DependencySystemLabelSequence,
- &ActiveDependencyLabels::system_labels>::get)), 0);
- rb_define_method(c_active_dependency_labels, "type_labels", RUBY_FUNC_CAST((
- ActiveDependencyLabelsLabels<DependencyTypeLabelSequence,
- &ActiveDependencyLabels::type_labels>::get)), 0);
- rb_define_method(c_active_dependency_labels, "abi_labels", RUBY_FUNC_CAST((
- ActiveDependencyLabelsLabels<DependencyABIsLabelSequence,
- &ActiveDependencyLabels::abi_labels>::get)), 0);
- rb_define_method(c_active_dependency_labels, "suggest_labels", RUBY_FUNC_CAST((
- ActiveDependencyLabelsLabels<DependencySuggestLabelSequence,
- &ActiveDependencyLabels::suggest_labels>::get)), 0);
}
}
@@ -504,11 +271,11 @@ paludis::ruby::uri_label_to_value(const std::tr1::shared_ptr<const URILabel> & m
}
VALUE
-paludis::ruby::dependency_label_to_value(const std::tr1::shared_ptr<const DependencyLabel> & m)
+paludis::ruby::dependencies_label_to_value(const std::tr1::shared_ptr<const DependenciesLabel> & m)
{
try
{
- DependencyLabelToValue v(m);
+ DependenciesLabelToValue v(m);
m->accept(v);
return v.value;
}
@@ -518,42 +285,20 @@ paludis::ruby::dependency_label_to_value(const std::tr1::shared_ptr<const Depend
}
}
-std::tr1::shared_ptr<ActiveDependencyLabels>
-paludis::ruby::value_to_active_dependency_labels(VALUE v)
-{
- try
- {
- if (rb_obj_is_kind_of(v, c_active_dependency_labels))
- {
- std::tr1::shared_ptr<ActiveDependencyLabels> * ptr;
- Data_Get_Struct(v, std::tr1::shared_ptr<ActiveDependencyLabels>, ptr);
- return *ptr;
- }
- else
- {
- rb_raise(rb_eTypeError, "Can't convert %s into ActiveDependencyLabels", rb_obj_classname(v));
- }
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
-}
-
-std::tr1::shared_ptr<const DependencyLabel>
-paludis::ruby::value_to_dependency_label(VALUE v)
+std::tr1::shared_ptr<const DependenciesLabel>
+paludis::ruby::value_to_dependencies_label(VALUE v)
{
try
{
- if (rb_obj_is_kind_of(v, c_dependency_label))
+ if (rb_obj_is_kind_of(v, c_dependencies_label))
{
- std::tr1::shared_ptr<const DependencyLabel> * ptr;
- Data_Get_Struct(v, std::tr1::shared_ptr<const DependencyLabel>, ptr);
+ std::tr1::shared_ptr<const DependenciesLabel> * ptr;
+ Data_Get_Struct(v, std::tr1::shared_ptr<const DependenciesLabel>, ptr);
return *ptr;
}
else
{
- rb_raise(rb_eTypeError, "Can't convert %s into DependencyLabel", rb_obj_classname(v));
+ rb_raise(rb_eTypeError, "Can't convert %s into DependenciesLabel", rb_obj_classname(v));
}
}
catch (const std::exception & e)
diff --git a/ruby/dep_label_TEST.rb b/ruby/dep_label_TEST.rb
deleted file mode 100644
index f2a4c9fc4..000000000
--- a/ruby/dep_label_TEST.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env ruby
-# vim: set sw=4 sts=4 et tw=80 :
-#
-# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
-# Copyright (c) 2007 Richard Brown
-#
-# This file is part of the Paludis package manager. Paludis is free software;
-# you can redistribute it and/or modify it under the terms of the GNU General
-# Public License version 2, as published by the Free Software Foundation.
-#
-# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place, Suite 330, Boston, MA 02111-1307 USA
-#
-
-require 'test/unit'
-require 'Paludis'
-
-module Paludis
- class TestCase_ActiveDependencyLabels < Test::Unit::TestCase
- def test_create
- a = ActiveDependencyLabels.new(DependencyLabelsDepSpec.new)
- a = ActiveDependencyLabels.new(a)
- a = ActiveDependencyLabels.new(a, DependencyLabelsDepSpec.new)
- a = ActiveDependencyLabels.new([])
- end
- end
-end
-
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index 05ff07f26..bd2b071f7 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -43,7 +43,7 @@ namespace
static VALUE c_string_dep_spec;
static VALUE c_block_dep_spec;
- static VALUE c_dependency_labels_dep_spec;
+ static VALUE c_dependencies_labels_dep_spec;
static VALUE c_fetchable_uri_dep_spec;
static VALUE c_license_dep_spec;
static VALUE c_named_set_dep_spec;
@@ -122,7 +122,7 @@ namespace
WrappedSpec<BlockDepSpec>,
WrappedSpec<URILabelsDepSpec>,
WrappedSpec<PlainTextLabelDepSpec>,
- WrappedSpec<DependencyLabelsDepSpec>,
+ WrappedSpec<DependenciesLabelsDepSpec>,
WrappedSpec<NamedSetDepSpec>,
WrappedSpec<AllDepSpec>,
WrappedSpec<AnyDepSpec>,
@@ -226,10 +226,10 @@ namespace
klass = c_plain_text_label_dep_spec;
}
- void visit(const GenericSpecTree::NodeType<DependencyLabelsDepSpec>::Type & node)
+ void visit(const GenericSpecTree::NodeType<DependenciesLabelsDepSpec>::Type & node)
{
- wrapped.reset(new WrappedSpec<DependencyLabelsDepSpec>(std::tr1::static_pointer_cast<DependencyLabelsDepSpec>(node.spec()->clone())));
- klass = c_dependency_labels_dep_spec;
+ wrapped.reset(new WrappedSpec<DependenciesLabelsDepSpec>(std::tr1::static_pointer_cast<DependenciesLabelsDepSpec>(node.spec()->clone())));
+ klass = c_dependencies_labels_dep_spec;
}
void visit(const GenericSpecTree::NodeType<NamedSetDepSpec>::Type & node)
@@ -435,17 +435,17 @@ namespace
}
VALUE
- dependency_labels_dep_spec_labels(VALUE self)
+ dependencies_labels_dep_spec_labels(VALUE self)
{
std::tr1::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::tr1::shared_ptr<WrappedSpecBase>, ptr);
- std::tr1::shared_ptr<const DependencyLabelsDepSpec> real_ptr(std::tr1::static_pointer_cast<const WrappedSpec<DependencyLabelsDepSpec> >(*ptr)->spec());
+ std::tr1::shared_ptr<const DependenciesLabelsDepSpec> real_ptr(std::tr1::static_pointer_cast<const WrappedSpec<DependenciesLabelsDepSpec> >(*ptr)->spec());
if (rb_block_given_p())
{
- for (DependencyLabelsDepSpec::ConstIterator it(real_ptr->begin()),
+ for (DependenciesLabelsDepSpec::ConstIterator it(real_ptr->begin()),
it_end(real_ptr->end()); it_end != it; ++it)
- rb_yield(dependency_label_to_value(*it));
+ rb_yield(dependencies_label_to_value(*it));
return Qnil;
}
@@ -453,9 +453,9 @@ namespace
{
VALUE result(rb_ary_new());
- for (DependencyLabelsDepSpec::ConstIterator it(real_ptr->begin()),
+ for (DependenciesLabelsDepSpec::ConstIterator it(real_ptr->begin()),
it_end(real_ptr->end()); it_end != it; ++it)
- rb_ary_push(result, dependency_label_to_value(*it));
+ rb_ary_push(result, dependencies_label_to_value(*it));
return result;
}
@@ -1098,7 +1098,7 @@ namespace
/*
* Document-class: Paludis::DepSpec
*
- * Base class for a dependency spec.
+ * Base class for a dependencies spec.
*/
c_dep_spec = rb_define_class_under(paludis_module(), "DepSpec", rb_cObject);
rb_funcall(c_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
@@ -1252,16 +1252,16 @@ namespace
rb_define_method(c_plain_text_dep_spec, "to_s", RUBY_FUNC_CAST(plain_text_dep_spec_to_s), 0);
/*
- * Document-class: Paludis::DependencyLabelsDepSpec
+ * Document-class: Paludis::DependenciesLabelsDepSpec
*
- * A DependencyLabelsDepSpec holds dependency labels.
+ * A DependenciesLabelsDepSpec holds dependencies labels.
*/
- c_dependency_labels_dep_spec = rb_define_class_under(paludis_module(), "DependencyLabelsDepSpec", c_string_dep_spec);
- rb_define_singleton_method(c_dependency_labels_dep_spec, "new", RUBY_FUNC_CAST(&DepSpecThings<DependencyLabelsDepSpec>::dep_spec_new_0), 0);
- rb_define_method(c_dependency_labels_dep_spec, "initialize", RUBY_FUNC_CAST(&dep_spec_init_0), 0);
- VALUE (* dependency_labels_dep_spec_to_s) (VALUE) = &dep_spec_to_s<DependencyLabelsDepSpec>;
- rb_define_method(c_dependency_labels_dep_spec, "to_s", RUBY_FUNC_CAST(dependency_labels_dep_spec_to_s), 0);
- rb_define_method(c_dependency_labels_dep_spec, "labels", RUBY_FUNC_CAST(&dependency_labels_dep_spec_labels), 0);
+ c_dependencies_labels_dep_spec = rb_define_class_under(paludis_module(), "DependenciesLabelsDepSpec", c_string_dep_spec);
+ rb_define_singleton_method(c_dependencies_labels_dep_spec, "new", RUBY_FUNC_CAST(&DepSpecThings<DependenciesLabelsDepSpec>::dep_spec_new_0), 0);
+ rb_define_method(c_dependencies_labels_dep_spec, "initialize", RUBY_FUNC_CAST(&dep_spec_init_0), 0);
+ VALUE (* dependencies_labels_dep_spec_to_s) (VALUE) = &dep_spec_to_s<DependenciesLabelsDepSpec>;
+ rb_define_method(c_dependencies_labels_dep_spec, "to_s", RUBY_FUNC_CAST(dependencies_labels_dep_spec_to_s), 0);
+ rb_define_method(c_dependencies_labels_dep_spec, "labels", RUBY_FUNC_CAST(&dependencies_labels_dep_spec_labels), 0);
/*
* Document-class: Paludis::URILabelsDepSpec
@@ -1363,18 +1363,18 @@ paludis::ruby::value_to_package_dep_spec(VALUE v)
}
}
-std::tr1::shared_ptr<const DependencyLabelsDepSpec>
-paludis::ruby::value_to_dependency_labels_dep_spec(VALUE v)
+std::tr1::shared_ptr<const DependenciesLabelsDepSpec>
+paludis::ruby::value_to_dependencies_labels_dep_spec(VALUE v)
{
- if (rb_obj_is_kind_of(v, c_dependency_labels_dep_spec))
+ if (rb_obj_is_kind_of(v, c_dependencies_labels_dep_spec))
{
std::tr1::shared_ptr<WrappedSpecBase> * v_ptr;
Data_Get_Struct(v, std::tr1::shared_ptr<WrappedSpecBase>, v_ptr);
- return std::tr1::static_pointer_cast<const WrappedSpec<DependencyLabelsDepSpec> >(*v_ptr)->spec();
+ return std::tr1::static_pointer_cast<const WrappedSpec<DependenciesLabelsDepSpec> >(*v_ptr)->spec();
}
else
{
- rb_raise(rb_eTypeError, "Can't convert %s into DependencyLabelsDepSpec", rb_obj_classname(v));
+ rb_raise(rb_eTypeError, "Can't convert %s into DependenciesLabelsDepSpec", rb_obj_classname(v));
}
}
@@ -1439,9 +1439,9 @@ paludis::ruby::dep_tree_to_value(const std::tr1::shared_ptr<const T_> & m)
}
VALUE *
-paludis::ruby::dependency_labels_dep_spec_value_ptr()
+paludis::ruby::dependencies_labels_dep_spec_value_ptr()
{
- return &c_dependency_labels_dep_spec;
+ return &c_dependencies_labels_dep_spec;
}
template VALUE paludis::ruby::dep_tree_to_value<SetSpecTree> (const std::tr1::shared_ptr<const SetSpecTree> &);
diff --git a/ruby/dep_spec_TEST.rb b/ruby/dep_spec_TEST.rb
index 5cbe074a3..968e9a7f9 100644
--- a/ruby/dep_spec_TEST.rb
+++ b/ruby/dep_spec_TEST.rb
@@ -414,13 +414,9 @@ module Paludis
def test_initial_labels
assert_kind_of Array, spec_key.initial_labels
- assert_kind_of DependencyBuildLabel, spec_key.initial_labels[0]
+ assert_kind_of DependenciesBuildLabel, spec_key.initial_labels[0]
assert_equal "DEPEND", spec_key.initial_labels[0].text
assert_equal "DEPEND", spec_key.initial_labels[0].to_s
-
- a = ActiveDependencyLabels.new spec_key.initial_labels
- assert_kind_of Array, a.type_labels
- assert_kind_of DependencyBuildLabel, a.type_labels[0]
end
end
end
diff --git a/ruby/metadata_key.cc b/ruby/metadata_key.cc
index 700e479a0..3305ae694 100644
--- a/ruby/metadata_key.cc
+++ b/ruby/metadata_key.cc
@@ -552,7 +552,7 @@ namespace
/*
* call-seq:
- * initial_labels -> Array of DependencyLabel
+ * initial_labels -> Array of DependenciesLabel
*
* Return the initial labels to use when deciding the behaviour of
* individual items in the heirarchy.
@@ -569,9 +569,9 @@ namespace
VALUE result(rb_ary_new());
- for (DependencyLabelSequence::ConstIterator it(real_self->initial_labels()->begin()),
+ for (DependenciesLabelSequence::ConstIterator it(real_self->initial_labels()->begin()),
it_end(real_self->initial_labels()->end()); it_end != it; ++it)
- rb_ary_push(result, dependency_label_to_value(*it));
+ rb_ary_push(result, dependencies_label_to_value(*it));
return result;
}
diff --git a/ruby/nice_names.nn b/ruby/nice_names.nn
index 0a9d0128b..d923538db 100644
--- a/ruby/nice_names.nn
+++ b/ruby/nice_names.nn
@@ -29,7 +29,7 @@ make_nn_NiceNames() {
name "StringDepSpec"
name "NamedSetDepSpec"
name "URILabelsDepSpec"
- name "DependencyLabelsDepSpec"
+ name "DependenciesLabelsDepSpec"
name "PlainTextLabelDepSpec"
# paludis/dep_tree-fwd.hh
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index 532225276..93f6d21b5 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -102,7 +102,7 @@ namespace paludis
template <typename T_> std::tr1::shared_ptr<const T_> value_to_dep_tree(VALUE);
VALUE package_dep_spec_to_value(const std::tr1::shared_ptr<const PackageDepSpec> &);
VALUE uri_label_to_value(const std::tr1::shared_ptr<const URILabel> &);
- VALUE dependency_label_to_value(const std::tr1::shared_ptr<const DependencyLabel> &);
+ VALUE dependencies_label_to_value(const std::tr1::shared_ptr<const DependenciesLabel> &);
VALUE mask_to_value(std::tr1::shared_ptr<const Mask>);
VALUE choices_to_value(const std::tr1::shared_ptr<const Choices> & c);
VALUE choice_to_value(const std::tr1::shared_ptr<const Choice> & c);
@@ -113,7 +113,7 @@ namespace paludis
VersionSpec value_to_version_spec(VALUE v);
std::tr1::shared_ptr<const PackageID> value_to_package_id(VALUE);
std::tr1::shared_ptr<const PackageDepSpec> value_to_package_dep_spec(VALUE v);
- std::tr1::shared_ptr<const DependencyLabelsDepSpec> value_to_dependency_labels_dep_spec(VALUE v);
+ std::tr1::shared_ptr<const DependenciesLabelsDepSpec> value_to_dependencies_labels_dep_spec(VALUE v);
std::tr1::shared_ptr<const DepSpec> value_to_dep_spec(VALUE v);
std::tr1::shared_ptr<const DepTag> value_to_dep_tag(VALUE v);
QualifiedPackageName value_to_qualified_package_name(VALUE v);
@@ -126,10 +126,9 @@ namespace paludis
std::tr1::shared_ptr<const Choices> value_to_choices(VALUE v);
std::tr1::shared_ptr<const Choice> value_to_choice(VALUE v);
std::tr1::shared_ptr<const ChoiceValue> value_to_choice_value(VALUE v);
- std::tr1::shared_ptr<const DependencyLabel> value_to_dependency_label(VALUE v);
+ std::tr1::shared_ptr<const DependenciesLabel> value_to_dependencies_label(VALUE v);
MatchPackageOptions value_to_match_package_options(VALUE v);
bool value_to_bool(VALUE v);
- std::tr1::shared_ptr<ActiveDependencyLabels> value_to_active_dependency_labels(VALUE v);
Filter value_to_filter(VALUE v);
Selection value_to_selection(VALUE v);
@@ -143,7 +142,7 @@ namespace paludis
VALUE * uninstall_action_value_ptr();
VALUE * pretend_action_value_ptr();
VALUE * pretend_fetch_action_value_ptr();
- VALUE * dependency_labels_dep_spec_value_ptr();
+ VALUE * dependencies_labels_dep_spec_value_ptr();
#ifdef ENABLE_RUBY_QA
QACheckProperties value_to_qa_check_properties(VALUE);