aboutsummaryrefslogtreecommitdiff
path: root/ruby
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-07 14:15:31 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-07 14:15:31 +0100
commit5bca2928c8047c1d34e35d8c167a7a6644b2515a (patch)
treef89de8dc9aac885067abea62dc1f5e8fcb04eea9 /ruby
parent4eb9754117cf6d1fe9985fc1950ffbaf943fcafc (diff)
downloadpaludis-5bca2928c8047c1d34e35d8c167a7a6644b2515a.tar.gz
paludis-5bca2928c8047c1d34e35d8c167a7a6644b2515a.tar.xz
Constraint -> Requirement
Diffstat (limited to 'ruby')
-rw-r--r--ruby/dep_spec.cc124
-rw-r--r--ruby/dep_spec_TEST.rb94
-rw-r--r--ruby/generator_TEST.rb4
-rw-r--r--ruby/package_dep_spec_constraint.cc488
-rw-r--r--ruby/paludis_ruby.cc8
-rw-r--r--ruby/paludis_ruby.hh2
6 files changed, 360 insertions, 360 deletions
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index 7952976a8..09518ddf9 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -23,7 +23,7 @@
#include <paludis/dep_spec.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/version_operator.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence.hh>
@@ -527,82 +527,82 @@ namespace
/*
* call-seq:
- * package_name_constraint -> NameConstraint or Nil
+ * package_name_requirement -> NameRequirement or Nil
*
- * Fetch the package name constraint (may be Nil).
+ * Fetch the package name requirement (may be Nil).
*/
VALUE
- package_dep_spec_package_name_constraint(VALUE self)
+ package_dep_spec_package_name_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_requirement());
}
/*
* call-seq:
- * package_name_part_constraint -> PackageNamePartConstraint or Nil
+ * package_name_part_requirement -> PackageNamePartRequirement or Nil
*
- * Fetch the package name part constraint (may be Nil).
+ * Fetch the package name part requirement (may be Nil).
*/
VALUE
- package_dep_spec_package_name_part_constraint(VALUE self)
+ package_dep_spec_package_name_part_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_part_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_part_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_part_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->package_name_part_requirement());
}
/*
* call-seq:
- * category_name_part_constraint -> CategoryNamePartConstraint or Nil
+ * category_name_part_requirement -> CategoryNamePartRequirement or Nil
*
- * Fetch the category name part constraint (may be Nil).
+ * Fetch the category name part requirement (may be Nil).
*/
VALUE
- package_dep_spec_category_name_part_constraint(VALUE self)
+ package_dep_spec_category_name_part_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->category_name_part_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->category_name_part_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->category_name_part_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->category_name_part_requirement());
}
/*
* call-seq:
- * any_slot_constraint -> AnySlotConstraint or Nil
+ * any_slot_requirement -> AnySlotRequirement or Nil
*
- * Fetch the any-slot constraint (may be Nil).
+ * Fetch the any-slot requirement (may be Nil).
*/
VALUE
- package_dep_spec_any_slot_constraint(VALUE self)
+ package_dep_spec_any_slot_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->any_slot_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->any_slot_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->any_slot_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->any_slot_requirement());
}
/*
* call-seq:
- * exact_slot_constraint -> ExactSlotConstraint or Nil
+ * exact_slot_requirement -> ExactSlotRequirement or Nil
*
- * Fetch the exact-slot constraint (may be Nil).
+ * Fetch the exact-slot requirement (may be Nil).
*/
VALUE
- package_dep_spec_exact_slot_constraint(VALUE self)
+ package_dep_spec_exact_slot_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->exact_slot_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->exact_slot_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->exact_slot_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->exact_slot_requirement());
}
/*
@@ -635,85 +635,85 @@ namespace
/*
* call-seq:
- * in_repository_constraint -> InRepositoryConstraint or Nil
+ * in_repository_requirement -> InRepositoryRequirement or Nil
*
* Fetch the in-repository name.
*/
VALUE
- package_dep_spec_in_repository_constraint(VALUE self)
+ package_dep_spec_in_repository_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->in_repository_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->in_repository_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->in_repository_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->in_repository_requirement());
}
/*
* call-seq:
- * from_repository_constraint -> FromRepositoryConstraint or Nil
+ * from_repository_requirement -> FromRepositoryRequirement or Nil
*
- * Fetch the from-repository constraint.
+ * Fetch the from-repository requirement.
*/
VALUE
- package_dep_spec_from_repository_constraint(VALUE self)
+ package_dep_spec_from_repository_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->from_repository_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->from_repository_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->from_repository_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->from_repository_requirement());
}
/*
* call-seq:
- * installed_at_path_constraint ->
- * InstalledAtPathConstraint or Nil
+ * installed_at_path_requirement ->
+ * InstalledAtPathRequirement or Nil
*
* Fetch the installed-at-path requirement.
*/
VALUE
- package_dep_spec_installed_at_path_constraint(VALUE self)
+ package_dep_spec_installed_at_path_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installed_at_path_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installed_at_path_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installed_at_path_constraint());
+ return package_dep_spec_requirement_to_value(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installed_at_path_requirement());
}
/*
* call-seq:
- * installable_to_path_constraint -> InstallableToPathConstraint or Nil
+ * installable_to_path_requirement -> InstallableToPathRequirement or Nil
*
- * Fetch the installable-to-path constraint.
+ * Fetch the installable-to-path requirement.
*/
VALUE
- package_dep_spec_installable_to_path_constraint(VALUE self)
+ package_dep_spec_installable_to_path_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_path_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_path_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(
- std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_path_constraint());
+ return package_dep_spec_requirement_to_value(
+ std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_path_requirement());
}
/*
* call-seq:
- * installable_to_path_constraint -> InstallableToRepositoryConstraint or Nil
+ * installable_to_path_requirement -> InstallableToRepositoryRequirement or Nil
*
- * Fetch the installable-to-path constraint.
+ * Fetch the installable-to-path requirement.
*/
VALUE
- package_dep_spec_installable_to_repository_constraint(VALUE self)
+ package_dep_spec_installable_to_repository_requirement(VALUE self)
{
std::shared_ptr<WrappedSpecBase> * ptr;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, ptr);
- if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_repository_constraint()))
+ if (! bool(std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_repository_requirement()))
return Qnil;
- return package_dep_spec_constraint_to_value(
- std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_repository_constraint());
+ return package_dep_spec_requirement_to_value(
+ std::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(*ptr)->spec()->installable_to_repository_requirement());
}
#ifdef CIARANM_REMOVED_THIS
@@ -1018,16 +1018,16 @@ namespace
* use Paludis::parse_user_package_dep_spec.
*/
c_package_dep_spec = rb_define_class_under(paludis_module(), "PackageDepSpec", c_string_dep_spec);
- rb_define_method(c_package_dep_spec, "package_name_constraint", RUBY_FUNC_CAST(&package_dep_spec_package_name_constraint), 0);
- rb_define_method(c_package_dep_spec, "package_name_part_constraint", RUBY_FUNC_CAST(&package_dep_spec_package_name_part_constraint), 0);
- rb_define_method(c_package_dep_spec, "category_name_part_constraint", RUBY_FUNC_CAST(&package_dep_spec_category_name_part_constraint), 0);
- rb_define_method(c_package_dep_spec, "in_repository_constraint", RUBY_FUNC_CAST(&package_dep_spec_in_repository_constraint), 0);
- rb_define_method(c_package_dep_spec, "from_repository_constraint", RUBY_FUNC_CAST(&package_dep_spec_from_repository_constraint), 0);
- rb_define_method(c_package_dep_spec, "installable_to_repository_constraint", RUBY_FUNC_CAST(&package_dep_spec_installable_to_repository_constraint), 0);
- rb_define_method(c_package_dep_spec, "installed_at_path_constraint", RUBY_FUNC_CAST(&package_dep_spec_installed_at_path_constraint), 0);
- rb_define_method(c_package_dep_spec, "installable_to_path_constraint", RUBY_FUNC_CAST(&package_dep_spec_installable_to_path_constraint), 0);
- rb_define_method(c_package_dep_spec, "any_slot_constraint", RUBY_FUNC_CAST(&package_dep_spec_any_slot_constraint), 0);
- rb_define_method(c_package_dep_spec, "exact_slot_constraint", RUBY_FUNC_CAST(&package_dep_spec_exact_slot_constraint), 0);
+ rb_define_method(c_package_dep_spec, "package_name_requirement", RUBY_FUNC_CAST(&package_dep_spec_package_name_requirement), 0);
+ rb_define_method(c_package_dep_spec, "package_name_part_requirement", RUBY_FUNC_CAST(&package_dep_spec_package_name_part_requirement), 0);
+ rb_define_method(c_package_dep_spec, "category_name_part_requirement", RUBY_FUNC_CAST(&package_dep_spec_category_name_part_requirement), 0);
+ rb_define_method(c_package_dep_spec, "in_repository_requirement", RUBY_FUNC_CAST(&package_dep_spec_in_repository_requirement), 0);
+ rb_define_method(c_package_dep_spec, "from_repository_requirement", RUBY_FUNC_CAST(&package_dep_spec_from_repository_requirement), 0);
+ rb_define_method(c_package_dep_spec, "installable_to_repository_requirement", RUBY_FUNC_CAST(&package_dep_spec_installable_to_repository_requirement), 0);
+ rb_define_method(c_package_dep_spec, "installed_at_path_requirement", RUBY_FUNC_CAST(&package_dep_spec_installed_at_path_requirement), 0);
+ rb_define_method(c_package_dep_spec, "installable_to_path_requirement", RUBY_FUNC_CAST(&package_dep_spec_installable_to_path_requirement), 0);
+ rb_define_method(c_package_dep_spec, "any_slot_requirement", RUBY_FUNC_CAST(&package_dep_spec_any_slot_requirement), 0);
+ rb_define_method(c_package_dep_spec, "exact_slot_requirement", RUBY_FUNC_CAST(&package_dep_spec_exact_slot_requirement), 0);
#ifdef CIARANM_REMOVED_THIS
rb_define_method(c_package_dep_spec, "use_requirements", RUBY_FUNC_CAST(&package_dep_spec_use_requirements), 0);
#endif
diff --git a/ruby/dep_spec_TEST.rb b/ruby/dep_spec_TEST.rb
index d8bb8929e..21fc51956 100644
--- a/ruby/dep_spec_TEST.rb
+++ b/ruby/dep_spec_TEST.rb
@@ -130,77 +130,77 @@ module Paludis
end
def test_slot
- assert_equal "100", pda.exact_slot_constraint.name
- assert_nil pdb.exact_slot_constraint
- assert_nil pdc.exact_slot_constraint
- assert_nil pdd.exact_slot_constraint
- assert_nil pde.exact_slot_constraint
+ assert_equal "100", pda.exact_slot_requirement.name
+ assert_nil pdb.exact_slot_requirement
+ assert_nil pdc.exact_slot_requirement
+ assert_nil pdd.exact_slot_requirement
+ assert_nil pde.exact_slot_requirement
end
def test_package
- assert_equal QualifiedPackageName.new("foo/bar"), pda.package_name_constraint.name
- assert_nil pdb.package_name_constraint
- assert_equal QualifiedPackageName.new("foo/bar"), pdc.package_name_constraint.name
- assert_nil pdd.package_name_constraint
- assert_equal QualifiedPackageName.new("foo/bar"), pde.package_name_constraint.name
+ assert_equal QualifiedPackageName.new("foo/bar"), pda.package_name_requirement.name
+ assert_nil pdb.package_name_requirement
+ assert_equal QualifiedPackageName.new("foo/bar"), pdc.package_name_requirement.name
+ assert_nil pdd.package_name_requirement
+ assert_equal QualifiedPackageName.new("foo/bar"), pde.package_name_requirement.name
end
def test_from_repository
- assert_nil pda.from_repository_constraint
- assert_nil pdb.from_repository_constraint
- assert_nil pdc.from_repository_constraint
- assert_nil pdd.from_repository_constraint
- assert_equal "testrepo", pde.from_repository_constraint.name
+ assert_nil pda.from_repository_requirement
+ assert_nil pdb.from_repository_requirement
+ assert_nil pdc.from_repository_requirement
+ assert_nil pdd.from_repository_requirement
+ assert_equal "testrepo", pde.from_repository_requirement.name
end
def test_in_repository
- assert_equal "testrepo", pda.in_repository_constraint.name
- assert_nil pdb.in_repository_constraint
- assert_nil pdc.in_repository_constraint
- assert_nil pdd.in_repository_constraint
- assert_nil pde.in_repository_constraint
+ assert_equal "testrepo", pda.in_repository_requirement.name
+ assert_nil pdb.in_repository_requirement
+ assert_nil pdc.in_repository_requirement
+ assert_nil pdd.in_repository_requirement
+ assert_nil pde.in_repository_requirement
end
def test_installable_to_repository
- assert_nil pda.installable_to_repository_constraint
- assert_nil pdb.installable_to_repository_constraint
- assert_equal "installed", pdc.installable_to_repository_constraint.name
- assert ! pdc.installable_to_repository_constraint.include_masked?
- assert_nil pdd.installable_to_repository_constraint
- assert_nil pde.installable_to_repository_constraint
+ assert_nil pda.installable_to_repository_requirement
+ assert_nil pdb.installable_to_repository_requirement
+ assert_equal "installed", pdc.installable_to_repository_requirement.name
+ assert ! pdc.installable_to_repository_requirement.include_masked?
+ assert_nil pdd.installable_to_repository_requirement
+ assert_nil pde.installable_to_repository_requirement
end
def test_installed_at_path
- assert_nil pda.installed_at_path_constraint
- assert_nil pdb.installed_at_path_constraint
- assert_nil pdc.installed_at_path_constraint
- assert_nil pdd.installed_at_path_constraint
- assert_equal "/mychroot", pde.installed_at_path_constraint.path
+ assert_nil pda.installed_at_path_requirement
+ assert_nil pdb.installed_at_path_requirement
+ assert_nil pdc.installed_at_path_requirement
+ assert_nil pdd.installed_at_path_requirement
+ assert_equal "/mychroot", pde.installed_at_path_requirement.path
end
def test_installable_to_path
- assert_nil pda.installable_to_path_constraint
- assert_nil pdb.installable_to_path_constraint
- assert_nil pdc.installable_to_path_constraint
- assert_equal "/", pdd.installable_to_path_constraint.path
- assert pdd.installable_to_path_constraint.include_masked?
- assert_nil pde.installable_to_path_constraint
+ assert_nil pda.installable_to_path_requirement
+ assert_nil pdb.installable_to_path_requirement
+ assert_nil pdc.installable_to_path_requirement
+ assert_equal "/", pdd.installable_to_path_requirement.path
+ assert pdd.installable_to_path_requirement.include_masked?
+ assert_nil pde.installable_to_path_requirement
end
def test_package_name_part
- assert_nil pda.package_name_part_constraint
- assert_equal "bar", pdb.package_name_part_constraint.name_part
- assert_nil pdc.package_name_part_constraint
- assert_nil pdd.package_name_part_constraint
- assert_nil pde.package_name_part_constraint
+ assert_nil pda.package_name_part_requirement
+ assert_equal "bar", pdb.package_name_part_requirement.name_part
+ assert_nil pdc.package_name_part_requirement
+ assert_nil pdd.package_name_part_requirement
+ assert_nil pde.package_name_part_requirement
end
def test_category_name_part
- assert_nil pda.category_name_part_constraint
- assert_nil pdb.category_name_part_constraint
- assert_nil pdc.category_name_part_constraint
- assert_equal "foo", pdd.category_name_part_constraint.name_part
- assert_nil pde.category_name_part_constraint
+ assert_nil pda.category_name_part_requirement
+ assert_nil pdb.category_name_part_requirement
+ assert_nil pdc.category_name_part_requirement
+ assert_equal "foo", pdd.category_name_part_requirement.name_part
+ assert_nil pde.category_name_part_requirement
end
### def test_use_requirements
diff --git a/ruby/generator_TEST.rb b/ruby/generator_TEST.rb
index ffef5d0c3..9359a1418 100644
--- a/ruby/generator_TEST.rb
+++ b/ruby/generator_TEST.rb
@@ -59,8 +59,8 @@ module Paludis
assert_equal Generator::Matches.new(Paludis::parse_user_package_dep_spec("a/b", env, []), nil, []).to_s,
"packages matching a/b"
assert_equal Generator::Matches.new(Paludis::parse_user_package_dep_spec("a/b", env, []),
- nil, [:ignore_choice_constraints]).to_s,
- "packages matching a/b (ignoring choice constraints)"
+ nil, [:ignore_choice_requirements]).to_s,
+ "packages matching a/b (ignoring choice requirements)"
end
end
diff --git a/ruby/package_dep_spec_constraint.cc b/ruby/package_dep_spec_constraint.cc
index e06e957f2..4d18e5783 100644
--- a/ruby/package_dep_spec_constraint.cc
+++ b/ruby/package_dep_spec_constraint.cc
@@ -19,7 +19,7 @@
#include <paludis_ruby.hh>
-#include <paludis/package_dep_spec_constraint.hh>
+#include <paludis/package_dep_spec_requirement.hh>
#include <algorithm>
#include <list>
@@ -30,485 +30,485 @@ using namespace paludis::ruby;
namespace
{
- static VALUE c_package_dep_spec_constraint;
- static VALUE c_name_constraint;
- static VALUE c_package_name_part_constraint;
- static VALUE c_category_name_part_constraint;
- static VALUE c_version_constraint;
- static VALUE c_in_repository_constraint;
- static VALUE c_from_repository_constraint;
- static VALUE c_installed_at_path_constraint;
- static VALUE c_installable_to_path_constraint;
- static VALUE c_installable_to_repository_constraint;
- static VALUE c_any_slot_constraint;
- static VALUE c_exact_slot_constraint;
- static VALUE c_key_constraint;
- static VALUE c_choice_constraint;
-
- static VALUE c_key_constraint_operation;
+ static VALUE c_package_dep_spec_requirement;
+ static VALUE c_name_requirement;
+ static VALUE c_package_name_part_requirement;
+ static VALUE c_category_name_part_requirement;
+ static VALUE c_version_requirement;
+ static VALUE c_in_repository_requirement;
+ static VALUE c_from_repository_requirement;
+ static VALUE c_installed_at_path_requirement;
+ static VALUE c_installable_to_path_requirement;
+ static VALUE c_installable_to_repository_requirement;
+ static VALUE c_any_slot_requirement;
+ static VALUE c_exact_slot_requirement;
+ static VALUE c_key_requirement;
+ static VALUE c_choice_requirement;
+
+ static VALUE c_key_requirement_operation;
struct V
{
VALUE value;
- std::shared_ptr<const PackageDepSpecConstraint> mm;
+ std::shared_ptr<const PackageDepSpecRequirement> mm;
- V(const std::shared_ptr<const PackageDepSpecConstraint> & m) :
+ V(const std::shared_ptr<const PackageDepSpecRequirement> & m) :
mm(m)
{
}
- void visit(const NameConstraint &)
+ void visit(const NameRequirement &)
{
- value = Data_Wrap_Struct(c_name_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_name_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const CategoryNamePartConstraint &)
+ void visit(const CategoryNamePartRequirement &)
{
- value = Data_Wrap_Struct(c_category_name_part_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_category_name_part_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const PackageNamePartConstraint &)
+ void visit(const PackageNamePartRequirement &)
{
- value = Data_Wrap_Struct(c_package_name_part_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_package_name_part_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const VersionConstraint &)
+ void visit(const VersionRequirement &)
{
- value = Data_Wrap_Struct(c_version_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_version_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const InRepositoryConstraint &)
+ void visit(const InRepositoryRequirement &)
{
- value = Data_Wrap_Struct(c_in_repository_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_in_repository_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const FromRepositoryConstraint &)
+ void visit(const FromRepositoryRequirement &)
{
- value = Data_Wrap_Struct(c_from_repository_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_from_repository_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const InstalledAtPathConstraint &)
+ void visit(const InstalledAtPathRequirement &)
{
- value = Data_Wrap_Struct(c_installed_at_path_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_installed_at_path_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const InstallableToPathConstraint &)
+ void visit(const InstallableToPathRequirement &)
{
- value = Data_Wrap_Struct(c_installable_to_path_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_installable_to_path_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const InstallableToRepositoryConstraint &)
+ void visit(const InstallableToRepositoryRequirement &)
{
- value = Data_Wrap_Struct(c_installable_to_repository_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_installable_to_repository_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const AnySlotConstraint &)
+ void visit(const AnySlotRequirement &)
{
- value = Data_Wrap_Struct(c_any_slot_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_any_slot_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const ExactSlotConstraint &)
+ void visit(const ExactSlotRequirement &)
{
- value = Data_Wrap_Struct(c_exact_slot_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_exact_slot_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const KeyConstraint &)
+ void visit(const KeyRequirement &)
{
- value = Data_Wrap_Struct(c_key_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_key_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
- void visit(const ChoiceConstraint &)
+ void visit(const ChoiceRequirement &)
{
- value = Data_Wrap_Struct(c_choice_constraint, 0, &Common<std::shared_ptr<const PackageDepSpecConstraint> >::free,
- new std::shared_ptr<const PackageDepSpecConstraint>(mm));
+ value = Data_Wrap_Struct(c_choice_requirement, 0, &Common<std::shared_ptr<const PackageDepSpecRequirement> >::free,
+ new std::shared_ptr<const PackageDepSpecRequirement>(mm));
}
};
/*
* Document-method: name
*
- * The name constraint.
+ * The name requirement.
*/
static VALUE
- name_constraint_name(VALUE self)
+ name_requirement_name(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return qualified_package_name_to_value((std::static_pointer_cast<const NameConstraint>(*ptr))->name());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return qualified_package_name_to_value((std::static_pointer_cast<const NameRequirement>(*ptr))->name());
}
/*
* Document-method: name_part
*
- * The name part constraint.
+ * The name part requirement.
*/
static VALUE
- package_name_part_constraint_name_part(VALUE self)
+ package_name_part_requirement_name_part(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const PackageNamePartConstraint>(*ptr))->name_part()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const PackageNamePartRequirement>(*ptr))->name_part()).c_str());
}
/*
* Document-method: name_part
*
- * The name part constraint.
+ * The name part requirement.
*/
static VALUE
- category_name_part_constraint_name_part(VALUE self)
+ category_name_part_requirement_name_part(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const CategoryNamePartConstraint>(*ptr))->name_part()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const CategoryNamePartRequirement>(*ptr))->name_part()).c_str());
}
/*
* Document-method: name
*
- * The name constraint.
+ * The name requirement.
*/
static VALUE
- in_repository_constraint_name(VALUE self)
+ in_repository_requirement_name(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const InRepositoryConstraint>(*ptr))->name()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const InRepositoryRequirement>(*ptr))->name()).c_str());
}
/*
* Document-method: name
*
- * The name constraint.
+ * The name requirement.
*/
static VALUE
- from_repository_constraint_name(VALUE self)
+ from_repository_requirement_name(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const FromRepositoryConstraint>(*ptr))->name()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const FromRepositoryRequirement>(*ptr))->name()).c_str());
}
/*
* Document-method: path
*
- * The path constraint.
+ * The path requirement.
*/
static VALUE
- installed_at_path_constraint_path(VALUE self)
+ installed_at_path_requirement_path(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const InstalledAtPathConstraint>(*ptr))->path()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const InstalledAtPathRequirement>(*ptr))->path()).c_str());
}
/*
* Document-method: path
*
- * The path constraint.
+ * The path requirement.
*/
static VALUE
- installable_to_path_constraint_path(VALUE self)
+ installable_to_path_requirement_path(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const InstallableToPathConstraint>(*ptr))->path()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const InstallableToPathRequirement>(*ptr))->path()).c_str());
}
/*
* Document-method: include_masked?
*
- * The include-masked constraint.
+ * The include-masked requirement.
*/
static VALUE
- installable_to_path_constraint_include_masked(VALUE self)
+ installable_to_path_requirement_include_masked(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return (std::static_pointer_cast<const InstallableToPathConstraint>(*ptr))->include_masked() ? Qtrue : Qfalse;
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return (std::static_pointer_cast<const InstallableToPathRequirement>(*ptr))->include_masked() ? Qtrue : Qfalse;
}
/*
* Document-method: name
*
- * The name constraint.
+ * The name requirement.
*/
static VALUE
- installable_to_repository_constraint_name(VALUE self)
+ installable_to_repository_requirement_name(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const InstallableToRepositoryConstraint>(*ptr))->name()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const InstallableToRepositoryRequirement>(*ptr))->name()).c_str());
}
/*
* Document-method: include_masked?
*
- * The include-masked constraint.
+ * The include-masked requirement.
*/
static VALUE
- installable_to_repository_constraint_include_masked(VALUE self)
+ installable_to_repository_requirement_include_masked(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return (std::static_pointer_cast<const InstallableToRepositoryConstraint>(*ptr))->include_masked() ? Qtrue : Qfalse;
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return (std::static_pointer_cast<const InstallableToRepositoryRequirement>(*ptr))->include_masked() ? Qtrue : Qfalse;
}
/*
* Document-method: locking?
*
- * The locking constraint.
+ * The locking requirement.
*/
static VALUE
- any_slot_constraint_locking(VALUE self)
+ any_slot_requirement_locking(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return (std::static_pointer_cast<const AnySlotConstraint>(*ptr))->locking() ? Qtrue : Qfalse;
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return (std::static_pointer_cast<const AnySlotRequirement>(*ptr))->locking() ? Qtrue : Qfalse;
}
/*
* Document-method: locked?
*
- * The locked constraint.
+ * The locked requirement.
*/
static VALUE
- exact_slot_constraint_locked(VALUE self)
+ exact_slot_requirement_locked(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return (std::static_pointer_cast<const ExactSlotConstraint>(*ptr))->locked() ? Qtrue : Qfalse;
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return (std::static_pointer_cast<const ExactSlotRequirement>(*ptr))->locked() ? Qtrue : Qfalse;
}
/*
* Document-method: name
*
- * The name constraint.
+ * The name requirement.
*/
static VALUE
- exact_slot_constraint_name(VALUE self)
+ exact_slot_requirement_name(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const ExactSlotConstraint>(*ptr))->name()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const ExactSlotRequirement>(*ptr))->name()).c_str());
}
/*
* Document-method: key
*
- * The key constraint.
+ * The key requirement.
*/
static VALUE
- key_constraint_key(VALUE self)
+ key_requirement_key(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const KeyConstraint>(*ptr))->key()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const KeyRequirement>(*ptr))->key()).c_str());
}
/*
* Document-method: pattern
*
- * The pattern constraint.
+ * The pattern requirement.
*/
static VALUE
- key_constraint_pattern(VALUE self)
+ key_requirement_pattern(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return rb_str_new2(stringify((std::static_pointer_cast<const KeyConstraint>(*ptr))->pattern()).c_str());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return rb_str_new2(stringify((std::static_pointer_cast<const KeyRequirement>(*ptr))->pattern()).c_str());
}
/*
* Document-method: operation
*
- * The operation constraint.
+ * The operation requirement.
*/
static VALUE
- key_constraint_operation(VALUE self)
+ key_requirement_operation(VALUE self)
{
- std::shared_ptr<const PackageDepSpecConstraint> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecConstraint>, ptr);
- return INT2FIX((std::static_pointer_cast<const KeyConstraint>(*ptr))->operation());
+ std::shared_ptr<const PackageDepSpecRequirement> * ptr;
+ Data_Get_Struct(self, std::shared_ptr<const PackageDepSpecRequirement>, ptr);
+ return INT2FIX((std::static_pointer_cast<const KeyRequirement>(*ptr))->operation());
}
- void do_register_package_dep_spec_constraint()
+ void do_register_package_dep_spec_requirement()
{
/*
- * Document-class: Paludis::PackageDepSpecConstraint
+ * Document-class: Paludis::PackageDepSpecRequirement
*
- * Represents a constraint in a PackageDepSpec.
+ * Represents a requirement in a PackageDepSpec.
*/
- c_package_dep_spec_constraint = rb_define_class_under(paludis_module(), "PackageDepSpecConstraint", rb_cObject);
- rb_funcall(c_package_dep_spec_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ c_package_dep_spec_requirement = rb_define_class_under(paludis_module(), "PackageDepSpecRequirement", rb_cObject);
+ rb_funcall(c_package_dep_spec_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
/*
- * Document-class: Paludis::NameConstraint
+ * Document-class: Paludis::NameRequirement
*
- * Represents a cat/pkg name constraint in a PackageDepSpec.
+ * Represents a cat/pkg name requirement in a PackageDepSpec.
*/
- c_name_constraint = rb_define_class_under(
- paludis_module(), "NameConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_name_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_package_dep_spec_constraint, "name", RUBY_FUNC_CAST(&name_constraint_name), 0);
+ c_name_requirement = rb_define_class_under(
+ paludis_module(), "NameRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_name_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_package_dep_spec_requirement, "name", RUBY_FUNC_CAST(&name_requirement_name), 0);
/*
- * Document-class: Paludis::PackageNamePartConstraint
+ * Document-class: Paludis::PackageNamePartRequirement
*
- * Represents a /pkg name constraint in a PackageDepSpec.
+ * Represents a /pkg name requirement in a PackageDepSpec.
*/
- c_package_name_part_constraint = rb_define_class_under(
- paludis_module(), "PackageNamePartConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_package_name_part_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_package_name_part_constraint, "name_part", RUBY_FUNC_CAST(
- &package_name_part_constraint_name_part), 0);
+ c_package_name_part_requirement = rb_define_class_under(
+ paludis_module(), "PackageNamePartRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_package_name_part_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_package_name_part_requirement, "name_part", RUBY_FUNC_CAST(
+ &package_name_part_requirement_name_part), 0);
/*
- * Document-class: Paludis::CategoryNamePartConstraint
+ * Document-class: Paludis::CategoryNamePartRequirement
*
- * Represents a /pkg name constraint in a PackageDepSpec.
+ * Represents a /pkg name requirement in a PackageDepSpec.
*/
- c_category_name_part_constraint = rb_define_class_under(
- paludis_module(), "CategoryNamePartConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_category_name_part_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_category_name_part_constraint, "name_part", RUBY_FUNC_CAST(
- &category_name_part_constraint_name_part), 0);
+ c_category_name_part_requirement = rb_define_class_under(
+ paludis_module(), "CategoryNamePartRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_category_name_part_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_category_name_part_requirement, "name_part", RUBY_FUNC_CAST(
+ &category_name_part_requirement_name_part), 0);
/*
- * Document-class: Paludis::InRepositoryConstraint
+ * Document-class: Paludis::InRepositoryRequirement
*
- * Represents a /pkg name constraint in a PackageDepSpec.
+ * Represents a /pkg name requirement in a PackageDepSpec.
*/
- c_in_repository_constraint = rb_define_class_under(
- paludis_module(), "InRepositoryConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_in_repository_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_in_repository_constraint, "name", RUBY_FUNC_CAST(
- &in_repository_constraint_name), 0);
+ c_in_repository_requirement = rb_define_class_under(
+ paludis_module(), "InRepositoryRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_in_repository_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_in_repository_requirement, "name", RUBY_FUNC_CAST(
+ &in_repository_requirement_name), 0);
/*
- * Document-class: Paludis::FromRepositoryConstraint
+ * Document-class: Paludis::FromRepositoryRequirement
*
- * Represents a /pkg name constraint in a PackageDepSpec.
+ * Represents a /pkg name requirement in a PackageDepSpec.
*/
- c_from_repository_constraint = rb_define_class_under(
- paludis_module(), "InRepositoryConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_from_repository_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_from_repository_constraint, "name", RUBY_FUNC_CAST(
- &from_repository_constraint_name), 0);
+ c_from_repository_requirement = rb_define_class_under(
+ paludis_module(), "InRepositoryRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_from_repository_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_from_repository_requirement, "name", RUBY_FUNC_CAST(
+ &from_repository_requirement_name), 0);
/*
- * Document-class: Paludis::InstalledAtPathConstraint
+ * Document-class: Paludis::InstalledAtPathRequirement
*
- * Represents a ::/ path constraint in a PackageDepSpec.
+ * Represents a ::/ path requirement in a PackageDepSpec.
*/
- c_installed_at_path_constraint = rb_define_class_under(
- paludis_module(), "InRepositoryConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_installed_at_path_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_installed_at_path_constraint, "path", RUBY_FUNC_CAST(
- &installed_at_path_constraint_path), 0);
+ c_installed_at_path_requirement = rb_define_class_under(
+ paludis_module(), "InRepositoryRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_installed_at_path_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_installed_at_path_requirement, "path", RUBY_FUNC_CAST(
+ &installed_at_path_requirement_path), 0);
/*
- * Document-class: Paludis::InstallableToPathConstraint
+ * Document-class: Paludis::InstallableToPathRequirement
*
- * Represents a ::/? path constraint in a PackageDepSpec.
+ * Represents a ::/? path requirement in a PackageDepSpec.
*/
- c_installable_to_path_constraint = rb_define_class_under(
- paludis_module(), "InRepositoryConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_installable_to_path_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_installable_to_path_constraint, "path", RUBY_FUNC_CAST(
- &installable_to_path_constraint_path), 0);
- rb_define_method(c_installable_to_path_constraint, "include_masked?", RUBY_FUNC_CAST(
- &installable_to_path_constraint_include_masked), 0);
+ c_installable_to_path_requirement = rb_define_class_under(
+ paludis_module(), "InRepositoryRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_installable_to_path_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_installable_to_path_requirement, "path", RUBY_FUNC_CAST(
+ &installable_to_path_requirement_path), 0);
+ rb_define_method(c_installable_to_path_requirement, "include_masked?", RUBY_FUNC_CAST(
+ &installable_to_path_requirement_include_masked), 0);
/*
- * Document-class: Paludis::InstallableToRepositoryConstraint
+ * Document-class: Paludis::InstallableToRepositoryRequirement
*
- * Represents a ::repo? repository constraint in a PackageDepSpec.
+ * Represents a ::repo? repository requirement in a PackageDepSpec.
*/
- c_installable_to_repository_constraint = rb_define_class_under(
- paludis_module(), "InstallableToRepositoryConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_installable_to_repository_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_installable_to_repository_constraint, "name", RUBY_FUNC_CAST(
- &installable_to_repository_constraint_name), 0);
- rb_define_method(c_installable_to_repository_constraint, "include_masked?", RUBY_FUNC_CAST(
- &installable_to_repository_constraint_include_masked), 0);
+ c_installable_to_repository_requirement = rb_define_class_under(
+ paludis_module(), "InstallableToRepositoryRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_installable_to_repository_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_installable_to_repository_requirement, "name", RUBY_FUNC_CAST(
+ &installable_to_repository_requirement_name), 0);
+ rb_define_method(c_installable_to_repository_requirement, "include_masked?", RUBY_FUNC_CAST(
+ &installable_to_repository_requirement_include_masked), 0);
/*
- * Document-class: Paludis::AnySlotConstraint
+ * Document-class: Paludis::AnySlotRequirement
*
- * Represents a :* or := constraint in a PackageDepSpec.
+ * Represents a :* or := requirement in a PackageDepSpec.
*/
- c_any_slot_constraint = rb_define_class_under(
- paludis_module(), "AnySlotConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_any_slot_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_any_slot_constraint, "locking?", RUBY_FUNC_CAST(
- &any_slot_constraint_locking), 0);
+ c_any_slot_requirement = rb_define_class_under(
+ paludis_module(), "AnySlotRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_any_slot_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_any_slot_requirement, "locking?", RUBY_FUNC_CAST(
+ &any_slot_requirement_locking), 0);
/*
- * Document-class: Paludis::ExactSlotConstraint
+ * Document-class: Paludis::ExactSlotRequirement
*
- * Represents a :slot or :=slot constraint in a PackageDepSpec.
+ * Represents a :slot or :=slot requirement in a PackageDepSpec.
*/
- c_exact_slot_constraint = rb_define_class_under(
- paludis_module(), "ExactSlotConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_exact_slot_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_exact_slot_constraint, "locked?", RUBY_FUNC_CAST(
- &exact_slot_constraint_locked), 0);
- rb_define_method(c_exact_slot_constraint, "name", RUBY_FUNC_CAST(
- &exact_slot_constraint_name), 0);
+ c_exact_slot_requirement = rb_define_class_under(
+ paludis_module(), "ExactSlotRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_exact_slot_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_exact_slot_requirement, "locked?", RUBY_FUNC_CAST(
+ &exact_slot_requirement_locked), 0);
+ rb_define_method(c_exact_slot_requirement, "name", RUBY_FUNC_CAST(
+ &exact_slot_requirement_name), 0);
/*
- * Document-class: Paludis::KeyConstraint
+ * Document-class: Paludis::KeyRequirement
*
- * Represents a [.key=value] constraint in a PackageDepSpec.
+ * Represents a [.key=value] requirement in a PackageDepSpec.
*/
- c_key_constraint = rb_define_class_under(
- paludis_module(), "KeyConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_key_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_key_constraint, "key", RUBY_FUNC_CAST(
- &key_constraint_key), 0);
- rb_define_method(c_key_constraint, "pattern", RUBY_FUNC_CAST(
- &key_constraint_pattern), 0);
- rb_define_method(c_key_constraint, "operation", RUBY_FUNC_CAST(
- &key_constraint_operation), 0);
+ c_key_requirement = rb_define_class_under(
+ paludis_module(), "KeyRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_key_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ rb_define_method(c_key_requirement, "key", RUBY_FUNC_CAST(
+ &key_requirement_key), 0);
+ rb_define_method(c_key_requirement, "pattern", RUBY_FUNC_CAST(
+ &key_requirement_pattern), 0);
+ rb_define_method(c_key_requirement, "operation", RUBY_FUNC_CAST(
+ &key_requirement_operation), 0);
/*
- * Document-module: Paludis::KeyConstraintOperation
+ * Document-module: Paludis::KeyRequirementOperation
*
- * The operation for a KeyConstraint.
+ * The operation for a KeyRequirement.
*/
- c_key_constraint_operation = rb_define_module_under(paludis_module(), "KeyConstraintOperation");
- for (KeyConstraintOperation l(static_cast<KeyConstraintOperation>(0)), l_end(last_kco) ; l != l_end ;
- l = static_cast<KeyConstraintOperation>(static_cast<int>(l) + 1))
- rb_define_const(c_key_constraint_operation, value_case_to_RubyCase(stringify(l)).c_str(), INT2FIX(l));
+ c_key_requirement_operation = rb_define_module_under(paludis_module(), "KeyRequirementOperation");
+ for (KeyRequirementOperation l(static_cast<KeyRequirementOperation>(0)), l_end(last_kro) ; l != l_end ;
+ l = static_cast<KeyRequirementOperation>(static_cast<int>(l) + 1))
+ rb_define_const(c_key_requirement_operation, value_case_to_RubyCase(stringify(l)).c_str(), INT2FIX(l));
- // cc_enum_special<paludis/package_dep_spec_constraint-se.hh, KeyConstraint, c_key_constraint_operation>
+ // cc_enum_special<paludis/package_dep_spec_requirement-se.hh, KeyRequirement, c_key_requirement_operation>
/*
- * Document-class: Paludis::ChoiceConstraint
+ * Document-class: Paludis::ChoiceRequirement
*
- * Represents a [flag] constraint in a PackageDepSpec.
+ * Represents a [flag] requirement in a PackageDepSpec.
*/
- c_choice_constraint = rb_define_class_under(
- paludis_module(), "KeyConstraint", c_package_dep_spec_constraint);
- rb_funcall(c_choice_constraint, rb_intern("private_class_method"), 1, rb_str_new2("new"));
+ c_choice_requirement = rb_define_class_under(
+ paludis_module(), "KeyRequirement", c_package_dep_spec_requirement);
+ rb_funcall(c_choice_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
}
}
VALUE
-paludis::ruby::package_dep_spec_constraint_to_value(const std::shared_ptr<const PackageDepSpecConstraint> & m)
+paludis::ruby::package_dep_spec_requirement_to_value(const std::shared_ptr<const PackageDepSpecRequirement> & m)
{
try
{
@@ -522,6 +522,6 @@ paludis::ruby::package_dep_spec_constraint_to_value(const std::shared_ptr<const
}
}
-RegisterRubyClass::Register paludis_ruby_register_package_dep_spec_constraint PALUDIS_ATTRIBUTE((used))
- (&do_register_package_dep_spec_constraint);
+RegisterRubyClass::Register paludis_ruby_register_package_dep_spec_requirement PALUDIS_ATTRIBUTE((used))
+ (&do_register_package_dep_spec_requirement);
diff --git a/ruby/paludis_ruby.cc b/ruby/paludis_ruby.cc
index 7ce44f23b..4900726df 100644
--- a/ruby/paludis_ruby.cc
+++ b/ruby/paludis_ruby.cc
@@ -384,8 +384,8 @@ paludis::ruby::value_to_match_package_options(VALUE v)
{
VALUE entry(rb_ary_entry(v, i));
Check_Type(entry, T_SYMBOL);
- if (SYM2ID(entry) == rb_intern("ignore_choice_constraints"))
- o += mpo_ignore_choice_constraints;
+ if (SYM2ID(entry) == rb_intern("ignore_choice_requirements"))
+ o += mpo_ignore_choice_requirements;
else
rb_raise(rb_eArgError, "Unknown MatchPackageOptions option '%s'", rb_obj_as_string(entry));
}
@@ -396,8 +396,8 @@ VALUE
paludis::ruby::match_package_options_to_value(const MatchPackageOptions & o)
{
VALUE a(rb_ary_new());
- if (o[mpo_ignore_choice_constraints])
- rb_ary_push(a, ID2SYM(rb_intern("ignore_choice_constraints")));
+ if (o[mpo_ignore_choice_requirements])
+ rb_ary_push(a, ID2SYM(rb_intern("ignore_choice_requirements")));
return a;
}
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index 53d98b490..0e2eb4636 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -105,7 +105,7 @@ namespace paludis
VALUE choice_value_to_value(const std::shared_ptr<const ChoiceValue> & c);
VALUE match_package_options_to_value(const MatchPackageOptions & c);
VALUE bool_to_value(bool b);
- VALUE package_dep_spec_constraint_to_value(const std::shared_ptr<const PackageDepSpecConstraint> &);
+ VALUE package_dep_spec_requirement_to_value(const std::shared_ptr<const PackageDepSpecRequirement> &);
VersionSpec value_to_version_spec(VALUE v);
std::shared_ptr<const PackageID> value_to_package_id(VALUE, bool nil_ok = false);