Module RbConfig
In: lib/facets/standard/facets/rbconfig.rb

An extended rendition of the Ruby‘s standard RbConfig module.

Methods

bsd?   datadir   host_os   inspect   linux?   mac?   method_missing   posix?   solaris?   symbian?   windows?  

Public Class methods

Return the path to the data directory associated with the given library/package name. Normally this is just

  "#{Config::CONFIG['datadir']}/#{name}"

but may be modified by tools like RubyGems to handle versioned data directories.

[Source]

# File lib/facets/standard/facets/rbconfig.rb, line 32
    def self.datadir(package_name)
      File.join(CONFIG['datadir'], package_name)
    end

[Source]

# File lib/facets/standard/facets/rbconfig.rb, line 38
  def self.host_os
    CONFIG['host_os']
  end

[Source]

# File lib/facets/standard/facets/rbconfig.rb, line 5
  def self.inspect
    CONFIG.inspect
  end

Methodized lookup of config.

[Source]

# File lib/facets/standard/facets/rbconfig.rb, line 10
  def self.method_missing(s,*a,&b)
    s = s.to_s
    if CONFIG.key?(s)
      CONFIG[s]
    elsif CONFIG.key?(s.upcase)
      CONFIG[s.upcase]
    else
      super(s,*a,&b)
    end
  end

Public Instance methods

[Source]

# File lib/facets/standard/facets/rbconfig.rb, line 50
  def bsd?
    host_os =~ /bsd/
  end

[Source]

# File lib/facets/standard/facets/rbconfig.rb, line 42
  def linux?
    host_os =~ /linux|cygwin/
  end

[Source]

# File lib/facets/standard/facets/rbconfig.rb, line 46
  def mac?
    host_os =~ /mac|darwin/
  end

[Source]

# File lib/facets/standard/facets/rbconfig.rb, line 68
  def posix?
    linux? or mac? or bsd? or solaris? or begin 
      fork do end
      true
    rescue NotImplementedError, NoMethodError
      false
    end
  end

[Source]

# File lib/facets/standard/facets/rbconfig.rb, line 58
  def solaris?
    host_os =~ /solaris|sunos/
  end

TODO: who knows what symbian returns?

[Source]

# File lib/facets/standard/facets/rbconfig.rb, line 63
  def symbian?
    host_os =~ /symbian/
  end

[Source]

# File lib/facets/standard/facets/rbconfig.rb, line 54
  def windows?
    host_os =~ /mswin|mingw/
  end

[Validate]