summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-10-06 14:02:28 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-10-06 14:02:28 -0700
commit343cb04b63cbf3ecb5010b8873c241ed41806a5c (patch)
tree0592068e99153fd34db726f62dddf38d526617de
parent533c51401a4b623665146550d816f1910387a6b8 (diff)
downloadchef-343cb04b63cbf3ecb5010b8873c241ed41806a5c.tar.gz
lazy load ruby-prof
-rw-r--r--lib/chef/client.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/chef/client.rb b/lib/chef/client.rb
index 3315ae03dd..cc3fe4fd5c 100644
--- a/lib/chef/client.rb
+++ b/lib/chef/client.rb
@@ -53,11 +53,6 @@ require 'chef/platform/rebooter'
require 'chef/mixin/deprecation'
require 'ohai'
require 'rbconfig'
-begin
- require 'ruby-prof'
-rescue LoadError
- # ruby-prof is optional.
-end
class Chef
# == Chef::Client
@@ -902,7 +897,9 @@ class Chef
attr_reader :specific_recipes
def profiling_prereqs!
- if !defined? RubyProf
+ begin
+ require 'ruby-prof'
+ rescue LoadError
raise "You must have the ruby-prof gem installed in order to use --profile-ruby"
end
end