RbConfig is nice
ruby 1.9.3 RbConfig module makes getting system info nice!
File.join(*RbConfig::CONFIG.valuesat('bindir','RUBYINSTALLNAME'))
datadir = RbConfig::CONFIG['datadir']
os = RbConfig::CONFIG['hostos']
And more:
rbconfig = File.join(*RbConfig::CONFIG.keys)
Written by josh bowles
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Related Tags
#ruby
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#