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.rc20 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc19 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc18 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc17 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc16 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc15 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc14 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc13 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc12 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc11 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc10 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc9 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc8 lib/autoproj/metapackage.rb
autoproj-2.0.0.rc6 lib/autoproj/metapackage.rb
autoproj-1.13.3 lib/autoproj/metapackage.rb
autoproj-1.13.3.b2 lib/autoproj/metapackage.rb
autoproj-1.13.3.b1 lib/autoproj/metapackage.rb
autoproj-1.13.2.b4 lib/autoproj/metapackage.rb
autoproj-1.13.2.b3 lib/autoproj/metapackage.rb
autoproj-1.13.2.b2 lib/autoproj/metapackage.rb