Sha256: c448e57e0f35945981c128a985e962ef3f1aa0c6e4ee857ccb32b92da2b31bc2

Contents?: true

Size: 1.53 KB

Versions: 115

Compression:

Stored size: 1.53 KB

Contents

module Autoproj
    # A set of packages that can be referred to by name
    class Metapackage
        # The metapackage name
        attr_reader :name
        # The packages listed in this metapackage
        attr_reader :packages
        # The normal dependency handling behaviour is to generate an error if a
        # metapackage is selected for the build but some of its dependencies
        # cannot be built. This modifies the behaviour to simply ignore the
        # problematic packages.
        attr_writer :weak_dependencies

        # @return [Boolean] whether the dependencies from this metapackage are
        #   weak or not
        # @see #weak_dependencies
        def weak_dependencies?
            !!@weak_dependencies
        end

        def initialize(name)
            @name = name
            @packages = []
            @weak_dependencies = false
        end

        # Adds a package to this metapackage
        #
        # @param [Autobuild::Package] pkg
        def add(pkg)
            @packages << pkg
        end

        # Lists the packages contained in this metapackage
        #
        # @yieldparam [Autobuild::Package] pkg
        def each_package(&block)
            @packages.each(&block)
        end

        # Tests if the given package is included in this metapackage
        #
        # @param [String,#name] pkg the package or package name
        def include?(pkg)
            if !pkg.respond_to?(:to_str)
                pkg = pkg.name
            end
            @packages.any? { |p| p.name == pkg }
        end
    end
end

Version data entries

115 entries across 115 versions & 1 rubygems

Version Path
autoproj-2.0.0.rc37 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc36 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc35 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc34 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc33 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc32 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc31 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc30 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc29 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc28 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc27 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc26 lib/autoproj/metapackage.rb
autoproj-1.13.5 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc25 lib/autoproj/metapackage.rb
autoproj-1.13.5.rc1 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc24 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc23 lib/autoproj/metapackage.rb
autoproj-1.13.4 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc22 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc21 lib/autoproj/metapackage.rb