aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-06-01 17:50:40 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-06-01 17:50:40 +0000
commita80150dec9d6558a9940e6c2e89fe27ef273933b (patch)
treefbbdf4b6f9b1452847a8e1fb9cb5d9f09d84e771
parent5d02d3bf61e7f3007a7455b1d7ac1e50765829bb (diff)
downloadpaludis-a80150dec9d6558a9940e6c2e89fe27ef273933b.tar.gz
paludis-a80150dec9d6558a9940e6c2e89fe27ef273933b.tar.xz
(ruby) Add doc comments for new Selections, Filters and Generators.
-rw-r--r--python/filter.cc4
-rw-r--r--python/selection.cc10
-rw-r--r--ruby/filter.cc43
-rw-r--r--ruby/filtered_generator.cc25
-rw-r--r--ruby/generator.cc57
-rw-r--r--ruby/selection.cc46
6 files changed, 178 insertions, 7 deletions
diff --git a/python/filter.cc b/python/filter.cc
index d3a98b5..8795c55 100644
--- a/python/filter.cc
+++ b/python/filter.cc
@@ -67,7 +67,7 @@ void expose_filter()
bp::class_<filter::NotMasked, bp::bases<Filter> > filter_not_masked(
"NotMasked",
- "Accept not masked packages.",
+ "Accept unmasked packages.",
bp::init<>("__init__()")
);
@@ -79,7 +79,7 @@ void expose_filter()
bp::class_<filter::And, bp::bases<Filter> > filter_and(
"And",
- "Accept packages that match both filters",
+ "Accept packages that match both filters.",
bp::init<const Filter &, const Filter &>("__init__(filter, filter)")
);
diff --git a/python/selection.cc b/python/selection.cc
index 7c4fe39..61f700d 100644
--- a/python/selection.cc
+++ b/python/selection.cc
@@ -46,19 +46,19 @@ void expose_selection()
bp::class_<selection::SomeArbitraryVersion, bp::bases<Selection> > selection_some_arbitrary_version(
"SomeArbitraryVersion",
- "Select some arbitrary version.",
+ "Select some arbitrary version of some arbitrary package.",
bp::init<const FilteredGenerator &>("__init__(filtered_generator)")
);
bp::class_<selection::BestVersionOnly, bp::bases<Selection> > selection_best_version_only(
"BestVersionOnly",
- "Select the best version only.",
+ "Select the best version only of each package.",
bp::init<const FilteredGenerator &>("__init__(filtered_generator)")
);
bp::class_<selection::BestVersionInEachSlot, bp::bases<Selection> > selection_best_version_in_each_slot(
"BestVersionInEachSlot",
- "Select the best version in each slot.",
+ "Select the best version in each slot of each package.",
bp::init<const FilteredGenerator &>("__init__(filtered_generator)")
);
@@ -70,13 +70,13 @@ void expose_selection()
bp::class_<selection::AllVersionsGroupedBySlot, bp::bases<Selection> > selection_all_versions_grouped_by_slot(
"AllVersionsGroupedBySlot",
- "All versions grouped by slot.",
+ "Select all versions, sorted and grouped by slot.",
bp::init<const FilteredGenerator &>("__init__(filtered_generator)")
);
bp::class_<selection::AllVersionsUnsorted, bp::bases<Selection> > selection_all_versions_unsorted(
"AllVersionsUnsorted",
- "All versions, in no particular order.",
+ "Select all versions, in no particular order.",
bp::init<const FilteredGenerator &>("__init__(filtered_generator)")
);
diff --git a/ruby/filter.cc b/ruby/filter.cc
index af207ec..56feeb2 100644
--- a/ruby/filter.cc
+++ b/ruby/filter.cc
@@ -115,6 +115,13 @@ namespace
}
}
+ /*
+ * call-seq:
+ * new(class) -> Filter
+ *
+ * Create a Filter that accepts packages that support the
+ * specified Action subclass.
+ */
VALUE
filter_supports_action_new(VALUE self, VALUE action_class)
{
@@ -153,25 +160,61 @@ namespace
void do_register_filter()
{
+ /*
+ * Document-module: Paludis::Filter
+ *
+ * Collection of classes that restrict the results of an
+ * Environment selection.
+ */
c_filter_module = rb_define_module_under(paludis_module(), "Filter");
+ /*
+ * Document-class: Paludis::Filter::Filter
+ *
+ * Filter for an Environment selection.
+ */
c_filter = rb_define_class_under(c_filter_module, "Filter", rb_cObject);
rb_funcall(c_filter, rb_intern("private_class_method"), 1, rb_str_new2("new"));
rb_define_method(c_filter, "initialize", RUBY_FUNC_CAST(&filter_init), -1);
rb_define_method(c_filter, "to_s", RUBY_FUNC_CAST(&Common<Filter>::to_s), 0);
+ /*
+ * Document-class: Paludis::Filter::All
+ *
+ * Accept all packages.
+ */
c_filter_all = rb_define_class_under(c_filter_module, "All", c_filter);
rb_define_singleton_method(c_filter_all, "new", RUBY_FUNC_CAST(&filter_all_new), 0);
+ /*
+ * Document-class: Paludis::Filter::NotMasked
+ *
+ * Accept unmasked packages.
+ */
c_filter_not_masked = rb_define_class_under(c_filter_module, "NotMasked", c_filter);
rb_define_singleton_method(c_filter_not_masked, "new", RUBY_FUNC_CAST(&filter_not_masked_new), 0);
+ /*
+ * Document-class: Paludis::Filter::InstalledAtRoot
+ *
+ * Accept packages installed at a particular root.
+ */
c_filter_installed_at_root = rb_define_class_under(c_filter_module, "InstalledAtRoot", c_filter);
rb_define_singleton_method(c_filter_installed_at_root, "new", RUBY_FUNC_CAST(&filter_installed_at_root_new), 1);
+ /*
+ * Document-class: Paludis::Filter::And
+ *
+ * Accept packages that match both filters.
+ */
c_filter_and = rb_define_class_under(c_filter_module, "And", c_filter);
rb_define_singleton_method(c_filter_and, "new", RUBY_FUNC_CAST(&filter_and_new), 2);
+ /*
+ * Document-class: Paludis::Filter::SupportsAction
+ *
+ * Accept packages that support a particular Action.
+ */
c_filter_supports_action = rb_define_class_under(c_filter_module, "SupportsAction", c_filter);
rb_define_singleton_method(c_filter_supports_action, "new", RUBY_FUNC_CAST(&filter_supports_action_new), 1);
}
diff --git a/ruby/filtered_generator.cc b/ruby/filtered_generator.cc
index b2c4126..42c96b2 100644
--- a/ruby/filtered_generator.cc
+++ b/ruby/filtered_generator.cc
@@ -54,6 +54,14 @@ namespace
}
}
+ /*
+ * Document-method: |
+ *
+ * call-seq:
+ * |(filter) -> FilteredGenerator
+ *
+ * Add a new Filter.
+ */
VALUE
filtered_generator_bar(VALUE self, VALUE other)
{
@@ -71,6 +79,12 @@ namespace
}
}
+ /*
+ * call-seq:
+ * filter -> Filter
+ *
+ * Our Filter.
+ */
VALUE
filtered_generator_filter(VALUE self)
{
@@ -87,6 +101,12 @@ namespace
}
}
+ /*
+ * call-seq:
+ * generator -> Generator
+ *
+ * Our Generator.
+ */
VALUE
filtered_generator_generator(VALUE self)
{
@@ -105,6 +125,11 @@ namespace
void do_register_filtered_generator()
{
+ /*
+ * Document-class: Paludis::FilteredGenerator
+ *
+ * A combined Generator and Filter for an Environment selection.
+ */
c_filtered_generator = rb_define_class_under(paludis_module(), "FilteredGenerator", rb_cObject);
rb_define_singleton_method(c_filtered_generator, "new", RUBY_FUNC_CAST(&filtered_generator_new), 2);
rb_define_method(c_filtered_generator, "initialize", RUBY_FUNC_CAST(&filtered_generator_init), -1);
diff --git a/ruby/generator.cc b/ruby/generator.cc
index 405eabc..2e680c4 100644
--- a/ruby/generator.cc
+++ b/ruby/generator.cc
@@ -60,6 +60,14 @@ namespace
}
}
+ /*
+ * Document-method: &
+ *
+ * call-seq:
+ * &(other_generator) -> Generator
+ *
+ * Combine with another Generator using a set intersection.
+ */
VALUE
generator_ampersand(VALUE self, VALUE other)
{
@@ -77,6 +85,14 @@ namespace
}
}
+ /*
+ * Document-method: |
+ *
+ * call-seq:
+ * |(filter) -> FilteredGenerator
+ *
+ * Combine with a Filter to produce a FilteredGenerator.
+ */
VALUE
generator_bar(VALUE self, VALUE other)
{
@@ -228,8 +244,19 @@ namespace
void do_register_generator()
{
+ /*
+ * Document-module: Paludis::Generator
+ *
+ * Collection of classes that produce results for an
+ * Environment selection.
+ */
c_generator_module = rb_define_module_under(paludis_module(), "Generator");
+ /*
+ * Document-class: Paludis::Generator::Generator
+ *
+ * Generator for an Environment selection.
+ */
c_generator = rb_define_class_under(c_generator_module, "Generator", rb_cObject);
rb_funcall(c_generator, rb_intern("private_class_method"), 1, rb_str_new2("new"));
rb_define_method(c_generator, "initialize", RUBY_FUNC_CAST(&generator_init), -1);
@@ -237,21 +264,51 @@ namespace
rb_define_method(c_generator, "&", RUBY_FUNC_CAST(&generator_ampersand), 1);
rb_define_method(c_generator, "|", RUBY_FUNC_CAST(&generator_bar), 1);
+ /*
+ * Document-class: Paludis::Generator::All
+ *
+ * Generate all packages.
+ */
c_generator_all = rb_define_class_under(c_generator_module, "All", c_generator);
rb_define_singleton_method(c_generator_all, "new", RUBY_FUNC_CAST(&generator_all_new), 0);
+ /*
+ * Document-class: Paludis::Generator::Matches
+ *
+ * Generate matching packages.
+ */
c_generator_matches = rb_define_class_under(c_generator_module, "Matches", c_generator);
rb_define_singleton_method(c_generator_matches, "new", RUBY_FUNC_CAST(&generator_matches_new), 1);
+ /*
+ * Document-class: Paludis::Generator::Intersection
+ *
+ * Generate packages from the intersection of two other Generator instances.
+ */
c_generator_intersection = rb_define_class_under(c_generator_module, "Intersection", c_generator);
rb_define_singleton_method(c_generator_intersection, "new", RUBY_FUNC_CAST(&generator_intersection_new), 2);
+ /*
+ * Document-class: Paludis::Generator::Package
+ *
+ * Generate all named packages.
+ */
c_generator_package = rb_define_class_under(c_generator_module, "Package", c_generator);
rb_define_singleton_method(c_generator_package, "new", RUBY_FUNC_CAST(&generator_package_new), 1);
+ /*
+ * Document-class: Paludis::Generator::Category
+ *
+ * Generate all packages in a given category.
+ */
c_generator_category = rb_define_class_under(c_generator_module, "Category", c_generator);
rb_define_singleton_method(c_generator_category, "new", RUBY_FUNC_CAST(&generator_category_new), 1);
+ /*
+ * Document-class: Paludis::Generator::Repository
+ *
+ * Generate all packages in a given repository.
+ */
c_generator_repository = rb_define_class_under(c_generator_module, "Repository", c_generator);
rb_define_singleton_method(c_generator_repository, "new", RUBY_FUNC_CAST(&generator_repository_new), 1);
diff --git a/ruby/selection.cc b/ruby/selection.cc
index 2bcba71..0b98c2e 100644
--- a/ruby/selection.cc
+++ b/ruby/selection.cc
@@ -67,37 +67,83 @@ namespace
void do_register_selection()
{
+ /*
+ * Document-module: Paludis::Selection
+ *
+ * Collection of classes to sort and select the results for an
+ * Environment selection.
+ */
c_selection_module = rb_define_module_under(paludis_module(), "Selection");
+ /*
+ * Document-class: Paludis::Selection::Selection
+ *
+ * Selection for an Environment selection.
+ */
c_selection = rb_define_class_under(c_selection_module, "Selection", rb_cObject);
rb_funcall(c_selection, rb_intern("private_class_method"), 1, rb_str_new2("new"));
rb_define_method(c_selection, "initialize", RUBY_FUNC_CAST(&selection_init), -1);
rb_define_method(c_selection, "to_s", RUBY_FUNC_CAST(&Common<Selection>::to_s), 0);
+ /*
+ * Document-class: Paludis::Selection::SomeArbitraryVersion
+ *
+ * Select some arbitrary version of some arbitrary package.
+ */
c_selection_some_arbitrary_version = rb_define_class_under(c_selection_module, "SomeArbitraryVersion", c_selection);
rb_define_singleton_method(c_selection_some_arbitrary_version, "new",
RUBY_FUNC_CAST(&SelectionNew<selection::SomeArbitraryVersion>::selection_new), 1);
+ /*
+ * Document-class: Paludis::Selection::BestVersionOnly
+ *
+ * Select the best version only of each package.
+ */
c_selection_best_version_only = rb_define_class_under(c_selection_module, "BestVersionOnly", c_selection);
rb_define_singleton_method(c_selection_best_version_only, "new",
RUBY_FUNC_CAST(&SelectionNew<selection::BestVersionOnly>::selection_new), 1);
+ /*
+ * Document-class: Paludis::Selection::BestVersionInEachSlot
+ *
+ * Select the best version in each slot of each package.
+ */
c_selection_best_version_in_each_slot = rb_define_class_under(c_selection_module, "BestVersionInEachSlot", c_selection);
rb_define_singleton_method(c_selection_best_version_in_each_slot, "new",
RUBY_FUNC_CAST(&SelectionNew<selection::BestVersionInEachSlot>::selection_new), 1);
+ /*
+ * Document-class: Paludis::Selection::AllVersionsSorted
+ *
+ * Select all versions, sorted.
+ */
c_selection_all_versions_sorted = rb_define_class_under(c_selection_module, "AllVersionsSorted", c_selection);
rb_define_singleton_method(c_selection_all_versions_sorted, "new",
RUBY_FUNC_CAST(&SelectionNew<selection::AllVersionsSorted>::selection_new), 1);
+ /*
+ * Document-class: Paludis::Selection::AllVersionsGroupedBySlot
+ *
+ * Select all versions, sorted and grouped by slot.
+ */
c_selection_all_versions_grouped_by_slot = rb_define_class_under(c_selection_module, "AllVersionsGroupedBySlot", c_selection);
rb_define_singleton_method(c_selection_all_versions_grouped_by_slot, "new",
RUBY_FUNC_CAST(&SelectionNew<selection::AllVersionsGroupedBySlot>::selection_new), 1);
+ /*
+ * Document-class: Paludis::Selection::AllVersionsUnsorted
+ *
+ * Select all versions, in no particular order.
+ */
c_selection_all_versions_unsorted = rb_define_class_under(c_selection_module, "AllVersionsUnsorted", c_selection);
rb_define_singleton_method(c_selection_all_versions_unsorted, "new",
RUBY_FUNC_CAST(&SelectionNew<selection::AllVersionsUnsorted>::selection_new), 1);
+ /*
+ * Document-class: Paludis::Selection::RequireExactlyOne
+ *
+ * Require exactly one matching ID.
+ */
c_selection_require_exactly_one = rb_define_class_under(c_selection_module, "RequireExactlyOne", c_selection);
rb_define_singleton_method(c_selection_require_exactly_one, "new",
RUBY_FUNC_CAST(&SelectionNew<selection::RequireExactlyOne>::selection_new), 1);