summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index d01a139c30..6a6e163a53 100644
--- a/Rakefile
+++ b/Rakefile
@@ -108,9 +108,19 @@ Dir[File.expand_path("../*gemspec", __FILE__)].reverse.each do |gemspec_path|
Gem::PackageTask.new(gemspec).define
end
+def with_clean_env(&block)
+ if defined?(Bundler)
+ Bundler.with_clean_env(&block)
+ else
+ block.call
+ end
+end
+
desc "Build and install a chef gem"
task :install => [:package] do
- sh %{gem install pkg/#{GEM_NAME}-#{VERSION}.gem --no-rdoc --no-ri}
+ with_clean_env do
+ sh %{gem install pkg/#{GEM_NAME}-#{VERSION}.gem --no-rdoc --no-ri}
+ end
end
task :uninstall do