Sha256: bdb179af8c2f399780abd79200ddb1e655d83df57169b2bf5f68edf6f70e6b02

Contents?: true

Size: 613 Bytes

Versions: 9

Compression:

Stored size: 613 Bytes

Contents

module Autobuild
    ## Adds an element to a path-like variable
    def self.pathvar(path, varname)
        if File.directory?(path)
            oldpath = ENV[varname]
            if oldpath.nil? || oldpath.empty?
                ENV[varname] = path
            else
                ENV[varname] = "#{path}:#{oldpath}"
            end
        end
    end

    ## Updates the environment when a new prefix has been added
    # TODO: modularize that
    def self.update_environment(newprefix)
        pathvar("#{newprefix}/bin", 'PATH')
        pathvar("#{newprefix}/lib/pkgconfig", 'PKG_CONFIG_PATH')
    end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
autobuild-0.6.4 lib/autobuild/environment.rb
autobuild-0.6.2 lib/autobuild/environment.rb
autobuild-0.6.3 lib/autobuild/environment.rb
autobuild-0.6.5 lib/autobuild/environment.rb
autobuild-0.6.6 lib/autobuild/environment.rb
autobuild-1.0 lib/autobuild/environment.rb
autobuild-0.6 lib/autobuild/environment.rb
autobuild-0.6.7 lib/autobuild/environment.rb
autobuild-1.0.1 lib/autobuild/environment.rb