Browse files

Merge branch 'OHAI-190'

  • Loading branch information...
2 parents 4b76586 + 8cfed49 commit 1af80784d128dbc9dd7cd73d928259fada13f181 @danielsdeleo danielsdeleo committed May 11, 2010
View
5 bin/ohai
@@ -19,16 +19,17 @@
# limitations under the License.
#
-require 'rubygems'
-$: << File.join(File.dirname(__FILE__), "..", "lib")
begin
require 'rubygems'
rescue LoadError
# must be debian! ;)
missing_rubygems = true
end
begin
+ # if we're in a source code checkout, we want to run the code from that.
+ # have to do this *after* rubygems is loaded.
+ $:.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
require 'ohai/application'
rescue LoadError
if missing_rubygems
View
3 lib/ohai.rb
@@ -16,9 +16,6 @@
# limitations under the License.
#
-$:.unshift(File.dirname(__FILE__)) unless
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
-
require 'ohai/config'
require 'ohai/system'
View
5 lib/ohai/plugins/chef.rb
@@ -19,5 +19,6 @@
require 'chef'
provides "chef"
-chef Mash.new
-chef[:version] = Chef::VERSION
+self[:chef_packages] = Mash.new unless self[:chef_packages]
+self[:chef_packages][:chef] = Mash.new
+self[:chef_packages][:chef][:version] = Chef::VERSION
View
5 lib/ohai/plugins/ohai.rb
@@ -19,5 +19,6 @@
require "ohai"
provides "ohai"
-self[:ohai] = Mash.new
-self[:ohai][:version] = Ohai::VERSION
+self[:chef_packages] = Mash.new unless self[:chef_packages]
+self[:chef_packages][:ohai] = Mash.new
+self[:chef_packages][:ohai][:version] = Ohai::VERSION
View
4 spec/ohai/plugins/chef_spec.rb
@@ -28,9 +28,9 @@
@ohai.stub!(:require_plugin).and_return(true)
end
- it "should set chef[:version] to the current chef version" do
+ it "should set [:chef_packages][:chef][:version] to the current chef version" do
@ohai._require_plugin("chef")
- @ohai[:chef][:version].should == Chef::VERSION
+ @ohai[:chef_packages][:chef][:version].should == Chef::VERSION
end
end
rescue LoadError
View
2 spec/ohai/plugins/groovy_spec.rb
@@ -17,7 +17,7 @@
#
-require File.join(File.dirname(__FILE__), '..', '..', '/spec_helper.rb')
+require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '/spec_helper.rb'))
describe Ohai::System, "plugin groovy" do
View
2 spec/ohai/plugins/lua_spec.rb
@@ -17,7 +17,7 @@
#
-require File.join(File.dirname(__FILE__), '..', '..', '/spec_helper.rb')
+require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '/spec_helper.rb'))
describe Ohai::System, "plugin lua" do
View
2 spec/ohai/plugins/mono_spec.rb
@@ -17,7 +17,7 @@
#
-require File.join(File.dirname(__FILE__), '..', '..', '/spec_helper.rb')
+require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '/spec_helper.rb'))
describe Ohai::System, "plugin mono" do
View
4 spec/ohai/plugins/ohai_spec.rb
@@ -26,8 +26,8 @@
@ohai.stub!(:require_plugin).and_return(true)
end
- it "should set ohai[:version] to the current version" do
+ it "should set [:chef_packages][:ohai][:version] to the current version" do
@ohai._require_plugin("ohai")
- @ohai[:ohai][:version].should == Ohai::VERSION
+ @ohai[:chef_packages][:ohai][:version].should == Ohai::VERSION
end
end
View
2 spec/ohai/plugins/php_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.join(File.dirname(__FILE__), '..', '..', '/spec_helper.rb')
+require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '/spec_helper.rb'))
describe Ohai::System, "plugin php" do

1 comment on commit 1af8078

@veszig

yay \o/ thanks for this!

Please sign in to comment.