class PkgConfig

Access to information from pkg-config(1)

Constants

ACTIONS

Attributes

name[R]

The module name

version[R]

The module version

Public Class Methods

new(name) click to toggle source

Create a PkgConfig object for the package name Raises PkgConfig::NotFound if the module does not exist

# File lib/autobuild/pkgconfig.rb, line 16
def initialize(name)
    if !system("pkg-config --exists #{name}")
        raise NotFound.new(name)
    end
    
    @name    = name
    @version = %xpkg-config --modversion #{name}`.chomp.strip
    @actions = Hash.new
    @variables = Hash.new
end

Public Instance Methods

method_missing(varname, *args, &proc) click to toggle source
Calls superclass method
# File lib/autobuild/pkgconfig.rb, line 35
def method_missing(varname, *args, &proc)
    if args.empty?
        @variables[varname] ||= %xpkg-config --variable=#{varname} #{name}`.chomp.strip
    else
        super(varname, *args, &proc)
    end
end