Permalink
Browse files

Fix ruby warnings Config => RbConfig

Fixes warnings like:
  spec/unit/plugins/ruby_spec.rb:44:in `block in <top (required)>': Use
  RbConfig instead of obsolete and deprecated Config.

RbConfig is available at least as far back as 1.8.7.
  • Loading branch information...
1 parent cd2bc2e commit 56ad0cbd658a6ab0bd958b4f9e976bff1b8f3a48 @danielsdeleo danielsdeleo committed Jul 12, 2013
Showing with 11 additions and 11 deletions.
  1. +11 −11 spec/unit/plugins/ruby_spec.rb
@@ -19,7 +19,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
-ruby_bin = File.join(::Config::CONFIG['bindir'], ::Config::CONFIG['ruby_install_name'])
+ruby_bin = File.join(::RbConfig::CONFIG['bindir'], ::RbConfig::CONFIG['ruby_install_name'])
describe Ohai::System, "plugin ruby" do
@@ -41,16 +41,16 @@
:platform => RUBY_PLATFORM,
:version => RUBY_VERSION,
:release_date => RUBY_RELEASE_DATE,
- :target => ::Config::CONFIG['target'],
- :target_cpu => ::Config::CONFIG['target_cpu'],
- :target_vendor => ::Config::CONFIG['target_vendor'],
- :target_os => ::Config::CONFIG['target_os'],
- :host => ::Config::CONFIG['host'],
- :host_cpu => ::Config::CONFIG['host_cpu'],
- :host_os => ::Config::CONFIG['host_os'],
- :host_vendor => ::Config::CONFIG['host_vendor'],
- :gems_dir => %x{#{ruby_bin} #{::Config::CONFIG['bindir']}/gem env gemdir}.chomp!,
- :gem_bin => [ ::Gem.default_exec_format % 'gem', 'gem' ].map{|bin| "#{::Config::CONFIG['bindir']}/#{bin}"
+ :target => ::RbConfig::CONFIG['target'],
+ :target_cpu => ::RbConfig::CONFIG['target_cpu'],
+ :target_vendor => ::RbConfig::CONFIG['target_vendor'],
+ :target_os => ::RbConfig::CONFIG['target_os'],
+ :host => ::RbConfig::CONFIG['host'],
+ :host_cpu => ::RbConfig::CONFIG['host_cpu'],
+ :host_os => ::RbConfig::CONFIG['host_os'],
+ :host_vendor => ::RbConfig::CONFIG['host_vendor'],
+ :gems_dir => %x{#{ruby_bin} #{::RbConfig::CONFIG['bindir']}/gem env gemdir}.chomp!,
+ :gem_bin => [ ::Gem.default_exec_format % 'gem', 'gem' ].map{|bin| "#{::RbConfig::CONFIG['bindir']}/#{bin}"
}.find{|bin| ::File.exists? bin},
:ruby_bin => ruby_bin
}.each do |attribute, value|

0 comments on commit 56ad0cb

Please sign in to comment.