class Paludis::SlotExactPartialRequirement

An exact slot requirement (:slot)

Public Instance Methods

slot() click to toggle source
VALUE
    slot_exact_requirement_slot(VALUE self)
    {
        std::shared_ptr<const SlotExactPartialRequirement> * ptr;
        Data_Get_Struct(self, std::shared_ptr<const SlotExactPartialRequirement>, ptr);
        return rb_str_new2(stringify((*ptr)->slot()).c_str());
    }

    void do_register_dep_spec()
    {
        /*
         * Document-class: Paludis::DepSpec
         *
         * Base class for a dependencies spec.
         */
        c_dep_spec = rb_define_class_under(c_paludis_module, "DepSpec", rb_cObject);
        rb_funcall(c_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));

        /*
         * Document-class: Paludis::AllDepSpec
         *
         * Represents a ( first second third ) or top level group of dependency specs. Includes
         * Enumerable[http://www.ruby-doc.org/core/classes/Enumerable.html].
         */
        c_all_dep_spec = rb_define_class_under(c_paludis_module, "AllDepSpec", c_dep_spec);
        rb_funcall(c_all_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        rb_include_module(c_all_dep_spec, rb_mEnumerable);
        rb_define_method(c_all_dep_spec, "each", template_methods, 0);

        /*
         * Document-class: Paludis::AnyDepSpec
         *
         * Represents a "|| ( )" dependency block. Includes
         * Enumerable[http://www.ruby-doc.org/core/classes/Enumerable.html].
         */
        c_any_dep_spec = rb_define_class_under(c_paludis_module, "AnyDepSpec", c_dep_spec);
        rb_funcall(c_any_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        rb_include_module(c_any_dep_spec, rb_mEnumerable);
        rb_define_method(c_any_dep_spec, "each", template_methods, 0);

        /*
         * Document-class: Paludis::ExactlyOneDepSpec
         *
         * Represents a "^^ ( )" dependency block. Includes
         * Enumerable[http://www.ruby-doc.org/core/classes/Enumerable.html].
         */
        c_exactly_one_dep_spec = rb_define_class_under(c_paludis_module, "ExactlyOneDepSpec", c_dep_spec);
        rb_funcall(c_exactly_one_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        rb_include_module(c_exactly_one_dep_spec, rb_mEnumerable);
        rb_define_method(c_exactly_one_dep_spec, "each", template_methods, 0);

        /*
         * Document-class: Paludis::AtMostOneDepSpec
         *
         * Represents a "?? ( )" dependency block. Includes
         * Enumerable[http://www.ruby-doc.org/core/classes/Enumerable.html].
         */
        c_at_most_one = rb_define_class_under(c_paludis_module, "AtMostOneDepSpec", c_dep_spec);
        rb_funcall(c_at_most_one, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        rb_include_module(c_at_most_one, rb_mEnumerable);
        rb_define_method(c_at_most_one, "each", template_methods, 0);

        /*
         * Document-class: Paludis::ConditionalDepSpec
         *
         * Represents a use? ( ) dependency spec. Includes
         * Enumerable[http://www.ruby-doc.org/core/classes/Enumerable.html].
         */
        c_conditional_dep_spec = rb_define_class_under(c_paludis_module, "ConditionalDepSpec", c_dep_spec);
        rb_funcall(c_conditional_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        rb_include_module(c_conditional_dep_spec, rb_mEnumerable);
        /*
         * Document-method: condition
         *
         * call-seq:
         *     confition -> String
         *
         * Our condition
         */
        VALUE (* conditional_dep_spec_to_s) (VALUE) = &dep_spec_to_s<ConditionalDepSpec>;
        rb_define_method(c_conditional_dep_spec, "condition", conditional_dep_spec_to_s, 0);
        rb_define_alias(c_conditional_dep_spec, "to_s", "condition");
        rb_define_method(c_conditional_dep_spec, "condition_met?",                     template_methods, 2);
        rb_define_method(c_conditional_dep_spec, "condition_meetable?",                     template_methods, 2);
        rb_define_method(c_conditional_dep_spec, "each", template_methods, 0);

        /*
         * Document-class: Paludis::StringDepSpec
         *
         * A StringDepSpec represents a non-composite dep spec with an associated piece of text.
         */
        c_string_dep_spec = rb_define_class_under(c_paludis_module, "StringDepSpec", c_dep_spec);
        rb_funcall(c_string_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        rb_define_method(c_string_dep_spec, "text", string_dep_spec_text, 0);

        /*
         * Document-class: Paludis::FetchableURIDepSpec
         *
         * A FetchableURIDepSpec represents a fetchable URI spec.
         */
        c_fetchable_uri_dep_spec = rb_define_class_under(c_paludis_module, "FetchableURIDepSpec", c_string_dep_spec);
        rb_funcall(c_fetchable_uri_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        VALUE (* fetchable_uri_dep_spec_to_s) (VALUE) = &dep_spec_to_s<FetchableURIDepSpec>;
        rb_define_method(c_fetchable_uri_dep_spec, "to_s", fetchable_uri_dep_spec_to_s, 0);
        rb_define_method(c_fetchable_uri_dep_spec, "original_url",                template_methods, 0);
        rb_define_method(c_fetchable_uri_dep_spec, "renamed_url_suffix",                template_methods, 0);
        rb_define_method(c_fetchable_uri_dep_spec, "filename",                template_methods, 0);

        /*
         * Document-class: Paludis::SimpleURIDepSpec
         *
         * A SimpleURIDepSpec represents a simple URI spec.
         */
        c_simple_uri_dep_spec = rb_define_class_under(c_paludis_module, "SimpleURIDepSpec", c_string_dep_spec);
        rb_funcall(c_simple_uri_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        VALUE (* simple_uri_dep_spec_to_s) (VALUE) = &dep_spec_to_s<SimpleURIDepSpec>;
        rb_define_method(c_simple_uri_dep_spec, "to_s", simple_uri_dep_spec_to_s, 0);

        /*
         * Document-class: Paludis::LicenseDepSpec
         *
         * A LicenseDepSpec represents a license dep spec.
         */
        c_license_dep_spec = rb_define_class_under(c_paludis_module, "LicenseDepSpec", c_string_dep_spec);
        rb_funcall(c_license_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        VALUE (* license_dep_spec_to_s) (VALUE) = &dep_spec_to_s<LicenseDepSpec>;
        rb_define_method(c_license_dep_spec, "to_s", license_dep_spec_to_s, 0);

        /*
         * Document-class: Paludis::NamedSetDepSpec
         *
         * A NamedSetDepSpec represents a fetchable URI spec.
         */
        c_named_set_dep_spec = rb_define_class_under(c_paludis_module, "NamedSetDepSpec", c_string_dep_spec);
        rb_funcall(c_named_set_dep_spec, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        VALUE (* named_set_dep_spec_to_s) (VALUE) = &dep_spec_to_s<NamedSetDepSpec>;
        rb_define_method(c_named_set_dep_spec, "to_s", named_set_dep_spec_to_s, 0);
        rb_define_method(c_named_set_dep_spec, "name", named_set_dep_spec_name, 0);


        /*
         * Document-class: Paludis::PackageDepSpec
         *
         * A PackageDepSpec represents a package name (for example, 'app-editors/vim'),
         * possibly with associated version and SLOT restrictions. To create a PackageDepSpec,
         * use Paludis::parse_user_package_dep_spec.
         */
        c_package_dep_spec = rb_define_class_under(c_paludis_module, "PackageDepSpec", c_string_dep_spec);
        rb_define_method(c_package_dep_spec, "package", package_dep_spec_package, 0);
        rb_define_method(c_package_dep_spec, "package_name_part", package_dep_spec_package_name_part, 0);
        rb_define_method(c_package_dep_spec, "category_name_part", package_dep_spec_category_name_part, 0);
        rb_define_method(c_package_dep_spec, "slot_requirement", package_dep_spec_slot_requirement_ptr, 0);
        rb_define_method(c_package_dep_spec, "in_repository", package_dep_spec_in_repository_ptr, 0);
        rb_define_method(c_package_dep_spec, "from_repository", package_dep_spec_from_repository_ptr, 0);
        rb_define_method(c_package_dep_spec, "installable_to_repository", package_dep_spec_installable_to_repository, 0);
        rb_define_method(c_package_dep_spec, "installed_at_path", package_dep_spec_installed_at_path, 0);
        rb_define_method(c_package_dep_spec, "installable_to_path", package_dep_spec_installable_to_path, 0);
        rb_define_method(c_package_dep_spec, "version_requirements", package_dep_spec_version_requirements_ptr, 0);
        rb_define_method(c_package_dep_spec, "version_requirements_mode", package_dep_spec_version_requirements_mode, 0);
#ifdef CIARANM_REMOVED_THIS
        rb_define_method(c_package_dep_spec, "use_requirements", package_dep_spec_use_requirements, 0);
#endif
        VALUE (* package_dep_spec_to_s) (VALUE) = &dep_spec_to_s<PackageDepSpec>;
        rb_define_method(c_package_dep_spec, "to_s", package_dep_spec_to_s, 0);

        /*
         * Document-class: Paludis::PlainTextDepSpec
         *
         * A PlainTextDepSpec represents a plain text entry (for example, a URI in SRC_URI).
         */
        c_plain_text_dep_spec = rb_define_class_under(c_paludis_module, "PlainTextDepSpec", c_string_dep_spec);
        rb_define_singleton_method(c_plain_text_dep_spec, "new", template_methods, 1);
        rb_define_method(c_plain_text_dep_spec, "initialize", dep_spec_init_1, 1);
        VALUE (* plain_text_dep_spec_to_s) (VALUE) = &dep_spec_to_s<PlainTextDepSpec>;
        rb_define_method(c_plain_text_dep_spec, "to_s", plain_text_dep_spec_to_s, 0);

        /*
         * Document-class: Paludis::DependenciesLabelsDepSpec
         *
         * A DependenciesLabelsDepSpec holds dependencies labels.
         */
        c_dependencies_labels_dep_spec = rb_define_class_under(c_paludis_module, "DependenciesLabelsDepSpec", c_string_dep_spec);
        rb_define_singleton_method(c_dependencies_labels_dep_spec, "new", template_methods, 0);
        rb_define_method(c_dependencies_labels_dep_spec, "initialize", 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", dependencies_labels_dep_spec_to_s, 0);
        rb_define_method(c_dependencies_labels_dep_spec, "labels", dependencies_labels_dep_spec_labels, 0);

        /*
         * Document-class: Paludis::URILabelsDepSpec
         *
         * A URILabelsDepSpec holds URI labels.
         */
        c_uri_labels_dep_spec = rb_define_class_under(c_paludis_module, "URILabelsDepSpec", c_string_dep_spec);
        rb_define_singleton_method(c_uri_labels_dep_spec, "new", template_methods, 0);
        rb_define_method(c_uri_labels_dep_spec, "initialize", dep_spec_init_0, 0);
        VALUE (* uri_labels_dep_spec_to_s) (VALUE) = &dep_spec_to_s<URILabelsDepSpec>;
        rb_define_method(c_uri_labels_dep_spec, "to_s", uri_labels_dep_spec_to_s, 0);
        rb_define_method(c_uri_labels_dep_spec, "labels", uri_labels_dep_spec_labels, 0);

        /*
         * Document-class: Paludis::PlainTextLabelDepSpec
         *
         * A PlainTextLabelDepSpec holds a plain text label.
         */
        c_plain_text_label_dep_spec = rb_define_class_under(c_paludis_module, "PlainTextLabelDepSpec", c_string_dep_spec);
        rb_define_singleton_method(c_plain_text_label_dep_spec, "new", template_methods, 1);
        rb_define_method(c_plain_text_label_dep_spec, "initialize", dep_spec_init_1, 1);
        VALUE (* plain_text_dep_label_spec_to_s) (VALUE) = &dep_spec_to_s<PlainTextLabelDepSpec>;
        rb_define_method(c_plain_text_label_dep_spec, "to_s", plain_text_dep_label_spec_to_s, 0);

        /*
         * Document-class: Paludis::BlockDepSpec
         *
         * A BlockDepSpec represents a block on a package name (for example, 'app-editors/vim'), possibly with
         * associated version and SLOT restrictions.
         */
        c_block_dep_spec = rb_define_class_under(c_paludis_module, "BlockDepSpec", c_string_dep_spec);
        rb_define_singleton_method(c_block_dep_spec, "new", block_dep_spec_new, 2);
        rb_define_method(c_block_dep_spec, "initialize", dep_spec_init_1, 2);
        rb_define_method(c_block_dep_spec, "blocking", block_dep_spec_blocking, 0);
        VALUE (* block_dep_spec_to_s) (VALUE) = &dep_spec_to_s<BlockDepSpec>;
        rb_define_method(c_block_dep_spec, "to_s", block_dep_spec_to_s, 0);

        /*
         * Document-module: Paludis::VersionRequirementsMode
         *
         * What sort of VersionRequirements to we have.
         *
         */
        c_version_requirements_mode = rb_define_module_under(c_paludis_module, "VersionRequirementsMode");
        for (VersionRequirementsMode l(static_cast<VersionRequirementsMode>(0)), l_end(last_vr) ; l != l_end ;
                l = static_cast<VersionRequirementsMode>(static_cast<int>(l) + 1))
            rb_define_const(c_version_requirements_mode, value_case_to_RubyCase(stringify(l)).c_str(), INT2FIX(l));


        rb_define_module_function(c_paludis_module, "parse_user_package_dep_spec", paludis_parse_user_dep_spec, -1);

        /*
         * Document-class: Paludis::SlotRequirement
         *
         * A SlotRequirement
         */
        c_slot_requirement = rb_define_class_under(c_paludis_module, "SlotRequirement", rb_cObject);
        rb_funcall(c_slot_requirement, rb_intern("private_class_method"), 1, rb_str_new2("new"));
        rb_define_method(c_slot_requirement, "as_string", Common<std::shared_ptr<const SlotRequirement> >::to_s_via_ptr, 0);
        rb_define_method(c_slot_requirement, "to_s", Common<std::shared_ptr<const SlotRequirement> >::to_s_via_ptr, 0);

        /*
         * Document-class: Paludis::SlotExactPartialRequirement
         *
         * An exact slot requirement (:slot)
         */
        c_slot_exact_partial_requirement = rb_define_class_under(c_paludis_module, "SlotExactPartialRequirement", c_slot_requirement);
        rb_define_method(c_slot_exact_partial_requirement, "slot", slot_exact_requirement_slot, 0);

        /*
         * Document-class: Paludis::SlotExactFullRequirement
         *
         * An exact slot requirement (:slot/sub)
         */
        c_slot_exact_full_requirement = rb_define_class_under(c_paludis_module, "SlotExactFullRequirement", c_slot_requirement);

        /*
         * Document-class: Paludis::SlotAnyPartialLockedRequirement
         *
         * A partial locked slot requirement (:slot=)
         */
        c_slot_any_partial_locked_requirement = rb_define_class_under(c_paludis_module, "SlotAnyPartialLockedRequirement", c_slot_requirement);

        /*
         * Document-class: Paludis::SlotAnyAtAllLockedRequirement
         *
         * An any locked slot requirement (:=)
         */
        c_slot_any_at_all_locked_requirement = rb_define_class_under(c_paludis_module, "SlotAnyAtAllLockedRequirement", c_slot_requirement);

        /*
         * Document-class: Paludis::SlotAnyUnlockedRequirement
         *
         * An any unlocked slot requirement (:*)
         */
        c_slot_any_unlocked_requirement = rb_define_class_under(c_paludis_module, "SlotAnyUnlockedRequirement", c_slot_requirement);

        /*
         * Document-class: Paludis::SlotUnknownRewrittenRequirement
         *
         * An unknown rewritten slot requirement (either := or :slot=)
         */
        c_slot_unknown_rewritten_requirement = rb_define_class_under(c_paludis_module, "SlotUnknownRewrittenRequirement", c_slot_requirement);
    }
}