class PkgConfig
Access to information from pkg-config(1)
Constants
- ACTIONS
Attributes
The module name
The module version
Public Class Methods
Source
# File lib/autobuild/pkgconfig.rb, line 23 def initialize(name) unless system("pkg-config --exists #{name}") raise NotFound.new(name), "pkg-config package '#{name}' not found" end @name = name @version = `pkg-config --modversion #{name}`.chomp.strip @actions = Hash.new @variables = Hash.new end
Create a PkgConfig
object for the package name
Raises PkgConfig::NotFound
if the module does not exist
Public Instance Methods
Source
# File lib/autobuild/pkgconfig.rb, line 46 def method_missing(varname, *args, &proc) if args.empty? unless (value = @variables[varname]) value = `pkg-config --variable=#{varname} #{name}`.chomp.strip @variables[varname] = value end return value end super end
Calls superclass method
Source
# File lib/autobuild/pkgconfig.rb, line 42 def respond_to_missing?(varname, _include_all) varname =~ /^\w+$/ end