summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-01-14 10:33:16 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2015-01-14 10:33:16 -0800
commit0ae1530e8aba00144aeb22581776df39420e5199 (patch)
treef8a80958023cfee2cae2c14ac7b9acfe51636b5d
parent2fa5d97b59f4807a0f04366ad8e3a573685848ea (diff)
parent60cc3bc7e6aa5465275f51efe3418c879ca44599 (diff)
downloadohai-0ae1530e8aba00144aeb22581776df39420e5199.tar.gz
Merge pull request #461 from opscode/jdm/json-backport
remove ffi_yajl monkeypatching
-rw-r--r--.travis.yml5
-rw-r--r--Gemfile4
-rw-r--r--lib/ohai/hints.rb2
-rw-r--r--lib/ohai/system.rb2
-rw-r--r--ohai.gemspec2
-rw-r--r--platform_simulation_specs/plugins/erlang_spec.rb1
-rw-r--r--spec/unit/plugins/erlang_spec.rb13
-rw-r--r--spec/unit/plugins/php_spec.rb1
8 files changed, 16 insertions, 14 deletions
diff --git a/.travis.yml b/.travis.yml
index bf2a4b83..61a1498c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,7 +8,7 @@
#
# This workaround should be removed when that fix is released.
before_install:
- - gem update --system 2.1.11
+ - gem update --system
- gem --version
rvm:
@@ -16,4 +16,7 @@ rvm:
- 1.9.2
- 1.9.3
+git:
+ depth: 200
+
script: bundle exec rake spec
diff --git a/Gemfile b/Gemfile
index a0982b6a..fa7293c9 100644
--- a/Gemfile
+++ b/Gemfile
@@ -8,6 +8,10 @@ gemspec
gem "rspec_junit_formatter", :git => 'git://github.com/sj26/rspec_junit_formatter.git',
:ref => "147836c41fab23ff7b92806f34122c8e5f2ddcad"
+if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("1.9.3")
+ gem "mixlib-shellout", "~> 1.4.0"
+end
+
group :development do
gem "sigar", :platform => "ruby"
diff --git a/lib/ohai/hints.rb b/lib/ohai/hints.rb
index fc2af32d..c8b0bc1b 100644
--- a/lib/ohai/hints.rb
+++ b/lib/ohai/hints.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-require 'ffi_yajl/json_gem'
+require 'ffi_yajl'
module Ohai
module Hints
diff --git a/lib/ohai/system.rb b/lib/ohai/system.rb
index 69919da9..511fb9ea 100644
--- a/lib/ohai/system.rb
+++ b/lib/ohai/system.rb
@@ -29,8 +29,6 @@ require 'ohai/provides_map'
require 'ohai/hints'
require 'mixlib/shellout'
-require 'ffi_yajl/json_gem'
-
module Ohai
class System
include Ohai::Mixin::ConstantHelper
diff --git a/ohai.gemspec b/ohai.gemspec
index 39c60924..f7487595 100644
--- a/ohai.gemspec
+++ b/ohai.gemspec
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.add_dependency "mime-types", "~> 1.16"
s.add_dependency "systemu", "~> 2.6.4"
- s.add_dependency "ffi-yajl", "~> 1.0"
+ s.add_dependency "ffi-yajl", "~> 1.1"
s.add_dependency "mixlib-cli"
s.add_dependency "mixlib-config", "~> 2.0"
s.add_dependency "mixlib-log"
diff --git a/platform_simulation_specs/plugins/erlang_spec.rb b/platform_simulation_specs/plugins/erlang_spec.rb
index fcee1e64..36b709f4 100644
--- a/platform_simulation_specs/plugins/erlang_spec.rb
+++ b/platform_simulation_specs/plugins/erlang_spec.rb
@@ -17,7 +17,6 @@
# limitations under the License.
#
-require 'json'
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
require File.expand_path( File.join( File.dirname( __FILE__ ), '..', 'common', 'ohai_plugin_common.rb' ))
diff --git a/spec/unit/plugins/erlang_spec.rb b/spec/unit/plugins/erlang_spec.rb
index 97c5cb14..c017e1ce 100644
--- a/spec/unit/plugins/erlang_spec.rb
+++ b/spec/unit/plugins/erlang_spec.rb
@@ -7,9 +7,9 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,7 +17,6 @@
# limitations under the License.
#
-require 'json'
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
describe Ohai::System, "plugin erlang" do
@@ -28,7 +27,7 @@ describe Ohai::System, "plugin erlang" do
@stderr = "Erlang (ASYNC_THREADS,SMP,HIPE) (BEAM) emulator version 5.6.2\n"
@plugin.stub(:shell_out).with("erl +V").and_return(mock_shell_out(0, "", @stderr))
end
-
+
it "should get the erlang version from erl +V" do
@plugin.should_receive(:shell_out).with("erl +V").and_return(mock_shell_out(0, "", @stderr))
@plugin.run
@@ -38,17 +37,17 @@ describe Ohai::System, "plugin erlang" do
@plugin.run
@plugin.languages[:erlang][:version].should eql("5.6.2")
end
-
+
it "should set languages[:erlang][:options]" do
@plugin.run
@plugin.languages[:erlang][:options].should eql(["ASYNC_THREADS", "SMP", "HIPE"])
end
-
+
it "should set languages[:erlang][:emulator]" do
@plugin.run
@plugin.languages[:erlang][:emulator].should eql("BEAM")
end
-
+
it "should not set the languages[:erlang] tree up if erlang command fails" do
@status = 1
@stdin = ""
diff --git a/spec/unit/plugins/php_spec.rb b/spec/unit/plugins/php_spec.rb
index 0046a665..cced3234 100644
--- a/spec/unit/plugins/php_spec.rb
+++ b/spec/unit/plugins/php_spec.rb
@@ -18,7 +18,6 @@
# limitations under the License.
#
-require 'json'
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '/spec_helper.rb'))
describe Ohai::System, "plugin php" do